Skip to content

Add mcp-inspect tool to mcp-server command with automatic secret validation#1771

Merged
pelikhan merged 6 commits intomainfrom
copilot/add-mcp-inspect-tool
Oct 16, 2025
Merged

Add mcp-inspect tool to mcp-server command with automatic secret validation#1771
pelikhan merged 6 commits intomainfrom
copilot/add-mcp-inspect-tool

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 16, 2025

Plan: Add mcp-inspect tool to mcp-server command

  • Understand existing tool implementations in mcp_server.go
  • Add mcp-inspect tool to the MCP server with appropriate schema
  • Update tests to verify the new tool is exposed
  • Build and manually test the new tool
  • Run full test suite to ensure no regressions
  • Enable --check-secrets by default in mcp-inspect tool
  • Update mcp-server documentation

Summary

Successfully added a new mcp-inspect tool to the mcp-server command that exposes the mcp inspect CLI functionality through the MCP protocol.

Latest Update (documentation)

Updated mcp-server documentation: Added mcp-inspect tool to the documentation, including:

  • Tool description in the overview
  • Entry in the Available Tools section
  • Updated example in Using as Agentic Workflows Tool section

Changes were kept concise and brief as requested.

Implementation Details

New Tool: mcp-inspect

  • Exposes the gh aw mcp inspect command as an MCP tool
  • Secret checking enabled by default - validates GitHub Actions secrets when available
  • Parameters:
    • workflow_file (optional): Workflow file to inspect MCP servers from
    • server (optional): Filter to inspect only a specific MCP server
    • tool (optional): Show detailed information about a specific tool
  • Returns formatted text output showing available MCP servers, tools, resources, roots, and secret availability

Files Modified

  1. pkg/cli/mcp_server.go

    • Added mcpInspectArgs struct with proper JSON schema annotations
    • Implemented mcp-inspect tool handler with --check-secrets flag
    • Updated command documentation to mention automatic secret validation
  2. pkg/cli/mcp_server_test.go

    • Updated expected tools list to include mcp-inspect
  3. pkg/cli/mcp_server_inspect_test.go (new file)

    • TestMCPServer_InspectTool: Verifies tool is exposed and has proper description
    • TestMCPServer_InspectToolInvocation: Tests actual tool invocation with workflow
  4. docs/src/content/docs/tools/mcp-server.md

    • Added mcp-inspect to tool list in overview
    • Added tool description in Available Tools section
    • Updated example configuration

Testing Results

All unit tests pass (11 MCP server tests total)
Code formatted and linted successfully
Documentation updated concisely and briefly
Integration tests verify tool works with real workflows

Example Usage

Through the MCP protocol:

{
  "name": "mcp-inspect",
  "arguments": {
    "workflow_file": "ci-doctor",
    "server": "github",
    "tool": "get_repository"
  }
}

The tool will automatically check for GitHub Actions secrets and display their availability status if a GitHub token is available.

Original prompt

Add a new tool "mcp-inspect" to the mcp-server command in .go. The command runs the "mcp inspect" command of the cli.


💡 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.

- Added new mcp-inspect tool to MCP server exposing the 'mcp inspect' CLI command
- Tool supports workflow_file, server, and tool parameters
- Updated documentation in command help text
- Added comprehensive unit tests for the new tool
- All existing tests continue to pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add mcp-inspect tool to mcp-server command Add mcp-inspect tool to mcp-server command Oct 16, 2025
Copilot AI requested a review from pelikhan October 16, 2025 00:42
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot add --check-secrets to default flags (and ignore if the github_token is not present or has no permissions)

- Add --check-secrets flag to all mcp-inspect tool invocations
- Secret checking is silently ignored if GitHub token is unavailable
- Updated tool description to reflect automatic secret validation
- All tests pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot add --check-secrets to default flags (and ignore if the github_token is not present or has no permissions)

Added --check-secrets to default flags in commit 59ef1f5. The flag is now automatically included in all mcp-inspect invocations, and secret checking is silently skipped if GitHub token is unavailable or lacks permissions (403 errors are handled gracefully in the existing implementation).

Copilot AI changed the title Add mcp-inspect tool to mcp-server command Add mcp-inspect tool to mcp-server command with automatic secret validation Oct 16, 2025
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot update mcp-server docs, concisely and briefly.

@pelikhan pelikhan marked this pull request as ready for review October 16, 2025 01:40
@github-actions
Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request

github-actions Bot and others added 2 commits October 16, 2025 01:42
- Add mcp-inspect to list of available tools
- Update tool descriptions and examples
- Keep changes concise and brief

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot update mcp-server docs, concisely and briefly.

Updated mcp-server documentation in commit 55f02f8. Added mcp-inspect to the tool list, available tools section, and example configuration.

@pelikhan pelikhan merged commit 77d042d into main Oct 16, 2025
29 checks passed
@pelikhan pelikhan deleted the copilot/add-mcp-inspect-tool branch October 16, 2025 01:57
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.

2 participants