refactor and add more examples

This commit is contained in:
Shahar Abramov
2025-04-09 01:22:51 +03:00
parent 005d54ef0e
commit b2ebc5cf05
10 changed files with 164 additions and 133 deletions

View File

@@ -2,12 +2,11 @@
Simple example of using FastAPI-MCP to add an MCP server to a FastAPI app.
"""
from examples.apps import items
from examples.setup import setup_logging
from examples.shared.apps import items
from examples.shared.setup import setup_logging
from fastapi_mcp import FastApiMCP
setup_logging()
@@ -17,8 +16,8 @@ mcp = FastApiMCP(
name="Item API MCP",
description="MCP server for the Item API",
base_url="http://localhost:8000",
describe_full_response_schema=True,
describe_all_responses=True,
describe_full_response_schema=True, # Describe the full response JSON-schema instead of just a response example
describe_all_responses=True, # Describe all the possible responses instead of just the success (2XX) response
)
mcp.mount()