Skip to content

Trim fastmcp.types to FastMCP-unique types - #4584

Merged
jlowin merged 2 commits into
mainfrom
refactor/fastmcp-types-unique
Jul 21, 2026
Merged

Trim fastmcp.types to FastMCP-unique types#4584
jlowin merged 2 commits into
mainfrom
refactor/fastmcp-types-unique

Conversation

@jlowin

@jlowin jlowin commented Jul 21, 2026

Copy link
Copy Markdown
Member

fastmcp.types had drifted into a near-total mirror of mcp_types — about 29 bare from mcp_types import X as X re-exports (Completion, ContentBlock, CallToolResult, PromptMessage, and so on). That is pointless indirection: code importing an MCP protocol type should import it from mcp_types, not through a FastMCP alias that adds nothing.

This trims fastmcp.types to the one type FastMCP genuinely defines — Textarea — and repoints every internal call site, example, and docs code block at mcp_types directly. fastmcp.types now means "types that are FastMCP's own," which is what a reader expects it to mean.

This is not a breaking change. At the last release (v3.4.4) fastmcp.types.__all__ was exactly ["Textarea"]; every mirror was added later in unreleased work, so no released import breaks.

Label: enhancements

fastmcp.types re-exported 29 mcp_types symbols verbatim, which was
pointless indirection users had to discover. It now holds only Textarea,
the one type FastMCP actually defines; everything else imports from
mcp_types directly. These mirrors were added during unreleased SDK v2
migration work and never shipped, so this is not a breaking change.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e32a2098f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/getting-started/upgrading/from-fastmcp-2.mdx Outdated
@jlowin
jlowin merged commit 611a358 into main Jul 21, 2026
20 of 21 checks passed
@jlowin
jlowin deleted the refactor/fastmcp-types-unique branch July 21, 2026 13:45
@marvin-context-protocol marvin-context-protocol Bot added the enhancement Improvement to existing functionality. For issues and smaller PR improvements. label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to existing functionality. For issues and smaller PR improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant