Skip to content

Commit de4db56

Browse files
authored
Merge pull request #11 from shiraayal-tadata/bugfix/pydantic-error-in-cursor-using-mcp
Bugfix/pydantic error in cursor using mcp
2 parents 8a86abb + f112643 commit de4db56

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ See the [examples](examples) directory for complete examples.
8181

8282
## Connecting to the MCP Server
8383

84-
Once your FastAPI app with MCP integration is running, you can connect to it with any MCP client, such as Claude:
84+
Once your FastAPI app with MCP integration is running, you can connect to it with any MCP client, such as Cursor:
8585

8686
1. Run your application
87-
2. In Claude, use the URL of your MCP server endpoint (e.g., `http://localhost:8000/mcp`)
88-
3. Claude will discover all available tools and resources automatically
87+
2. In Cursor -> Settings -> MCP, use the URL of your MCP server endpoint (e.g., `http://localhost:8000/mcp`) as sse.
88+
3. Cursor will discover all available tools and resources automatically
8989

9090
## Development and Contributing
9191

fastapi_mcp/http_tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from fastapi import FastAPI
1313
from fastapi.openapi.utils import get_openapi
1414
from mcp.server.fastmcp import FastMCP
15+
from pydantic import Field
1516

1617
logger = logging.getLogger("fastapi_mcp")
1718

@@ -435,7 +436,7 @@ def create_http_tool(
435436
required_props.append(param_name)
436437

437438
# Function to dynamically call the API endpoint
438-
async def http_tool_function(**kwargs):
439+
async def http_tool_function(kwargs: Dict[str, Any] = Field(default_factory=dict)):
439440
# Prepare URL with path parameters
440441
url = f"{base_url}{path}"
441442
for param_name, _ in path_params:

0 commit comments

Comments
 (0)