Add CORS support, stateless HTTP mode, and CLI flags to MCP server#68
Add CORS support, stateless HTTP mode, and CLI flags to MCP server#68danstarns wants to merge 3 commits into
Conversation
|
@danstarns is attempting to deploy a commit to the lyonwj's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds browser-friendly MCP HTTP serving options and improves SSE compatibility, plus updates docs to help users get started quickly.
Changes:
- Added Streamable HTTP transport (
--transport streamable-http) with CORS support. - Improved SSE transport compatibility (no-op response +
/messagesmounted as ASGI app) and added CORS middleware. - Added
--allow-originand--openai-api-keyCLI flags; added new MCP Server Quick Start doc and linked it from README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/neo4j_agent_memory/mcp/server.py |
Adds Streamable HTTP transport, CORS configuration, SSE routing/response fixes, and new CLI flags integration. |
README.md |
Links to the new MCP server quick start. |
QUICKSTART.md |
New quick start guide documenting transports, CORS, and flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks @danstarns! Do you think you could fix the linting failure? I tried to get copilot to do it but no luck |
|
I think most of the changes in this PR: #67 covered what I was after, none the less here are some docs and a few more flags to make connecting from browser tools easier. I think the runners need another spin manually. |
Adds CORS middleware to HTTP/SSE transports, stateless HTTP mode for browser-based MCP clients, and new CLI flags for easier configuration.
Changes
--transport httpand--transport ssenow include configurable CORS via--allow-origin(repeatable, defaults to*). ExposesMcp-Session-Idheader for HTTP transport compatibility.--statelessCLI flag: Disables session ID tracking for HTTP transport. Required for browser-based MCP clients that don't forward theMcp-Session-Idheader — without this,tools/listand other requests afterinitializefail with400 Bad Request: Missing session ID.run_http()method: Added toNeo4jMemoryMCPServerfor programmatic HTTP transport usage with CORS andstateless_httpsupportrun_sse()updated: Now acceptsallow_originsparameter for CORS configuration--allow-originCLI flag: Repeatable flag to restrict CORS origins--openai-api-keyCLI flag: SetsOPENAI_API_KEYenv var for embeddings/extractionrun_server()updated: Passesallow_originsandstateless_httpthrough to transport middlewareUsage