Extract protocol types into a standalone mcp-types package#2762
Open
Kludex wants to merge 1 commit into
Open
Conversation
Convert the repository into a uv workspace mirroring pydantic/httpx2. The root pyproject becomes a pure coordinator (package = false) and the two distributable packages live nested under src/<pkg>/<pkg>/ each with their own pyproject: - src/mcp/mcp/ -> mcp - src/mcp-types/mcp_types/ -> mcp-types (import mcp_types) The protocol types (_types.py, jsonrpc.py) move into mcp_types, which only depends on pydantic and typing-extensions. mcp depends on mcp-types via uv-dynamic-versioning, so installing mcp still pulls the types in. The mcp.types module path is removed; all imports now use mcp_types. The curated re-exports on the top-level mcp package are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Converts the repository into a uv workspace mirroring
pydantic/httpx2, introducing a standalonemcp-typespackage for the protocol types.pyproject.tomlbecomes a pure coordinator ([tool.uv] package = false, no[project]); shared tool config (ruff, pyright, pytest, coverage) stays at root.src/<pkg>/<pkg>/with its ownpyproject.toml:src/mcp/mcp/→mcpsrc/mcp-types/mcp_types/→mcp-types(import namemcp_types, withpy.typed)_types.py,jsonrpc.py) move intomcp_types, which only depends onpydanticandtyping-extensions.mcpdepends onmcp-types=={{ version }}viauv-dynamic-versioning, so installingmcpcontinues to pull the types in.mcp.typesmodule path is removed; all imports now usemcp_types. The curated re-exports on the top-levelmcppackage (from mcp import Tool) are unchanged.README.v2.mdsnippets updated.Verification
uv lock/uv syncbuild both packages from their new locationsruff check+ruff format --check: cleanpyright: 0 errors./scripts/test: 1750 passed, 100% coverage,strict-no-covercleanAI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.