-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Migrate repos toolset to modelcontextprotocol/go-sdk #1445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate repos toolset to modelcontextprotocol/go-sdk #1445
Conversation
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the repos toolset (18 tools) from mark3labs/mcp-go to modelcontextprotocol/go-sdk as part of the broader SDK migration effort tracked in #1428. The migration updates tool definitions, handler signatures, parameter extraction, and result types to align with the new SDK's API.
Key changes:
- Tool definitions converted from DSL-based
mcp.NewTool()to struct-basedmcp.Tool{}withjsonschema.Schema - Handler signatures changed from 2-parameter/2-return to 3-parameter/3-return pattern
- Result helpers migrated from
mcp.NewToolResult*toutils.NewToolResult*
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/tools.go | Uncommented repos and stargazers toolset registration to enable migrated tools |
| pkg/github/repositories.go | Migrated 18 repository tools to new SDK (GetCommit, ListCommits, CreateRepository, etc.) |
| pkg/github/repositories_test.go | Updated all tests to new handler signatures and schema casting patterns |
| pkg/github/helper_test.go | Consolidated resource result helpers into unified getResourceResult function |
| pkg/github/toolsnaps/*.snap | Updated 16 snapshots reflecting new schema format (property ordering, required array format) |
…igrate-repos-toolset-to-go-sdk










Migrates the
repostoolset (18 tools) frommark3labs/mcp-gotomodelcontextprotocol/go-sdkas part of the broader SDK migration tracked in #1428.Changes
Tool Definitions
mcp.NewTool()DSL tomcp.Tool{}structs withjsonschema.Schema(mcp.Tool, server.ToolHandlerFunc)to(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])(ctx, *request, args)and return(result, data, error)Before:
After:
Parameter Extraction
RequiredParam[T](request, "key")toRequiredParam[T](args, "key")args map[string]anyResult Types
mcp.NewToolResultText/Error/Resourcewithutils.NewToolResultText/Error/Resourcemcp.TextResourceContentsandmcp.BlobResourceContentsintomcp.ResourceContentsBlobfield from base64 string to[]byteTest Updates
schema := tool.InputSchema.(*jsonschema.Schema)Toolsnaps
Updated 16 snapshot files reflecting schema format changes (property ordering, required array format).
Tools Migrated
GetCommit, ListCommits, ListBranches, CreateOrUpdateFile, CreateRepository, GetFileContents, ForkRepository, DeleteFile, CreateBranch, PushFiles, ListTags, GetTag, ListReleases, GetLatestRelease, GetReleaseByTag, ListStarredRepositories, StarRepository, UnstarRepository
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.