mcpfold

mcpfold

Local-first CLI + proxy that curates your MCP servers per client from one canonical config, cutting tool-schema tokens ~80% and resolving secret references instead of hardcoding keys.

Category
Visit Server

README

<h1 align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./assets/logo-readme-dark.png" /> <img src="./assets/logo-readme-light.png" alt="mcpfold" width="380" /> </picture> </h1>

<p align="center"> <strong>Connect every MCP server without paying the context-window tax.</strong><br /> One canonical config, folded out to every client — loading only the tools each agent needs, and resolving secret <em>references</em> instead of hardcoding values. </p>

<p align="center"> <a href="https://www.npmjs.com/package/mcpfold"><img alt="npm version" src="https://img.shields.io/npm/v/mcpfold?color=4F46E5&label=npm" /></a> <a href="https://www.npmjs.com/package/mcpfold"><img alt="downloads" src="https://img.shields.io/npm/dm/mcpfold?color=06B6D4" /></a> <a href="https://github.com/dj-pearson/MCPFold/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/dj-pearson/MCPFold/ci.yml?branch=main&label=CI" /></a> <a href="./LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-green" /></a> <img alt="node" src="https://img.shields.io/node/v/mcpfold" /> </p>

<p align="center"> <img src="./docs/assets/demo.svg" alt="mcpfold demo: init → import → sync → diff, cutting tool-schema tokens ~80%" width="820" /> </p>

<sub>Demo regenerated from the real CLI with pnpm demo:record (an asciinema cast + this SVG; a GIF renders in CI via demo/mcpfold.tape). Server names shown are examples — no endorsement implied.</sub>

v1.0.0 is live. The local-first CLI + core are stable and free forever, MIT-licensed — install below. The optional hosted cloud (accounts, config sync, teams) is self-hostable. Full docs live in docs/; the story-by-story build history is in prd.json.


Why mcpfold

The context-window tax

Every MCP server you connect dumps its full tool schema into your agent's context window on every turn — used or not. mcpfold's local proxy curates the toolset per client. In a reproducible benchmark — github (20 tools), supabase (15), playwright (10), 45 tools total — curating down to the 9 actually needed cuts tool-schema tokens by ~80% (7,476 → 1,497), with no extra config because the shim already in the launch path does the filtering.

…and one config for every client

MCP config sprawls across clients (Claude Code, Cursor, VS Code, Windsurf, Zed, …), and the formats have quietly diverged: VS Code uses the root key servers, Zed uses context_servers, everyone else uses mcpServers. Secrets get hardcoded into plaintext JSON. mcpfold keeps one canonical file and folds it out to each client — resolving secret references (never values) and curating which servers and tools each client loads.

  • One source of truth — a commented mcp.config.jsonc, version-safe and editor-validated.
  • Secret-safe — configs carry ${scheme:path} references; resolved values never touch disk.
  • Fewer tokens — per-client, per-agent tool curation via a local proxy.
  • Portable — deterministic, byte-stable output for every client format.

Install

Every channel resolves to the same version for a given release (a CI check enforces parity), so mix them across machines. Full details in docs/install.md.

npm / npx — no install needed to try it:

npx mcpfold init
npm install -g mcpfold      # or: pnpm add -g mcpfold   (installs `mcpfold` + the `mcpf` alias)

Homebrew (macOS / Linux):

brew install dj-pearson/tap/mcpfold

Scoop (Windows):

scoop bucket add mcpfold https://github.com/dj-pearson/scoop-bucket
scoop install mcpfold

curl | sh (macOS / Linux) — standalone binary, no Node, checksum-verified:

curl -fsSL https://mcpfold.com/install.sh | sh

Standalone binary — download for your platform from the latest release (macOS arm64/x64, Linux x64/arm64, Windows x64), verify the .sha256, and put it on your PATH.

mcpfold --version

Quickstart

Requires Node 20+ (for the npm/npx install; the binaries need nothing). mcpfold auto-detects whichever MCP clients you have installed.

mcpfold init      # 1. scaffold a commented mcp.config.jsonc (+ $schema for editor autocomplete)
mcpfold import    # 2. scan installed clients and merge their servers into the canonical file
mcpfold sync      # 3. fold the canonical config out to every detected client (native formats)
mcpfold diff      # preview what sync would change, per client, before applying
mcpfold doctor    # health-check config, clients, and secret references

Other commands: secret (manage secret references), run (launch the curating proxy), status, add. See the full Quickstart and command reference.

Supported clients

Claude Code · Claude Desktop · Cursor · VS Code · Windsurf · Zed — mcpfold reads and writes each one's native format from a single source of truth. (New adapters are a one-PR on-ramp.)

Editor autocomplete (JSON Schema)

mcpfold init adds a $schema line so editors give you autocomplete + inline validation:

{
  "$schema": "https://mcpfold.com/schema/v1.json",
  "version": 1,
  // …
}

The schema is generated from the zod source (packages/schema); a CI check fails if the committed mcp.config.schema.json drifts — regenerate with pnpm --filter @mcpfold/schema generate.


How it's built

Package Purpose
packages/core @mcpfold/core — pure, I/O-free engine: schema, resolution, drift, diff.
packages/adapters @mcpfold/adapters — one module per client (render native ↔ parse canonical).
packages/secrets @mcpfold/secrets — env / dotenv / infisical / keychain / 1Password.
packages/proxy @mcpfold/proxy — local MCP proxy for tool-level curation.
packages/cli mcpfold — the CLI binary (init/import/sync/diff/doctor/…).
packages/schema Published JSON Schema for mcp.config.jsonc.
apps/web React/TS visual editor + directory (Cloudflare Pages).
services/edge Deno edge service — device-code auth, config push/pull, teams.

Core purity is enforced: packages/core may not import node:fs, node:os, node:path, or any network/process library. All I/O is injected through ClientAdapter / SecretProvider. Guarded by an ESLint no-restricted-imports rule and the scripts/check-core-purity.mjs CI gate.

Security

Secret values never touch disk or logs — only references (${scheme:path}) are stored, and values are resolved in memory at launch. Every security property is paired with the test or CI job that proves it in the Security posture ledger (CI-guarded so a claim can't outlive its evidence); the narrative Security and Threat model pages cover the surfaces and honest boundaries.

Development

Requires Node 20+ and pnpm 10+ (corepack enable).

pnpm install          # install workspace deps
pnpm lint             # eslint + core-purity check
pnpm typecheck        # tsc --noEmit across packages
pnpm test             # vitest (unit + fixture snapshots)
pnpm -r build         # build every package
pnpm verify_all       # lint + typecheck + test + build (the full gate)

CI runs verify_all on a Windows/macOS/Linux × Node 20 matrix — path resolution is central to this product, so the cross-OS matrix is non-negotiable. New client adapters, secret providers, and doctor checks are especially welcome — see CONTRIBUTING.md.

Pricing, funding & roadmap

The CLI and everything local are free forever and MIT-licensed; the hosted cloud is the paid surface (and you can self-host it yourself for free). See the pricing model, the public roadmap, and how the project is run in governance.

Support the project

If mcpfold saves you time, you can help fund ongoing work:

Sponsorships fund the free, open-source core. Thank you 🙏

License

MIT for packages/* core + CLI. The cloud layer (apps/web, services/edge) is commercial/closed. See prd.json meta.license.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured