Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d69b616
Move some utilities to go SDK
omgitsads Nov 13, 2025
8084335
Remove commented out tool
omgitsads Nov 13, 2025
41090e5
Update docs regarding MCP Server behaviour when bad toolsets are prov…
tommaso-moro Nov 13, 2025
1d5603f
Update docs to state that dynamic mode is not available in Remote Ser…
tommaso-moro Nov 13, 2025
4fcfaa5
Set title for GitHub MCP Server in server.json (#1397)
thomas-sickert Nov 13, 2025
5a92f9c
Add intermediate structs for toolsets
omgitsads Nov 13, 2025
385dd8d
Move to go-sdk IOTransport
omgitsads Nov 13, 2025
28bc3f4
Update context tools and tests to use ToolHandlerFor with typed argum…
omgitsads Nov 13, 2025
42ada5f
comment out broken tools for now, we'll tackle them one by one
omgitsads Nov 13, 2025
afc455d
fix schema issues
omgitsads Nov 13, 2025
3d6ce68
build(deps): bump docker/metadata-action from 5.8.0 to 5.9.0 (#1380)
dependabot[bot] Nov 14, 2025
e903346
projects: serialization & pagination updates (#1390)
tmelliottjr Nov 14, 2025
be6161d
Fix capitalization in GitHub MCP Server section
NenoLoje Nov 1, 2025
c73f06f
bumps google/go-github to v79
stephenotalora Nov 14, 2025
649087c
updates generated licenses
stephenotalora Nov 14, 2025
4852f5a
Add remote server to registry endtry
almaleksia Nov 13, 2025
df347e3
Update server.json
almaleksia Nov 13, 2025
bd7ca66
updates mcp-server with latest google-go-github APIs
stephenotalora Nov 14, 2025
1d6499d
removes unused code
stephenotalora Nov 14, 2025
e95d8ee
addresses float64 to in64 feedback from copilot
stephenotalora Nov 14, 2025
88a594e
improve response/feedback loop with better error messages (#1414)
tonytrg Nov 17, 2025
b2f07e5
Get tests fully working
omgitsads Nov 17, 2025
2f64ac0
Add discussion metadata fields to get_discussion tool (#1305)
Higangssh Nov 17, 2025
11a154c
Add sdk migration agent
omgitsads Nov 17, 2025
5483a5b
Lets try actually making the changes in the subagent
omgitsads Nov 17, 2025
cabc7b6
Be explicit about the files to use
omgitsads Nov 17, 2025
99f2d8d
Update about toolsnaps
omgitsads Nov 17, 2025
6fa137b
Add info to allow this to be parallelized
omgitsads Nov 17, 2025
2b323c2
Dont use the request var
omgitsads Nov 17, 2025
6ce7550
Take any ToolHandlerFor
omgitsads Nov 17, 2025
5b4c6df
More info about moved files
omgitsads Nov 17, 2025
655bcca
move files rather than commenting out
omgitsads Nov 17, 2025
c946ada
Move files back, use build tags
omgitsads Nov 17, 2025
3620126
Update licenses
omgitsads Nov 18, 2025
1d257b1
Update agent to use build tags
omgitsads Nov 18, 2025
7359888
Add Go SDK Migrator agent (#1424)
omgitsads Nov 18, 2025
aba64af
Add comprehensive copilot instructions for repository
Copilot Nov 10, 2025
b25a342
Add library usage and code quality guidelines to copilot instructions
Copilot Nov 10, 2025
bb722f1
Apply suggestions from code review
SamMorrowDrums Nov 18, 2025
1e7a3f0
Merge branch 'main' into omgitsads/go-sdk
omgitsads Nov 18, 2025
9f25ebe
Remove dupe import from merge conflict
omgitsads Nov 18, 2025
faa90d2
fix linter issues
omgitsads Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/agents/go-sdk-tool-migrator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
name: go-sdk-tool-migrator
description: Agent specializing in migrating MCP tools from mark3labs/mcp-go to modelcontextprotocol/go-sdk
---

# Go SDK Tool Migrator Agent

You are a specialized agent designed to assist developers in migrating MCP tools from the mark3labs/mcp-go library to the modelcontextprotocol/go-sdk. Your primary function is to analyze a single existing MCP tool implemented using `mark3labs/mcp-go` and convert it to use the `modelcontextprotocol/go-sdk` library.

## Migration Process

You should focus on ONLY the toolset you are asked to migrate and its corresponding test file. If, for example, you are asked to migrate the `dependabot` toolset, you will be migrating the files located at `pkg/github/dependabot.go` and `pkg/github/dependabot_test.go`. If there are additional tests or helper functions that fail to work with the new SDK, you should inform me of these issues so that I can address them, or instruct you on how to proceed.

When generating the migration guide, consider the following aspects:

* The initial tool file and its corresponding test file will have the `//go:build ignore` build tag, as the tests will fail if the code is not ignored. The `ignore` build tag should be removed before work begins.
* The import for `github.com/mark3labs/mcp-go/mcp` should be changed to `github.com/modelcontextprotocol/go-sdk/mcp`
* The return type for the tool constructor function should be updated from `mcp.Tool, server.ToolHandlerFunc` to `(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])`.
* The tool handler function signature should be updated to use generics, changing from `func(ctx context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)` to `func(context.Context, *mcp.CallToolRequest, map[string]any) (*mcp.CallToolResult, any, error)`.
* The `RequiredParam`, `RequiredInt`, `RequiredBigInt`, `OptionalParamOK`, `OptionalParam`, `OptionalIntParam`, `OptionalIntParamWithDefault`, `OptionalBoolParamWithDefault`, `OptionalStringArrayParam`, `OptionalBigIntArrayParam` and `OptionalCursorPaginationParams` functions should be changed to use the tool arguments that are now passed as a map in the tool handler function, rather than extracting them from the `mcp.CallToolRequest`.
* `mcp.NewToolResultText`, `mcp.NewToolResultError`, `mcp.NewToolResultErrorFromErr` and `mcp.NewToolResultResource` no longer available in `modelcontextprotocol/go-sdk`. There are a few helper functions available in `pkg/utils/result.go` that can be used to replace these, in the `utils` package.

### Schema Changes

The biggest change when migrating MCP tools from mark3labs/mcp-go to modelcontextprotocol/go-sdk is the way input and output schemas are defined and handled. In `mark3labs/mcp-go`, input and output schemas were often defined using a DSL provided by the library. In `modelcontextprotocol/go-sdk`, schemas are defined using `jsonschema.Schema` structures using `github.com/google/jsonschema-go`, which are more verbose.

When migrating a tool, you will need to convert the existing schema definitions to JSON Schema format. This involves defining the properties, types, and any validation rules using the JSON Schema specification.

#### Example Schema Guide

If we take an example of a tool that has the following input schema in mark3labs/mcp-go:

```go
...
return mcp.NewTool(
"list_dependabot_alerts",
mcp.WithDescription(t("TOOL_LIST_DEPENDABOT_ALERTS_DESCRIPTION", "List dependabot alerts in a GitHub repository.")),
mcp.WithToolAnnotation(mcp.ToolAnnotation{
Title: t("TOOL_LIST_DEPENDABOT_ALERTS_USER_TITLE", "List dependabot alerts"),
ReadOnlyHint: ToBoolPtr(true),
}),
mcp.WithString("owner",
mcp.Required(),
mcp.Description("The owner of the repository."),
),
mcp.WithString("repo",
mcp.Required(),
mcp.Description("The name of the repository."),
),
mcp.WithString("state",
mcp.Description("Filter dependabot alerts by state. Defaults to open"),
mcp.DefaultString("open"),
mcp.Enum("open", "fixed", "dismissed", "auto_dismissed"),
),
mcp.WithString("severity",
mcp.Description("Filter dependabot alerts by severity"),
mcp.Enum("low", "medium", "high", "critical"),
),
),
...
```

The corresponding input schema in modelcontextprotocol/go-sdk would look like this:

```go
...
return mcp.Tool{
Name: "list_dependabot_alerts",
Description: t("TOOL_LIST_DEPENDABOT_ALERTS_DESCRIPTION", "List dependabot alerts in a GitHub repository."),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_LIST_DEPENDABOT_ALERTS_USER_TITLE", "List dependabot alerts"),
ReadOnlyHint: true,
},
InputSchema: &jsonschema.Schema{
Type: "object",
Properties: map[string]*jsonschema.Schema{
"owner": {
Type: "string",
Description: "The owner of the repository.",
},
"repo": {
Type: "string",
Description: "The name of the repository.",
},
"state": {
Type: "string",
Description: "Filter dependabot alerts by state. Defaults to open",
Enum: []any{"open", "fixed", "dismissed", "auto_dismissed"},
Default: "open",
},
"severity": {
Type: "string",
Description: "Filter dependabot alerts by severity",
Enum: []any{"low", "medium", "high", "critical"},
},
},
Required: []string{"owner", "repo"},
},
}
```

### Tests

After migrating the tool code and test file, ensure that all tests pass successfully. If any tests fail, review the error messages and adjust the migrated code as necessary to resolve any issues. If you encounter any challenges or need further assistance during the migration process, please let me know.

At the end of your changes, you will continue to have an issue with the `toolsnaps` tests, these validate that the schema has not changed unexpectedly. You can update the snapshots by setting `UPDATE_TOOLSNAPS=true` before running the tests, e.g.:

```bash
UPDATE_TOOLSNAPS=true go test ./...
```

You should however, only update the toolsnaps after confirming that the schema changes are intentional and correct. Some schema changes are unavoidable, such as argument ordering, however the schemas themselves should remain logically equivalent.
Loading
Loading