feat(cli): pakx install end-to-end for MCP servers#1
Merged
Conversation
- Expand pakx-core::install::McpServer with version + McpTransport enum (Stdio/Http). Add lockfile_key, computed_integrity, short_name. - ClaudeCodeAdapter: project_root field + with_project_root builder, install_mcp writes to <project_root>/.mcp.json with read-modify-write merge that preserves unrelated server entries. uninstall falls back to MCP entry strip when no skill dir matches. - pakx-agents pulls in serde + serde_json for .mcp.json schema. - New pakx::install module: mcp_translate (Package install_hints → McpTransport; supports npm/pypi/docker stdio + remote http) + runner (resolve via RegistryClient → translate → install → write agents.lock). Failures collected per-dep so partial installs still emit a lockfile and human-readable summary. - pakx install CLI: --directory, --no-lockfile, --mcp-base-url (hidden, testing), --claude-home (hidden, testing). - Tests: 6 mcp_translate unit, 6 claude_code_mcp integration, 5 install end-to-end with wiremock. Updates claude_code.rs test that asserted install_mcp was Unsupported. Workspace test count ~108. Skills/subagents/prompts/commands/hooks listed as 'skipped' until Step 9 wires their sources + adapters. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
arwenizEr
added a commit
that referenced
this pull request
May 21, 2026
Same-named query against two different registry deployments was mapping to the same on-disk cache file, returning the stale earlier response. Reproduced on ubuntu CI in the federated search test: test #1 cached `acme/one`+`acme/two` for the OfficialMcpSource at mock-url-A; test #2 set up mock-url-B serving different content, but the empty-query cache key `official-mcp:search:` collided and the later test read the earlier mock's body. Cache key is now `{tag}@{base_url}:search:{query}` (and equivalent for fetch). Different registries can no longer collide. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arwenizEr
added a commit
that referenced
this pull request
May 21, 2026
* feat(registry-client): add Smithery source (search-only at v0.1) - SmitherySource against registry.smithery.ai (configurable base URL, TTL-cached like OfficialMcpSource). Returns Package rows from /servers with qualifiedName as canonical id, displayName as name, description, and full extra JSON in install_hints. - fetch() returns NotFound at v0.1 since Smithery's connection / config schema differs from the official MCP Registry's packages[] shape; install via Smithery lands in Phase A v2 once the translator grows a Smithery codepath. - pakx search now defaults to fanning out to both OfficialMcp + Smithery (parallel via RegistryClient::search). Flags: --smithery-base-url URL (hidden, testing); --no-smithery (opt out). - 5 new wiremock-backed source tests + 1 new end-to-end federated search test covering both sources. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(registry-client): include base URL in cache key Same-named query against two different registry deployments was mapping to the same on-disk cache file, returning the stale earlier response. Reproduced on ubuntu CI in the federated search test: test #1 cached `acme/one`+`acme/two` for the OfficialMcpSource at mock-url-A; test #2 set up mock-url-B serving different content, but the empty-query cache key `official-mcp:search:` collided and the later test read the earlier mock's body. Cache key is now `{tag}@{base_url}:search:{query}` (and equivalent for fetch). Different registries can no longer collide. 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
Implements Step 8 of the master prompt: real
pakx installloop for MCP server dependencies.pakx-core: expandMcpServerpayload withversion+McpTransportenum (Stdio { command, args, env }/Http { url, headers }). Addlockfile_key(),computed_integrity(),short_name().pakx-agents(Claude Code): newproject_rootfield +with_project_rootbuilder;install_mcpwrites to<project_root>/.mcp.jsonwith read-modify-write merge that preserves unrelated server entries.uninstallfalls back to MCP entry removal when no skill dir matches.pakx: newinstallmodule with two sub-modules:mcp_translate: turn an official-MCPPackage'sinstall_hintsinto a concreteMcpTransport— supports npm (npx -y), pypi (uvx), docker/oci (docker run), and remote HTTP/SSE.runner: read manifest → fan out viaRegistryClient→ translate → install via adapter → aggregate intoagents.lock. Failures collected per-dep so partial installs still produce a lockfile + summary.pakx install [-C dir] [--no-lockfile] [--mcp-base-url URL] [--claude-home DIR]. Last two flags hidden, for testing.Skills / subagents / prompts / commands / hooks are listed as "skipped (not yet supported)" until Step 9 wires their sources + adapters.
Test plan
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningsmcp_translateunit testsclaude_code_mcpintegration testspakx installtests with wiremock + temp project rootWorkspace test count rises to ~108.
🤖 Generated with Claude Code