Commit Graph

33 Commits

Author SHA1 Message Date
tim-watcha
e0d443c95e Add mount_path support for proper SSE endpoint routing with multiple FastMCP servers (#540)
Co-authored-by: ihrpr <inna.hrpr@gmail.com>
2025-05-07 11:14:25 +01:00
Akash D
3b1b213a96 Add message queue for SSE messages POST endpoint (#459) 2025-05-06 17:10:43 -07:00
Peter Raboud
2210c1be18 Add support for serverside oauth (#255)
Co-authored-by: David Soria Parra <davidsp@anthropic.com>
Co-authored-by: Basil Hosmer <basil@anthropic.com>
Co-authored-by: ihrpr <inna@anthropic.com>
2025-05-01 19:42:59 +01:00
Nyakku Shigure
58b989c0a3 Fix lifespan_context access example in README (#437) 2025-04-09 09:58:17 +01:00
anupsajjan
c2ca8e03e0 Docs : Enhance README to suggest commands for creating a new UV project before adding mcp dependency. (#408) 2025-04-02 14:51:50 +01:00
YungYueh ChanLee
a81b25ae8d Docs: Change README to correct pip installation command for MCP CLI support (#394) 2025-03-31 09:10:19 +02:00
Conor Branagan
d3bf9cd325 Fix typo in starlette import in README (#374) 2025-03-27 08:25:29 +01:00
Marcelo Trylesinski
ae77772ea8 Add strict mode to pyright (#315)
* Add strict mode to pyright

* Apply UP rule

* fix readme

* More correct

* Leave wrong Context for now

* Add strict mode to pyright

* Apply UP rule

* fix readme

* fix

* ignore
2025-03-20 09:13:08 +00:00
Niraj Fonseka
5a54d82459 fixing the imports for the prompts example (#318) 2025-03-19 14:42:45 +00:00
comfuture
a9aca20205 Option to mount SSE server to existing ASGI server (#312)
* Option to mount SSE server to existing ASGI server

Fixes #311

Add option to mount SSE server to an existing ASGI server.

* Add a new method `sse_app` in `src/mcp/server/fastmcp/server.py` to return an instance of the SSE server app.
* Update the `run_sse_async` method in `src/mcp/server/fastmcp/server.py` to use the new `sse_app` method.
* Update the documentation in `README.md` to include instructions on how to mount the SSE server to an existing ASGI server.
* Fix the example in `README.md` to use `app.mount('/', mcp.sse_app())` instead.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/modelcontextprotocol/python-sdk/issues/311?shareId=XXXX-XXXX-XXXX-XXXX).

* Add `sse_app` method and update `run_sse_async` method in `server.py`

* Add `sse_app` method to return an instance of the SSE server app
* Update `run_sse_async` method to use the new `sse_app` method

Update `README.md` to include instructions for mounting SSE server

* Add section on mounting the SSE server to an existing ASGI server

* fix: Move import statements to the top of the file/

* docs: Update README to reflect changes in mounting SSE server with Starlette

* docs: Formatting of SSE server mounting example in README
2025-03-19 05:26:49 +01:00
Samuel Colvin
3775916c5c lint docs examples (#286)
* lint docs examples

* format
2025-03-14 11:30:57 +00:00
john0312
ebb81d3b2b Update README to clarify installing mcp to project vs running mcp (#277)
uv add is for adding dependency to uv managed python projects, and folks
not familiar with uv may mistaken the command for running mcp. Added
wordings that clarifies this.
2025-03-13 14:35:53 +00:00
Jerome
ff22f48365 Add client handling for sampling, list roots, ping (#218)
Adds sampling and list roots callbacks to the ClientSession, allowing the client to handle requests from the server.

Co-authored-by: TerminalMan <84923604+SecretiveShell@users.noreply.github.com>
Co-authored-by: David Soria Parra <davidsp@anthropic.com>
2025-02-20 10:49:43 +00:00
David Soria Parra
4d3e05f6f6 refactor: improve lifespan context typing and documentation
- Add proper generic parameter for lifespan context type
- Update README with TypedDict example for strong typing
- Fix context variable initialization in server
- Improve property return type safety
- Remove redundant documentation
- Ensure compatibility with existing tests
2025-02-13 10:12:59 +00:00
David Soria Parra
e5815bd162 docs: update README with lifespan examples and usage
Add comprehensive documentation for lifespan support:
- Add usage examples for both Server and FastMPC classes
- Document startup/shutdown patterns
- Show context access in tools and handlers
- Clean up spacing in test files
2025-02-11 12:16:51 +00:00
David Soria Parra
f90cf6a2a5 docs: update read_resource examples to handle mime type
Update README examples to show proper handling of the new read_resource() return value
that includes mime type information.

Github-Issue:#152
2025-01-27 15:51:45 +00:00
Se7en
53fe3417bb fix: mcp install command with environment variables 2025-01-13 20:12:32 +08:00
David Soria Parra
7bbf71e29a docs: Add back advanced usage sections to README
Add back sections on low-level server implementation, client usage, MCP primitives and server capabilities that were previously removed.
2024-12-21 00:46:36 +00:00
David Soria Parra
ca3121282e docs: Update README to specify [cli] dependency for mcp CLI 2024-12-21 00:46:36 +00:00
David Soria Parra
45cea71d90 docs: Update README with FastMCP-style structure and examples 2024-12-21 00:46:36 +00:00
David Soria Parra
f2128a7977 docs: Update README with new structure and content 2024-12-21 00:46:35 +00:00
David Soria Parra
b90da481eb docs: Update README to recommend mcp.server.lowlevel and deprecate mcp.server 2024-12-21 00:41:59 +00:00
David Soria Parra
aa3b550ec6 docs: Update FastMCP import paths and dependencies 2024-12-21 00:41:59 +00:00
David Soria Parra
dad01945c7 docs: Update README.md to include FastMCP
Update the README.md to include FastMCP as the recommended way to build MCP servers. FastMCP is a high-level, Pythonic interface that makes it easy to build MCP servers with minimal boilerplate. The low-level implementation is still available for more control.

🤖 Generated with Claude CLI.

Co-Authored-By: Claude <noreply@anthropic.com>
2024-12-21 00:41:59 +00:00
Miguel
840ea48371 Updated example in README.md for increased outreach 2024-11-30 01:11:29 -08:00
Simon Willison
569acf077d Fix first Python demo so it works
You can't do async with ... outside of an async def function
2024-11-25 08:44:19 -08:00
David Soria Parra
48bf1336a3 Update README 2024-11-25 13:06:53 +00:00
Justin Spahr-Summers
a0b648605a Fix README links to docs/spec 2024-11-24 14:27:58 -06:00
David Soria Parra
464cb02fdd Update READMEs 2024-11-19 12:37:10 +00:00
David Soria Parra
500f48d1ad update package name in readme 2024-11-11 16:22:26 +00:00
Justin Spahr-Summers
f2f324cd5b Update README title 2024-11-11 16:00:48 +00:00
David Soria Parra
e94bf7fbba Add README 2024-11-07 14:57:56 +00:00
David Soria Parra
4cbf815430 Initial import 2024-09-24 22:04:19 +01:00