Add support for exact relative path resolution in mcp inspect command#1768
Add support for exact relative path resolution in mcp inspect command#1768
mcp inspect command#1768Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
mcp inspect command
|
@copilot search all workflows under .github/workflows as long as the subpath matches. First full relative path match then a.md -> .github/workflows/a.md There is already logic in the add command to do this kind of resolutions, refactor and reuse. |
- Walk entire .github/workflows tree to find workflow files - Support full relative path matching (e.g., shared/mcp/serena.md) - Support subpath matching (e.g., mcp/serena matches shared/mcp/serena.md) - Support basename matching (e.g., serena matches any serena.md in subdirs) - Resolution priority: exact path > exact relative path > subpath match > basename match Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Refactored The function now supports:
Resolution priority: exact path → exact relative path → subpath match → basename match Commit: Refactor ResolveWorkflowPath to support recursive subpath matching Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot remove recursive subpath matching |
mcp inspect commandmcp inspect command
Simplified to only support exact relative paths under .github/workflows: - a.md -> .github/workflows/a.md - shared/b.md -> .github/workflows/shared/b.md Removed recursive directory walking and fuzzy matching (basename/suffix). Users must provide full relative path to access nested workflows. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Removed recursive subpath matching. Now only supports exact relative paths:
Users must provide full relative path for nested workflows (e.g., Commit: Remove recursive subpath matching from ResolveWorkflowPath Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
mcp inspect commandmcp inspect command
|
Agentic Changeset Generator triggered by this pull request |
Summary
The
gh aw mcp inspectcommand now supports exact relative path resolution for workflow files under.github/workflows, making it easier to inspect MCP server configurations in subdirectories.Problem
Previously,
mcp inspectcould only resolve workflow files from the.github/workflows/directory. Shared MCP configurations likeserena.md,tavily.md, and other files in subdirectories likeshared/mcp/required users to provide full absolute or relative paths:Solution
Enhanced the
ResolveWorkflowPathfunction to support exact relative path resolution under.github/workflows:.github/workflows(e.g.,shared/b.md→.github/workflows/shared/b.md)Changes
pkg/cli/resolver.go: Enhanced path resolution to support exact relative paths under.github/workflowspkg/cli/resolver_test.go: Added comprehensive tests covering full relative paths with and without.mdextensionpkg/cli/mcp_inspect.go: Updated inspector flag to use the enhanced path resolutionExamples
Users must provide the full relative path to access nested workflows:
All existing functionality remains unchanged:
Testing
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.