Skip to content
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

feat: add serve command to mount MCP as SSE server #239

Open
wants to merge 2 commits into
base: gh/ezyang/182/base
Choose a base branch
from

Conversation

ezyang
Copy link
Owner

@ezyang ezyang commented Apr 13, 2025

Stack from ghstack (oldest at bottom):

It is possible to mount the mcp to an SSE server. Add a new command 'codemcp serve' which mounts the MCP as an SSE server. Set CORS so claude.ai is allowed. Below is sample code how to do this.

5ef9e25  (Base revision)
a65616f  Snapshot before codemcp change
50c8fcb  Add uvicorn and starlette as explicit dependencies
3262e89  Add imports for SSE server implementation
dd5e30f  Add create_sse_app function and serve CLI command
7882368  Add end-to-end test for serve command
d9b4eef  Add documentation for the serve command in README.md
1ce6649  Snapshot before auto-format
c7911f9  Auto-commit format changes
b87cc99  Auto-commit lint changes
83e50c0  Add main.py to ignoreExtraErrors for type checking
088e9c2  Add other modules to ignoreExtraErrors for type checking
9b988b4  Add requests as a dev dependency for tests
a2b5170  Add sse_app method to FastMCP stub
58b418f  Simplify test to avoid external dependency on requests
HEAD     Add pytest-asyncio as a dev dependency

codemcp-id: 252-feat-add-serve-command-to-mount-mcp-as-sse-server

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Apr 13, 2025
It is possible to mount the mcp to an SSE server. Add a new command 'codemcp serve' which mounts the MCP as an SSE server. Set CORS so claude.ai is allowed. Below is sample code how to do this.

```git-revs
5ef9e25  (Base revision)
a65616f  Snapshot before codemcp change
50c8fcb  Add uvicorn and starlette as explicit dependencies
3262e89  Add imports for SSE server implementation
dd5e30f  Add create_sse_app function and serve CLI command
7882368  Add end-to-end test for serve command
d9b4eef  Add documentation for the serve command in README.md
1ce6649  Snapshot before auto-format
c7911f9  Auto-commit format changes
b87cc99  Auto-commit lint changes
83e50c0  Add main.py to ignoreExtraErrors for type checking
088e9c2  Add other modules to ignoreExtraErrors for type checking
9b988b4  Add requests as a dev dependency for tests
a2b5170  Add sse_app method to FastMCP stub
58b418f  Simplify test to avoid external dependency on requests
HEAD     Add pytest-asyncio as a dev dependency
```

codemcp-id: 252-feat-add-serve-command-to-mount-mcp-as-sse-server
ghstack-source-id: 761a295475bb25aa75fd0463fc7bb748fa8e124b
Pull-Request-resolved: #239
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant