Why does MCP Inspector render FastMCP enum parameters as text fields instead of dropdowns?
Using MCP Inspector with a FastMCP Python server, tool parameters based on a Python Enum are rendered as text or JSON fields instead of a dropdown, even though tools/list contains the valid enum values. The values appear under $defs and are referenced via $ref rather than inline on the property. Why does the Inspector not render a dropdown in this case, and what is the recommended way to get one?
Originally asked on GitHub: https://github.com/modelcontextprotocol/inspector/issues/755
5 answers
Status: explained. The Inspector added dropdown support for standard inline enums (PR #842), but the implementation detects enums only when a property is a string with an enum array directly on it. FastMCP-generated tool schemas put enum definitions in JSON Schema $defs and reference them with $ref, sometimes inside anyOf with null for optional parameters, so the Inspector never sees an inline enum and falls back to a text/JSON input.
A maintainer confirmed that $ref/$defs are unsupported in the current implementation and explained why they are skeptical of supporting them in tool schemas: a definition referenced only once in a small inputSchema is a net token surplus and harder for a model to reason about. They did not rule out future support.
Updating with npx @modelcontextprotocol/inspector@latest does not fix this for $ref schemas; a user reported still seeing a text field after updating, and the tools/list response showed the enum only under $defs. The everything reference server's gzip tool renders as a dropdown because its enum is inline.
Workarounds from the thread: for TypeScript fast-mcp, avoid .refine() and avoid reusing schema definitions so Zod inlines the enum directly in the tool definition. For Python FastMCP, a user filed fastmcp issue #2236 about how the library emits enum schemas. General advice: inspect the tools/list response for your server; if the enum array is directly on the property you get a dropdown, but if it is behind $defs/$ref you will get a text field.
Did this work for you?What @juancarlosm tried on GitHub (Didn't work)
Reproduced with a minimal FastMCP Python server using Priority(str, Enum). tools/list returned the enum under $defs with the property as anyOf containing a $ref and null, and the dropdown did not appear.
Did this work for you?What @pamelafox tried on GitHub (Didn't work)
Ran npx @modelcontextprotocol/inspector@latest against the Azure Python MCP expense demo. Enums for category and payment_method still rendered as text/JSON fields because tools/list returned them as $ref references to $defs.
Did this work for you?What @cliffhall tried on GitHub (Outcome unclear)
A maintainer suggested writing TypeScript fast-mcp schemas without .refine() and without reusing schema definitions so enums are inlined directly in the tool definition instead of emitted as $defs/$ref.
Did this work for you?What @pamelafox tried on GitHub (Outcome unclear)
A user filed fastmcp issue #2236 asking whether FastMCP supports other ways of generating enum outputs that avoid $refs/$defs.
Did this work for you?
Related questions
- MCP Inspector 0.10.2 sends null for unset optional params (error -32602)?
- Why does npx @modelcontextprotocol/inspector fail with 'mcp-inspector: command not found' after 0.10.0?
- How do I increase MCP Inspector's 10-second request timeout?
- MCP Inspector crashes with 'Controller is already closed' on fastmcp Streamable HTTP
- Why does the MCP Inspector Docker container refuse connections on localhost:6274, and how do I fix it?