chore: import upstream snapshot with attribution
CI / Ruff (push) Has been cancelled
CI / MyPy (push) Has been cancelled
CI / Test Python 3.10 (push) Has been cancelled
CI / Test Python 3.11 (push) Has been cancelled
CI / Test Python 3.12 (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:49:13 +08:00
commit 8f1970542a
85 changed files with 9550 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
---
title: Refreshing the Server
description: Adding endpoints after MCP server creation
icon: arrows-rotate
---
If you add endpoints to your FastAPI app after creating the MCP server, you'll need to refresh the server to include them:
```python {9-12, 15}
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
mcp.mount_http()
# Add new endpoints after MCP server creation
@app.get("/new/endpoint/", operation_id="new_endpoint")
async def new_endpoint():
return {"message": "Hello, world!"}
# Refresh the MCP server to include the new endpoint
mcp.setup_server()
```