-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Remote MCP support (streamable http and sse) #21036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aac28ba to
c5d25f8
Compare
vkalintiris
approved these changes
Oct 2, 2025
stelfrag
pushed a commit
to stelfrag/netdata
that referenced
this pull request
Oct 3, 2025
* prepare for multiple mcp headends * fixed last * updated todo list * updated todo list * Add HTTP and SSE adapters for MCP * Select MCP SSE via Accept header * MCP: add HTTP/SSE transport support and fix chunked responses * MCP test client: await HTTP/SSE responses and harden SSE parsing * docs: drop completed MCP Phase 1/2 tasks from TODO * docs: renumber remaining MCP phases * docs: document HTTP/SSE MCP transports and remote-mcp usage * updated docs for mcp changes * bearer token in mcp-test-client * MCP authorization via http header (cherry picked from commit 891c583)
Merged
Ferroin
pushed a commit
that referenced
this pull request
Oct 15, 2025
* prepare for multiple mcp headends * fixed last * updated todo list * updated todo list * Add HTTP and SSE adapters for MCP * Select MCP SSE via Accept header * MCP: add HTTP/SSE transport support and fix chunked responses * MCP test client: await HTTP/SSE responses and harden SSE parsing * docs: drop completed MCP Phase 1/2 tasks from TODO * docs: renumber remaining MCP phases * docs: document HTTP/SSE MCP transports and remote-mcp usage * updated docs for mcp changes * bearer token in mcp-test-client * MCP authorization via http header (cherry picked from commit 891c583)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remote MCP Support: HTTP and SSE Transports
This PR adds direct HTTP and Server-Sent Events (SSE) transport support to Netdata's Model Context Protocol (MCP) implementation, enabling AI assistants to connect directly to Netdata without requiring the
nd-mcpbridge. It also allows the dev preview api key to be given to http authorization bearer header.Summary
Netdata's MCP server now supports three transport mechanisms:
/mcpendpoint/mcpendpoint/mcp?transport=sseor detected viaAccept: text/event-streamheaderThis enables modern MCP clients like
npx @modelcontextprotocol/remote-mcpto connect directly to Netdata's HTTP endpoints, while maintaining backward compatibility with stdio-based clients through the existing bridge.Key Changes
Core MCP Architecture:
mcp-jsonrpc.cmodule for transport-agnostic message processingmcp-request-id.c) - now handled individually by each transport adapterweb_clientfor MCP session managementNew Transport Adapters:
mcp-http.c: Implements chunked HTTP transport with proper content negotiationmcp-sse.c: Implements Server-Sent Events with event-based message framingmcp-websocket.cto use common JSON-RPC moduleEnhanced Test Client:
Documentation Updates:
docs/learn/mcp.mdsrc/web/mcp/README.mdwith direct connection examplesTechnical Details
Transport Selection:
The
/mcpendpoint automatically selects the transport based on:?transport=sseforces SSEAccept: text/event-streamtriggers SSEMessage Framing:
event: messageanddata:fieldsSession Management:
Each transport adapter maintains its own request tracking and session state, enabling proper message correlation and response routing.
Benefits
Testing
The MCP test client (
src/web/mcp/mcp-test-client/index.html) now supports all three transports and can be used to verify functionality:ws://localhost:19999/mcphttp://localhost:19999/mcphttp://localhost:19999/mcp?transport=sseMigration Path
nd-mcpbridge continue to work