Thanks for reporting a bug you have found in Cursor!
Please add the following info to help us diagnose your issue:
Check the forum to ensure the issue hasn’t been reported already
Provide a clear description of the bug
Explain how to reproduce the bug (if known)
Attach screenshots or recordings (e.g., .jpg, .png, .mp4).
Tell us your operating system and your Cursor version (e.g., Windows, 0.x.x).
Tell us if the issue stops you from using Cursor.
I’m using a python fastmcp stdio server with the following endpoint:
class City(StrEnum):
new_york = "new_york"
los_angeles = "los_angeles"
chicago = "chicago"
houston = "houston"
phoenix = "phoenix"
@mcp.tool()
def weather(city: City) -> str:
"""Get the weather for a city.
Args:
city: The city to get the weather for.
"""
return f"The weather in {city} is sunny."
this runs but then fails with Invalid type for parameter 'city' in tool weather
Debugger shows the following message
[MCPHandler] Type mismatch for weather.city: expected undefined, got string
I’m pretty sure this is because fastmcp will export the following schema:
{
"$defs": {
"City": {
"enum": [
"new_york",
"los_angeles",
"chicago",
"houston",
"phoenix",
],
"title": "City",
"type": "string",
}
},
"properties": {"city": {"$ref": "#/$defs/City"}},
"required": ["city"],
"title": "weatherArguments",
"type": "object"
}
the City enum is referenced as opposed to inlined.
So the question is, is this valid mcp schema specification? if so it’s a bug in cursor otherwise a bug in fastmcp
