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
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选