Skip to content

Getting started

fold sits between MCP clients and any number of upstream MCP servers. This walkthrough federates two servers behind one endpoint.

  1. Build the gateway

    Terminal window
    git clone https://github.com/fold-run/fold.git && cd fold
    pnpm install && pnpm build
  2. 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 namespace runs in zero-copy passthrough mode. Multiple upstreams require namespaces; tools surface as {namespace}__{name}.

  3. Run it

    8080/mcp
    node apps/gateway-node/dist/index.mjs --config fold.config.json --port 8080
  4. Point a client at it

    Any MCP client — 2026-07-28 stateless or 2025-era stateful — connects to /mcp and sees one virtual server named fold with every team’s tools:

    gh__create_pr (acme-platform / devex)
    gh__get_issue
    search__query (acquired-co / ml)
  5. Turn on governance

    Add auth, policy, and audit blocks when you’re ready to require tokens, scope tools per team, and stream audit events — then walk the production checklist.