Improvement MCP server for MCP inspector#201
Open
bettercallsaulj wants to merge 5 commits intomainfrom
Open
Conversation
added 4 commits
March 6, 2026 02:02
Add JsonValue type to ResponseResult variant to support arbitrary nested JSON responses. This enables proper MCP protocol compliance for responses like initialize that require nested object structures. Changes: - Add json::JsonValue to ResponseResult variant in types.h - Add JsonValue serialization handler in json_serialization.cc
Fix response formats for initialize, tools/list, and prompts/list to
comply with MCP protocol specification.
Changes:
- handleInitialize: Use proper nested JSON structure instead of flattened
dot notation (e.g., {"serverInfo": {"name": ...}} not {"serverInfo.name": ...})
- handleListTools: Wrap tools array in {"tools": [...]} object
- handleListPrompts: Wrap prompts array in {"prompts": [...]} object
Add CORS headers to all HTTP responses for browser-based MCP clients (e.g., MCP Inspector). Also add check to pass through already HTTP-formatted responses from routing filter. Changes: - Add Access-Control-Allow-Origin, Methods, and Headers to JSON responses - Add same CORS headers to SSE responses - Skip HTTP framing for responses that already have HTTP headers
Add support for browser-based MCP clients by handling CORS preflight requests and sending proper HTTP responses for JSON-RPC notifications. Changes: - Register OPTIONS handlers for /mcp, /mcp/events, /rpc, /health, /info - Add default OPTIONS handler for any unregistered path - Add CORS headers to /health and /info endpoint responses - Send HTTP 202 Accepted response for JSON-RPC notifications (notifications don't have JSON-RPC responses but HTTP requires one)
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
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
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.
No description provided.