feat(cli)!: remove mcp-server mode and add scan foundations (Phase 0)#12
Merged
Merged
Conversation
- Remove the mcp-server and install-mcp-server commands and their package - Drop the now-unused go-sdk dependency and tidy modules - Add the X010 skipped-by-runtime-config code and category mapping - Accept serverUrl as an alias for url when parsing server configs - Introduce a no_mcp config type so empty configs parse without error BREAKING CHANGE: the mcp-server and install-mcp-server commands are removed; run agent-scanner via scan/inspect instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the experimental mcp-server / install-mcp-server CLI modes (including the internal/mcpserver/ package and its Go SDK dependency) and introduces Phase-0 “scan foundations” for later phases: a new skip-result code/category mapping, a serverUrl config alias, and a config type representing valid configs with no MCP servers.
Changes:
- Removed MCP server mode + installer commands and deleted the
internal/mcpserver/implementation and tests. - Added
serverUrl→urlalias handling (both in raw config parsing andRemoteServerJSON decoding). - Added
ConfigWithoutMCP(ConfigType()=="no_mcp") and updated discovery parsing/tests; added new error category → issue code mapping forskipped_by_runtime_config(X010).
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Removes documentation for MCP server mode. |
| internal/models/server.go | Adds RemoteServer.UnmarshalJSON supporting serverUrl alias. |
| internal/models/issue.go | Adds X010 (CodeSkippedByRuntimeConfig). |
| internal/models/errors.go | Adds ErrCatSkippedByRuntimeConfig and maps it to X010. |
| internal/models/errors_test.go | Adds tests for the full category→code map (incl. X010). |
| internal/models/config.go | Adds ConfigWithoutMCP; adds serverUrl alias in ServerConfigJSON and ToServerConfig. |
| internal/models/config_test.go | Adds tests for serverUrl alias paths and ConfigWithoutMCP. |
| internal/discovery/parser.go | Changes fallback parsing to return no_mcp for valid JSON with no servers. |
| internal/discovery/parser_test.go | Updates “unknown” test semantics and adds no_mcp coverage. |
| internal/discovery/parser_testdata_test.go | Updates testdata expectations for no_mcp vs unknown. |
| internal/cli/root.go | Unregisters removed mcp-server / install-mcp-server commands. |
| internal/cli/flags.go | Removes MCPServerFlags global state. |
| internal/cli/mcpserver.go | Deleted MCP server CLI command implementation. |
| internal/cli/install.go | Deleted installer CLI command implementation. |
| internal/mcpserver/server.go | Deleted MCP server implementation. |
| internal/mcpserver/server_test.go | Deleted MCP server tests. |
| internal/mcpserver/install.go | Deleted config installer implementation. |
| internal/mcpserver/install_test.go | Deleted installer tests. |
| go.mod | Removes modelcontextprotocol/go-sdk and related indirect deps after deletion. |
| go.sum | Removes checksums for dropped dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Treat JSON type mismatches in recognized config shapes as unknown format - Restrict the no_mcp fallback to JSON objects, excluding arrays and scalars - Add regression tests for malformed and non-object config inputs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Return a non-nil empty map for consistency with other MCPConfig types - Update the test to assert a non-nil empty server set Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Classify configs with an explicit null for a known MCP key as unknown - Keep valid empty objects classified as no_mcp - Add tests for null MCP keys and the empty-object regression Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 0 of the agent-scan → Go port plan: removes the experimental
mcp-server/install-mcp-servercommands (matching the upstream Python project, which deleted them) and lays the shared foundations later phases build on — a skip-result code, aserverUrlconfig alias, and a "valid-but-no-MCP" config type. Net effect is ~1300 lines deleted (theinternal/mcpserver/package) and ~207 lines of foundation code + tests added.AI Authorship
plan.mdChange classification
internal/models/(zero-dependency domain types consumed across discovery, inspect, pipeline, output, upload) and the config parser. A bug here propagates system-wide.Plan reference
Phase 0 of
plan.md("Shared foundations + mcp-server removal"). Scope decisions:mcp-server&install-mcp-serverremoved entirely (delete commands +internal/mcpserver/), matching agent-scan.X010+skipped_by_runtime_configcategory → code map.serverUrlas an alias forurlin server config parsing.ConfigWithoutMCP,ConfigType()=="no_mcp") instead of being treated as unknown/error.Deviation from plan (both deliberate, approved):
go-sdk(mcpclient implements MCP/JSON-RPC directly); it was used only by the deletedmcpserver. Rango mod tidy, removinggo-sdk+ 6 transitive deps.server.gofor theserverUrlalias; the actual config-file parse path isServerConfigJSONinconfig.go, so the alias lives there and in a newRemoteServer.UnmarshalJSON(for direct decode). Canonicalurlwins when both are present.Verification
errors_test.go(full category→code map incl. X010),config_test.go(serverUrl alias on both paths +ConfigWithoutMCP), parser tests updated (empty/no-MCP →no_mcp, malformed →unknown, newno_mcpregression)make fmt,make vet,make build,make lint(0 issues),make test(race + coverage) all pass../bin/agent-scanner mcp-serverandinstall-mcp-server→ exit 1 (unknown command)./bin/agent-scanner --help→ neither command listedscan/inspect/clients/versionstill workVerifiability check
Risk & rollback
mcp-server/install-mcp-serverare gone; any user/script invoking them will get an unknown-command error. The parser now classifies valid-but-no-MCP files asno_mcpinstead ofunknown(intentional; updated assertions).Reviewer guide
internal/models/server.go+internal/models/config.go—serverUrlalias precedence (canonicalurlwins) and the newConfigWithoutMCPtypeinternal/discovery/parser.go— the valid-JSON-vs-unparseable branch that decidesno_mcpvsunknowninternal/models/errors.go+issue.go— X010 /skipped_by_runtime_configmappinggo.mod/go.sum— confirm onlygo-sdk+ its transitive deps were droppedinternal/cli/{root,flags}.go— mechanical removal of the two command registrations + flags structinternal/mcpserver/deletions and README section removal🤖 Generated with Claude Code