Basic information
About FastAPI MCP SSE Server
A working example to create a FastAPI server with SSE-based MCP support
FastAPI MCP SSE is a MCP server in the Developer Tools category listed in the AddMCP.net directory, published by panz2018. Supported transport: stdio. Runtime: python. License: MIT. The repository has 52 GitHub stars. Source code is hosted on github.com. Related topics: fastapi, mcp, sse.
Setup
{
"mcpServers": {
"fastapi-mcp-sse": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/panz2018/fastapi_mcp_sse.git",
"start"
]
}
}
}
{
"mcpServers": {
"fastapi-mcp-sse": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/panz2018/fastapi_mcp_sse.git",
"start"
]
}
}
}
{
"servers": {
"fastapi-mcp-sse": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/panz2018/fastapi_mcp_sse.git",
"start"
]
}
}
}
FastAPI MCP SSE config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"fastapi-mcp-sse": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/panz2018/fastapi_mcp_sse.git",
"start"
]
}
}
}
FastAPI MCP SSE tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is FastAPI MCP SSE?
FastAPI MCP SSE is a Server-Sent Events (SSE) implementation built on the FastAPI framework that integrates the Model Context Protocol (MCP). It demonstrates how to embed MCP SSE endpoints (/sse and /messages/) into a full-featured FastAPI web application while keeping standard web routes like /, /about, and /status separate. This project is designed for developers who want to add MCP capabilities – allowing AI models to access external tools and data – into their FastAPI applications.
How to use FastAPI MCP SSE?
You can run the server directly without cloning the repository using uvx --from git+https://github.com/panz2018/fastapi_mcp_sse.git start. For full installation, create a virtual environment with uv venv, activate it, install dependencies with uv pip install -r pyproject.toml, then start the server via python src/server.py or uv run start. The server runs on http://localhost:8000 and provides MCP SSE endpoints at /sse and /messages/ alongside standard web routes. Debugging is done using the MCP Inspector with the command mcp dev ./src/weather.py.
Key features of FastAPI MCP SSE
- Server-Sent Events (SSE) integration with the Model Context Protocol (MCP)
- FastAPI framework with custom route support
- Unified web application combining MCP and standard web endpoints
- Clean separation of concerns between MCP and web functionality
- Modular architecture for easy extension with new routes
Use cases of FastAPI MCP SSE
- Enabling AI models to query real-time weather data through MCP tools
- Adding MCP SSE endpoints to an existing FastAPI web service
- Prototyping and debugging MCP tool integration with MCP Inspector
- Building hybrid applications that serve both standard web pages and MCP-based AI interactions
Frequently asked questions
1 What is the purpose of this server?
It provides a reference implementation for combining FastAPI web routing with MCP’s SSE transport, allowing developers to create FastAPI apps that expose both regular web endpoints and MCP tool capabilities.
2 What are the prerequisites to run the server?
Install the UV Package Manager (a Python package installer in Rust). Python and the dependencies listed in pyproject.toml are also required.
3 How can I test the MCP functionality?
Use the MCP Inspector: run mcp dev ./src/weather.py, open the inspector at http://localhost:5173, set the Transport Type to SSE and URL to http://localhost:8000/sse, then connect to list and run tools like get_alerts or get_forcast.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In