Getting started
fold sits between MCP clients and any number of upstream MCP servers. This walkthrough federates two servers behind one endpoint.
-
Build the gateway
Terminal window git clone https://github.com/fold-run/fold.git && cd foldpnpm install && pnpm build -
Describe your upstreams
fold.config.json {"upstreams": [{"id": "github-tools","url": "https://mcp.platform.acme.com/mcp","namespace": "gh","owner": { "org": "acme-platform", "team": "devex" }},{"id": "ml-search","url": "https://mcp.ml.acquired-co.com/mcp","namespace": "search","owner": { "org": "acquired-co", "team": "ml" }}]}A single upstream without a
namespaceruns in zero-copy passthrough mode. Multiple upstreams require namespaces; tools surface as{namespace}__{name}. -
Run it
8080/mcp node apps/gateway-node/dist/index.mjs --config fold.config.json --port 8080Terminal window docker build -f apps/gateway-node/Dockerfile -t fold-gateway .docker run -p 8080:8080 \-v $PWD/fold.config.json:/app/fold.config.json fold-gatewayTerminal window cd apps/gateway-workers# put the config JSON in the FOLD_CONFIG var (wrangler.jsonc or a secret)npx wrangler deploy -
Point a client at it
Any MCP client — 2026-07-28 stateless or 2025-era stateful — connects to
/mcpand sees one virtual server namedfoldwith every team’s tools:gh__create_pr (acme-platform / devex)gh__get_issuesearch__query (acquired-co / ml) -
Turn on governance
Add
auth,policy, andauditblocks when you’re ready to require tokens, scope tools per team, and stream audit events — then walk the production checklist.