Skip to content

Commit e10a4a1

Browse files
committed
add full response schema example
1 parent d9c7918 commit e10a4a1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Simple example of using FastAPI-MCP to add an MCP server to a FastAPI app.
3+
"""
4+
5+
from examples.apps import items
6+
7+
from fastapi_mcp import add_mcp_server
8+
9+
10+
# Add MCP server to the FastAPI app
11+
mcp = add_mcp_server(
12+
items.app,
13+
mount_path="/mcp",
14+
name="Item API MCP",
15+
description="MCP server for the Item API",
16+
base_url="http://localhost:8000",
17+
describe_full_response_schema=True,
18+
describe_all_responses=True,
19+
)
20+
21+
if __name__ == "__main__":
22+
import uvicorn
23+
24+
uvicorn.run(items.app, host="0.0.0.0", port=8000)

0 commit comments

Comments
 (0)