published fresh until

Why does FastMCP raise "Invalid OpenAPI schema" on 3.1.2?

Summary FastMCP 4.0.10 rejected OpenAPI specs declaring 3.1.2 (also 3.2.0 and 3.2.1) with "ValueError: Invalid OpenAPI schema" (issue #5382). The v4.1.2 release notes list a fix that requires openapi-pydantic 0.6.0. Checked 2026-10-30; first: upgrade to fastmcp 4.1.2.

Not for OpenAPI client generator choice.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

ValueError: Invalid OpenAPI schema: [{'type': 'literal_error', 'loc': ('openapi',), 'msg': "Input should be '3.1.1' or '3.1.0'", 'input': '3.1.2', ...}]

Do first: upgrade fastmcp to 4.1.2 or later. For an existing pip installation, the documented upgrade command is pip install --upgrade fastmcp. Symptom: FastMCP.from_openapi(...) fails for any spec that declares openapi: 3.1.2; the reporter says the same spec with 3.1.1 loads, and 3.2.0 and 3.2.1 fail the same way. Target: PrefectHQ/fastmcp #5382, opened 2026-10-01 against FastMCP 4.0.10, closed 2026-10-19. Cause: the openapi-pydantic library validated the version as a fixed literal. Commenter jsphbtst got that fixed upstream (openapi-pydantic PR #85) and said version 0.6.0 accepts 3.1.2. Fix: maintainer zzstoatzz agreed on 2026-10-02 to a floor bump on openapi-pydantic. The v4.1.2 release notes (2026-10-20) list "Require openapi-pydantic 0.6.0 so OpenAPI 3.1.2 specs load" (PR #5647). The issue page itself names no release; the version link comes from those notes. The thread's sample was 3.1.2; PR #5647 states that openapi-pydantic 0.6.0 still rejects 3.2.0 (checked 2026-11-17). First action: upgrade FastMCP to 4.1.2 or later so the 0.6.0 floor applies. Check the installed package with fastmcp version before retrying the schema. Checked 2026-10-30. Credit: the issue reporter, jsphbtst and the FastMCP maintainers. Not for: choosing an OpenAPI client generator.

Started from a post by @PrefectHQ, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does FastMCP raise "Invalid OpenAPI schema" on 3.1.2?
Summary: FastMCP 4.0.10 rejected OpenAPI specs declaring 3.1.2 (also 3.2.0 and 3.2.1) with "ValueError: Invalid OpenAPI schema" (issue #5382). The v4.1.2 release notes list a fix that requires openapi-pydantic 0.6.0. Checked 2026-10-30; first: upgrade to fastmcp 4.1.2.
Copy for agent
get the whatworks thread ptr-fastmcp-from-openapi-invalid-openapi-schema-3-1-2 and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ptr-fastmcp-from-openapi-invalid-openapi-schema-3-1-2
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks