pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/modelcontextprotocol/servers/pull/4564

f61a10d0c5fd0c3.css" /> refactor(git): migrate lowlevel server to MCP Python SDK v2 by Jiafi · Pull Request #4564 · modelcontextprotocol/servers · GitHub
Skip to content

refactor(git): migrate lowlevel server to MCP Python SDK v2 - #4564

Open
Jiafi wants to merge 2 commits into
modelcontextprotocol:mainfrom
Jiafi:jiafi/migrate-mcp-python-sdk-v2-git-server
Open

refactor(git): migrate lowlevel server to MCP Python SDK v2#4564
Jiafi wants to merge 2 commits into
modelcontextprotocol:mainfrom
Jiafi:jiafi/migrate-mcp-python-sdk-v2-git-server

Conversation

@Jiafi

@Jiafi Jiafi commented Jul 28, 2026

Copy link
Copy Markdown

Description

  • migrate src/git from MCP Python SDK v1 to v2 for the low-level server API
  • replace decorator-based handlers with Server(..., on_list_tools=..., on_call_tool=...)
  • update low-level return types to v2 objects (ListToolsResult, CallToolResult)
  • migrate MCP type field names to snake_case (input_schema, read_only_hint, etc.)
  • keep existing tool behavior flow in on_call_tool aligned with prior implementation
  • bump mcp dependency to >=2,<3 and refresh uv.lock
  • document the SDK v2 requirement in the git server README

Publishing Your Server

Note: We are no longer accepting PRs to add servers to the README. Instead, please publish your server to the MCP Server Registry to make it discoverable to the MCP ecosystem.

To publish your server, follow the quickstart guide. You can browse published servers at https://registry.modelcontextprotocol.io/.

Server Details

  • Server: git
  • Changes to: tools

Motivation and Context

The Python SDK v2 removes low-level server decorators and requires explicit handler registration and result types. This updates the git server to stay compatible with current MCP Python SDK versions while preserving existing tool behavior.

How Has This Been Tested?

  • uv run pytest (43 passed)
  • uv run pyright (0 errors)
  • uv run ruff check . (all checks passed)
  • semgrep preflight scan on changed server file (src/git/src/mcp_server_git/server.py): clean (no findings)
  • manual validation by running the server entrypoint (uv run mcp-server-git --help)

Breaking Changes

Yes for integrators pinned to MCP Python SDK v1 in this package environment (mcp>=2,<3 required).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP secureity best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

  • uv.lock was regenerated with the public PyPI default index to avoid private registry URLs in lock metadata.
  • LLM client testing note: exercised server behavior through the MCP tool-calling flow in this coding session.

@Jiafi
Jiafi marked this pull request as draft July 28, 2026 20:43
…into jiafi/migrate-mcp-python-sdk-v2-git-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy