Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

Closes: Part of #1428

Migrates the secret_protection toolset (GetSecretScanningAlert and ListSecretScanningAlerts) from mark3labs/mcp-go to modelcontextprotocol/go-sdk.

Changes

  • Tool definitions: Converted DSL-style schemas to explicit jsonschema.Schema structures
  • Handler signatures: Updated to mcp.ToolHandlerFor[map[string]any, any] with 3-value returns (*mcp.CallToolResult, any, error)
  • Parameter extraction: Now uses args map[string]any directly instead of extracting from request
  • Result helpers: Replaced mcp.NewToolResult* with utils.NewToolResult*
  • Test updates: Added toolsnaps validation and updated handler invocations
  • Toolset registration: Enabled secret_protection in DefaultToolsetGroup

Example of the schema migration:

// Before (mark3labs/mcp-go)
mcp.NewTool(
    "get_secret_scanning_alert",
    mcp.WithString("owner", mcp.Required()),
    mcp.WithString("repo", mcp.Required()),
    mcp.WithNumber("alertNumber", mcp.Required()),
)

// After (modelcontextprotocol/go-sdk)
mcp.Tool{
    Name: "get_secret_scanning_alert",
    InputSchema: &jsonschema.Schema{
        Type: "object",
        Properties: map[string]*jsonschema.Schema{
            "owner": {Type: "string"},
            "repo": {Type: "string"},
            "alertNumber": {Type: "number"},
        },
        Required: []string{"owner", "repo", "alertNumber"},
    },
}
Original prompt

Migrate the secret_protection 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 more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 18, 2025 11:28
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate secret protection toolset to modelcontextprotocol/go-sdk Migrate secret_scanning toolset to modelcontextprotocol/go-sdk Nov 18, 2025
Copilot finished work on behalf of omgitsads November 18, 2025 12:19
@LuluBeatson LuluBeatson self-requested a review November 19, 2025 10:27
@LuluBeatson
Copy link
Contributor

image

@LuluBeatson LuluBeatson marked this pull request as ready for review November 19, 2025 10:44
@LuluBeatson LuluBeatson requested a review from a team as a code owner November 19, 2025 10:44
Copilot AI review requested due to automatic review settings November 19, 2025 10:44
Copilot finished reviewing on behalf of LuluBeatson November 19, 2025 10:46
Copy link
Contributor

Copilot AI 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 the secret_protection toolset from mark3labs/mcp-go to modelcontextprotocol/go-sdk as part of a larger migration effort. It updates the implementation of GetSecretScanningAlert and ListSecretScanningAlerts tools to use the new SDK's API patterns and enables the toolset in the default toolset group.

Key changes:

  • Converted DSL-style tool schemas to explicit jsonschema.Schema structures
  • Updated handler signatures to return 3 values: (*mcp.CallToolResult, any, error)
  • Migrated parameter extraction from mcp.CallToolRequest to map[string]any args
  • Replaced mcp.NewToolResult* helpers with utils.NewToolResult*

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/github/secret_scanning.go Migrated tool definitions and handlers from mark3labs/mcp-go to modelcontextprotocol/go-sdk API
pkg/github/secret_scanning_test.go Updated tests to invoke handlers with new 3-value signature and added toolsnaps validation
pkg/github/tools.go Uncommented secretProtection toolset registration to enable it in the default toolset group
pkg/github/__toolsnaps__/get_secret_scanning_alert.snap Added JSON schema snapshot for get_secret_scanning_alert tool
pkg/github/__toolsnaps__/list_secret_scanning_alerts.snap Added JSON schema snapshot for list_secret_scanning_alerts tool

@omgitsads omgitsads merged commit 66e6ad5 into omgitsads/go-sdk Nov 19, 2025
13 of 14 checks passed
@omgitsads omgitsads deleted the copilot/migrate-secret-protection-toolset branch November 19, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants