Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

Copy link
Contributor

CopilotAI commentedNov 20, 2025
edited
Loading

Migrates therepos toolset (18 tools) frommark3labs/mcp-go tomodelcontextprotocol/go-sdk as part of the broader SDK migration tracked in#1428.

Changes

Tool Definitions

  • Converted frommcp.NewTool() DSL tomcp.Tool{} structs withjsonschema.Schema
  • Changed tool handler signatures from(mcp.Tool, server.ToolHandlerFunc) to(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])
  • Updated handler functions to accept(ctx, *request, args) and return(result, data, error)

Before:

funcGetCommit(...) (mcp.Tool, server.ToolHandlerFunc) {returnmcp.NewTool("get_commit",mcp.WithString("owner",mcp.Required(),...),...    ),func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {owner,_:=RequiredParam[string](request,"owner")...returnmcp.NewToolResultText(data),nil    }}

After:

funcGetCommit(...) (mcp.Tool, mcp.ToolHandlerFor[map[string]any,any]) {tool:= mcp.Tool{Name:"get_commit",InputSchema:&jsonschema.Schema{Properties:map[string]*jsonschema.Schema{"owner": {Type:"string",...},            },Required: []string{"owner",...},        },    }handler:= mcp.ToolHandlerFor[map[string]any,any](func(ctx context.Context,_*mcp.CallToolRequest,argsmap[string]any) (*mcp.CallToolResult,any,error) {owner,_:=RequiredParam[string](args,"owner")...returnutils.NewToolResultText(data),nil,nil        })returntool,handler}

Parameter Extraction

  • Changed fromRequiredParam[T](request, "key") toRequiredParam[T](args, "key")
  • Updated optional parameter helpers to extract fromargs map[string]any

Result Types

  • Replacedmcp.NewToolResultText/Error/Resource withutils.NewToolResultText/Error/Resource
  • Unifiedmcp.TextResourceContents andmcp.BlobResourceContents intomcp.ResourceContents
  • ChangedBlob field from base64 string to[]byte

Test Updates

  • Updated all handler invocations to new 3-parameter, 3-return signature
  • Added schema casting:schema := tool.InputSchema.(*jsonschema.Schema)
  • Fixed resource content assertions for unified type

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

Migrate therepos toolset to modelcontextprotocol/go-sdk.

This will be merged into the parent PR#1428, so reference that PR in the description to track the migration

Custom agent used: go-sdk-tool-migrator
Agent specializing in migrating MCP tools from mark3labs/mcp-go to modelcontextprotocol/go-sdk


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

CopilotAIand others added4 commitsNovember 20, 2025 10:20
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>
CopilotAI changed the title[WIP] Migrate repos toolset to modelcontextprotocol/go-sdkMigrate repos toolset to modelcontextprotocol/go-sdkNov 20, 2025
Copilot finished work on behalf ofomgitsadsNovember 20, 2025 10:52
CopilotAI requested a review fromomgitsadsNovember 20, 2025 10:52
@LuluBeatson

This comment was marked as outdated.

@LuluBeatsonLuluBeatson self-requested a reviewNovember 24, 2025 10:48
@LuluBeatsonLuluBeatson marked this pull request as ready for reviewNovember 24, 2025 11:40
@LuluBeatsonLuluBeatson requested a review froma team as acode ownerNovember 24, 2025 11:40
CopilotAI review requested due to automatic review settingsNovember 24, 2025 11:40
Copilot finished reviewing on behalf ofLuluBeatsonNovember 24, 2025 11:42
Copy link
Contributor

CopilotAI left a 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 therepos toolset (18 tools) frommark3labs/mcp-go tomodelcontextprotocol/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-basedmcp.NewTool() to struct-basedmcp.Tool{} withjsonschema.Schema
  • Handler signatures changed from 2-parameter/2-return to 3-parameter/3-return pattern
  • Result helpers migrated frommcp.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
FileDescription
pkg/github/tools.goUncommented repos and stargazers toolset registration to enable migrated tools
pkg/github/repositories.goMigrated 18 repository tools to new SDK (GetCommit, ListCommits, CreateRepository, etc.)
pkg/github/repositories_test.goUpdated all tests to new handler signatures and schema casting patterns
pkg/github/helper_test.goConsolidated resource result helpers into unifiedgetResourceResult function
pkg/github/toolsnaps/*.snapUpdated 16 snapshots reflecting new schema format (property ordering, required array format)

@LuluBeatson
Copy link
Contributor

ScreenshotsScreenshot 2025-11-24 at 11 52 55imageScreenshot 2025-11-24 at 11 53 55imageimageimageimageimageimageimage

@omgitsadsomgitsads merged commit001e0a1 intoomgitsads/go-sdkNov 24, 2025
13 of 14 checks passed
@omgitsadsomgitsads deleted the copilot/migrate-repos-toolset-to-go-sdk branchNovember 24, 2025 14:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@LuluBeatsonLuluBeatsonLuluBeatson approved these changes

@omgitsadsomgitsadsAwaiting requested review from omgitsads

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@LuluBeatson@omgitsads

[8]ページ先頭

©2009-2025 Movatter.jp