mcpsmith
mcpsmith converts MCP servers into source-grounded, agent-native skill packs.
It resolves the real artifact behind an installed MCP, snapshots the source,
extracts tool evidence, synthesizes skills from that evidence, runs a second
agent review pass, verifies the generated artifacts, and can then atomically
install skills while removing the MCP config entry.
This repo is the standalone product. distill is historical context only.
What mcpsmith does
- Converts the MCP actually installed on disk, not just registry metadata.
- Resolves exact local, npm, PyPI, or repository-backed source before conversion.
- Produces inspectable staged artifacts that other agents can chain without prompts.
- Uses deterministic tool evidence first, with a narrow mapper fallback only for low-confidence tools.
- Installs generated skills under
~/.agents/skills/by default.
Installation
# Homebrew
# crates.io
How it works
- Find the MCP in local config and resolve its exact artifact identity.
- Materialize a local source snapshot for that exact artifact.
- Locate MCP definitions, tool handlers, tests, and docs to build evidence.
- Ask a backend to synthesize grounded skills from the evidence.
- Run a second review pass on the generated skills.
- Verify the resulting skill artifacts for format, grounding, and references.
- Optionally install the skills and remove the MCP entry atomically.
One-shot flow
Use one-shot when you want the full conversion in a single run:
tmpdir=""
HOME="/home"
Add --dry-run to execute the full pipeline without mutating installed skills
or MCP config.
Useful one-shot flags:
--jsonfor machine-readable output.--backend codex|claudeto force a backend.--backend-autoto allow fallback when a preferred backend is unavailable.--skills-dir <PATH>to send generated skills somewhere isolated.--config <PATH>to point at one or more MCP config files explicitly.
Staged flow
Use the staged flow when you want inspectable artifacts between phases:
tmpdir=""
resolve_json=""
resolve_artifact=""
snapshot_json=""
snapshot_artifact=""
evidence_json=""
evidence_artifact=""
synthesis_json=""
synthesis_artifact=""
review_json=""
review_artifact=""
HOME="/home"
The staged artifact files are written under .codex-runtime/stages/ and can be
reused by another agent with --from-resolve, --from-snapshot,
--from-evidence, and --from-bundle.
CLI quick reference
Common help entrypoints:
cargo run --quiet -- --helpcargo run --quiet -- resolve --helpcargo run --quiet -- evidence --helpcargo run --quiet -- run --help
Common commands:
cargo run --quiet -- <server> --dry-run --config "$TMPDIR/mcp.json" --skills-dir "$TMPDIR/skills"cargo run --quiet -- run <server> --json --config "$TMPDIR/mcp.json" --skills-dir "$TMPDIR/skills"cargo run --quiet -- resolve <server> --json --config "$TMPDIR/mcp.json"cargo run --quiet -- snapshot --json --from-resolve <artifact.json>cargo run --quiet -- evidence --json --from-snapshot <artifact.json>cargo run --quiet -- synthesize --json --from-evidence <artifact.json> --backend codexcargo run --quiet -- review --json --from-bundle <artifact.json> --backend codexcargo run --quiet -- verify --json --from-bundle <artifact.json>
Catalog and source resolution
mcpsmith has two source inputs:
- Local MCP config entries from
--configor discovered config files. - API-backed registry data used for catalog/census and fallback enrichment.
Catalog commands:
cargo run --quiet -- catalog synccargo run --quiet -- catalog stats
By default, catalog sync reads the official registry and Smithery. Use
--provider only when you want to override that default provider set
explicitly.
Resolution order is deterministic:
- local path
- npm package and version
- PyPI package and version
- repository URL and revision
- cached catalog fallback only if direct identity is insufficient
Remote-only or source-unavailable servers are blocked instead of being converted from metadata alone.
Backend behavior
Backend selection order is:
- explicit
--backend backend.preferencefrom~/.mcpsmith/config.yaml- auto-detect installed backends in
codex, thenclaudeorder
Use MCPSMITH_CODEX_COMMAND and MCPSMITH_CLAUDE_COMMAND for tests and local
backend overrides.
Output and artifacts
Generated skills default to ~/.agents/skills/:
~/.agents/skills/
playwright/
SKILL.md
.mcpsmith/
manifest.json
playwright--execute/
SKILL.md
Each staged command writes a JSON artifact under .codex-runtime/stages/.
One-shot runs also emit a run report with paths for resolve, snapshot,
evidence, synthesis, review, and verify.
Evidence artifacts include:
- the chosen registration and handler snippets for each tool
- confidence and diagnostics for deterministic matching
- test and documentation citations when they exist
- mapper fallback output only for low-confidence tools
run installs reviewed skills and removes the MCP config entry unless
--dry-run is set. In --dry-run mode it still writes the full staged artifact
set plus a preview skill tree.
Examples
Sample fixtures live under examples/:
examples/sample-mcp-config.jsonexamples/sample-review.jsonexamples/sample-run-report.jsonexamples/sample-skill-pack-tree.txt
Release Automation
Pushing to main triggers the release workflow. When the version in
Cargo.toml has not been released yet, the workflow will:
- publish release artifacts to GitHub Releases
- publish
mcpsmith-coreand thenmcpsmithto crates.io - update the Homebrew formula in
nclandrei/homebrew-tap
The workflow creates the v<version> tag automatically. You do not need to
push tags manually. If a non-draft GitHub release for the current version
already exists, automatic push runs exit without rebuilding artifacts. For an
intentional retry of the current version, use GitHub Actions workflow_dispatch
on the Release workflow.
Required GitHub Actions secrets:
CARGO_REGISTRY_TOKEN: crates.io API token with publish access formcpsmith-coreandmcpsmithHOMEBREW_TAP_TOKEN: GitHub token with push access tonclandrei/homebrew-tap
Release process:
# bump Cargo.toml versions first when needed
Troubleshooting
- No servers resolved: pass
--config "$TMPDIR/mcp.json"and confirm the file contains anmcpServersobject. - Artifact resolution blocked: inspect the
resolveartifact to see whether the server is remote-only or missing exact source identity. - Synthesis blocked: inspect the
evidenceartifact for missing handler/tests citations or unresolved tool locations. - Catalog sync output looks too wide: remember the default provider scope is
only
officialandsmithery; unexpected providers usually mean--providerwas passed explicitly. - Review rejected a skill: inspect the
reviewartifact and rerun synthesis with a better backend or better source evidence. - One-shot blocked: use
--dry-runfirst, then inspect the staged artifacts before rerunning one-shot without--dry-run.
Isolated verification
For local checks and smoke verification, keep all mutable state out of your real home directory:
Smoke helpers in this repo:
./scripts/smoke/smoke-test-installed-mcpsmith.sh./scripts/smoke/mock_fixture_flow.sh./scripts/smoke/live_public_mcp.sh --server memory./scripts/smoke/live_public_mcp.sh --server chrome-devtools./scripts/smoke/cli_verify_smoke.sh
For live or visual verification, set an isolated HOME, pass an explicit
--config, and write skills into an isolated --skills-dir.