mcp-rest-sample
Python sample code for MCP server + REST API (FastAPI) integration.
The MCP server with REST API integration using FastAPI is a project designed to demonstrate how to effectively integrate a Model Context Protocol (MCP) server with a RESTful API using FastAPI. This project utilizes the Python SDK for MCP to handle the protocol and employs 'uv' for managing dependencies. The integration with FastAPI allows for seamless handling of both REST API requests and MCP server operations. The project structure is inspired by the 'panz2018/fastapi_mcp_sse' repository, providing a robust framework for developers looking to implement similar integrations. The documentation includes commands for local development and instructions on how to run or connect to the MCP server, making it accessible for developers to contribute or adapt the project for their own needs.
Features
- Integration with FastAPI for REST API handling.
- Utilizes Python SDK for MCP protocol management.
- Dependency management using 'uv'.
- Inspired project structure for ease of use.
- Comprehensive documentation for development and connection.
Usage with Different Platforms
Python
python
import uvicorn
from fastapi import FastAPI
from mcp import MCPServer
app = FastAPI()
mcp_server = MCPServer()
@app.get("/")
async def root():
return {"message": "Hello World"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
Related MCP Servers
View all developer_tools servers →context7
by upstash
Context7 MCP provides up-to-date, version-specific documentation and code examples directly into your prompt, enhancing the capabilities of LLMs by ensuring they use the latest information.
Sequential Thinking
by modelcontextprotocol
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.
git-mcp
by idosal
GitMCP is a free, open-source, remote Model Context Protocol (MCP) server that transforms GitHub projects into documentation hubs, enabling AI tools to access up-to-date documentation and code.
Everything MCP Server
by modelcontextprotocol
The Everything MCP Server is a comprehensive test server designed to demonstrate the full capabilities of the Model Context Protocol (MCP). It is not intended for production use but serves as a valuable tool for developers building MCP clients.
exa-mcp-server
by exa-labs
A Model Context Protocol (MCP) server allows AI assistants to use the Exa AI Search API for real-time web searches in a secure manner.
repomix
by yamadashy
Repomix is a tool that packs your codebase into AI-friendly formats, making it easier to use with AI tools like LLMs.
mcpdoc
by langchain-ai
MCP LLMS-TXT Documentation Server provides a structured way to manage and retrieve LLM documentation using the Model Context Protocol.