Skip to content

Conversation

dsp-ant
Copy link
Member

@dsp-ant dsp-ant commented Nov 11, 2024

This PR reworks how we deal with types from the spec and other types in the Python SDK. Namely it removes some helper types that were aimed to make usage slightly simpler. It also removes all re-exported types in mcp.server.

The goal is to expose more consistent modules with less potential for name collision. We are also deliberately staying a bit more low-level in how we expect results to be returned.

The best way to review this PR is by going commit to commit instead of the full PR.

Fixes #34

The helper types in mcp.server.types got really confusioning during
implementation as they overlapped with mcp.types. I now believe it
is better if we stay more low level to the spec types.

To do this, we now only use mcp.types everywhere. We renamed mcp.server.types
to mcp.server.models and removed it to the absolute minimum.
@dsp-ant dsp-ant changed the title davidsp/types Types Rework Nov 11, 2024
@dsp-ant dsp-ant added the bug Something isn't working label Nov 11, 2024
@dsp-ant dsp-ant added this to the Public Release milestone Nov 11, 2024
We will be a bit more low level and expect callees to import mcp.types
instead of relying in re-exported types. This makes usage more explicit
and avoids potential collisions in mcp.server.
@dsp-ant dsp-ant merged commit 99c402d into main Nov 11, 2024
5 checks passed
@dsp-ant dsp-ant deleted the davidsp/types branch November 11, 2024 21:02
gspencergoog pushed a commit to gspencergoog/mcp-python-sdk that referenced this pull request Jul 29, 2025
…justin/is-error-optional

`CallToolResult.isError` should be optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent usage of types between mcp_python.types and mcp_python.server.types

2 participants