What prerequisites are needed?
Python 3.10 or higher, the `uv` package manager, Node.js and npm (for the optional MCP Inspector), and an OpenAI API key (for the LangChain client). Git is required for cloning the repository.
@SDCalvo
基本情報
Example project demonstrating how to expose FastAPI endpoints as Model Context Protocol (MCP) tools using `fastapi-mcp`. Includes a basic LangChain agent (`langchain_client.py`) that connects to the local FastAPI server via HTTP/SSE using `langchain-mcp-adapters` to discover and
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"sse-mcp-and-langchain-client-example": {
"command": "uv",
"args": [
"init",
"#",
"If",
"pyproject.toml",
"doesnt exist"
]
}
}
}ツール一覧はまだありません
この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。
ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。
This example project demonstrates how to expose FastAPI endpoints as Model Context Protocol (MCP) tools using the fastapi-mcp library. It includes a LangChain agent client (langchain_client.py) that connects to the local FastAPI server via HTTP/SSE using langchain-mcp-adapters to discover and use the exposed tools. It is intended for learning and testing, runnable locally and connectable from MCP clients like Cursor’s agent.
Clone the repository, install uv, create a virtual environment, and install dependencies (fastapi, uvicorn, fastapi-mcp, langchain-mcp-adapters, langgraph, langchain-openai, python-dotenv). Create a .env file with your OpenAI API key. In one terminal, run uvicorn main:app --reload --port 8000. In a second terminal, run uv run python langchain_client.py. Optionally, test with the MCP Inspector via npx @modelcontextprotocol/inspector or configure Cursor using a .cursor/mcp.json with the server URL http://127.0.0.1:8000/mcp.
fastapi-mcp.Python 3.10 or higher, the `uv` package manager, Node.js and npm (for the optional MCP Inspector), and an OpenAI API key (for the LangChain client). Git is required for cloning the repository.
MCP tool names are derived from the FastAPI route’s `operation_id`. If not set explicitly, FastAPI generates an automatic name (e.g., `read_root__get`). Setting explicit `operation_id` values on routes is recommended for clearer tool names.
Use `netstat -ano | findstr "<PORT>"` (Windows) to find the process ID, then `taskkill /F /PID <PID>` to terminate it. Sometimes a short wait or restarting the IDE is needed for the OS to fully release the port.
Routes defined after calling `mcp.mount()` are not automatically included. Call `mcp.setup_server()` again after defining the new routes to refresh the tool list.
Yes. `fastapi-mcp` supports FastAPI dependencies for authorization and includes OAuth 2 support. Basic token passthrough can be configured via `mcp-remote` with headers, or server‑side dependencies can be added using `AuthConfig`.

MCP server for the Pocket Network agentic marketplace: search our catalog of data services and utilities and call them, paying per request in USDC on Base with x402. No account or API key. Search and describe are free; p

Official MCP server for imageat — AI image and video generation for AI assistants. Generate images and videos, and use 20+ editing tools (background remove/replace, inpainting, object eraser, relight, virtual try-on) dir

Free MCP for live and historical pricing for 13,000+ agents and MCPs. Never knowingly pay too much... or charge too little. Know the going rate. https://agentery.com.

scvd.store is an evidence observatory for agentic commerce. Independent signed observation of what other people's endpoints, artifacts and payments actually did among other things. USDC on Base, Arbitrum One, World Chain
AON MCP connects AI agents to real, buyable products and services with live pricing and tracked links—enabling builders to earn developer revenue share from attributed clicks and conversions.
コメント