mcprig

module
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT

README

mcprig

mcprig

One static Go binary that serves many MCP servers through a single MCP endpoint, with a web panel.

release license go

A client that talks to a dozen MCP servers pays for a dozen tool lists in its context before it asks anything. mcprig puts them behind nine meta-tools, groups servers into named sets, runs each set as its own process with its own port and key, and manages the whole registry from a web panel.

  • Five meta-tools instead of a whole tool catalogue
  • One endpoint, one key per named set
  • Registry, keys and live call tail in the panel
  • Set composition, import/export, and a ready-to-paste agent prompt built from a set's tools
  • Sandbox for stdio servers, OAuth for remote ones
  • One static binary, no runtime dependencies

Documentation: docs/en — install, configuration, CLI, panel, meta-tools, architecture. Русский: docs/ru.

Quick start

Release archives cover linux and darwin on amd64 and arm64. Linux amd64:

curl -LO https://github.com/akrhin/mcprig/releases/download/v0.4.0/mcprig_0.4.0_linux_amd64.tar.gz
tar -xzf mcprig_0.4.0_linux_amd64.tar.gz
MCPRIG_PASSWORD=change-me ./mcprig panel

Open http://localhost:9091, sign in as admin, add a server, add a set that contains it, press Start, then issue a key for the set. The panel shows the token once: save it to demo.key and chmod 600 it.

mcprig panel

The panel: sets on their own ports and endpoints, and the servers of one set with transport and tool counts.

Docker works the same way, with no Go toolchain needed: docker pull ghcr.io/akrhin/mcprig:latest (latest-full adds node and python for npx/uvx downstreams). systemd units, archive contents and the state directory: docs/en/install.md.

Connect a client

init prints a fragment for the client's own config file and never edits it:

./mcprig init --client claude --set demo \
  --remote http://127.0.0.1:9100/mcp --key-file ./demo.key
{
  "mcpServers": {
    "mcprig-demo": {
      "type": "http",
      "url": "http://127.0.0.1:9100/mcp",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

--client opencode prints mcp JSON, --client codex prints a TOML table. For a client that spawns the binary itself, drop --remote and pass --config ~/.config/mcprig/sets/demo/servers.json instead: the fragment then runs mcprig stdio with no port and no key. Both forms with real output: docs/en/cli.md.

Architecture

Client → one set endpoint → nine meta-tools (five work with servers, four serve resources and prompts) → the downstream servers of that set. The panel supervises one mcprig serve process per set, so a restart or a crash of one set leaves the others serving. Every picture below opens interactively (themes, zoom, PNG/SVG export) by a click on it, and the spec it is generated from sits next to it as .json.

Architecture: client, set, servers, panel, state files

mcprig architecture

With a proxy and without: what the context pays, what the operator gets

with and without a proxy

What one binary does: serve, protect, observe, operate

what one binary does

How it compares with other proxies and where it stays weaker: docs/en/alternatives.md.

Configuration

A set is one servers.json in the lazy-mcp format, read as-is: servers[] with command or url, plus env, headers, sandbox, transport, permissions. The panel writes the same file for the sets it runs, so a config made by hand and one made in the browser are not two formats.

"sandbox": {} puts a stdio server under bubblewrap: read-only root, no /home, no network, prlimit limits. A server tagged untrusted cannot start without it. Field reference and what the sandbox does not limit: docs/en/configuration.md.

Security defaults

A set with no authToken refuses to start unless it is explicitly open; the panel password is constant-time compared with rate limiting per IP; tokens are returned in full once and as a prefix afterwards. Auth modes, host policy, permission rules, limits and the 4 MiB body cap: docs/en/configuration.md and docs/en/panel.md.

Status

Pre-1.0, single operator: one panel, one password, no per-user roles. CLI help and log lines are Russian.

Issues and pull requests follow CONTRIBUTING.md. Security reports: SECURITY.md.

License

MIT, see LICENSE.


English · Русский

Directories

Path Synopsis
cmd
mcprig command
Command mcprig serves one set of MCP servers behind a single lazy proxy.
Command mcprig serves one set of MCP servers behind a single lazy proxy.
testmcp command
testmcp is a tiny stdio MCP server used as a fixture by lifecycle tests: it starts fast, answers tools/list and has one tool that fails on purpose.
testmcp is a tiny stdio MCP server used as a fixture by lifecycle tests: it starts fast, answers tools/list and has one tool that fails on purpose.
internal
atomicfile
Package atomicfile replaces a file so a reader never observes a partial one.
Package atomicfile replaces a file so a reader never observes a partial one.
config
Package config reads the lazy-mcp `servers.json` format.
Package config reads the lazy-mcp `servers.json` format.
httplisten
Package httplisten exposes one set as a stateless MCP HTTP endpoint: bearer auth, Host/Origin checks and a body cap in front of the go-sdk Streamable HTTP handler.
Package httplisten exposes one set as a stateless MCP HTTP endpoint: bearer auth, Host/Origin checks and a body cap in front of the go-sdk Streamable HTTP handler.
mcpserver
Package mcpserver aggregates a set's downstream servers into one MCP server exposing lazy-mcp's meta-tools.
Package mcpserver aggregates a set's downstream servers into one MCP server exposing lazy-mcp's meta-tools.
oauth
Package oauth содержит клиентскую часть OAuth 2.0 для MCP-серверов, отвечающих 401/403: хранилище токенов, loopback-приёмник кода и фабрику обработчика поверх auth.AuthorizationCodeHandler из go-sdk.
Package oauth содержит клиентскую часть OAuth 2.0 для MCP-серверов, отвечающих 401/403: хранилище токенов, loopback-приёмник кода и фабрику обработчика поверх auth.AuthorizationCodeHandler из go-sdk.
registry
Package registry owns the manager's persistent state: downstream servers, sets (one lazy-mcp instance each), their access keys and the port allocator.
Package registry owns the manager's persistent state: downstream servers, sets (one lazy-mcp instance each), their access keys and the port allocator.
sandbox
Package sandbox wraps a stdio server's argv in bubblewrap: its own mount tree, read-only root, no /home, no network.
Package sandbox wraps a stdio server's argv in bubblewrap: its own mount tree, read-only root, no /home, no network.
stats
Package stats collects per-client call counters for the panel.
Package stats collects per-client call counters for the panel.
toollock
Package toollock keeps the per-set record of approved tool descriptors.
Package toollock keeps the per-set record of approved tool descriptors.
toolout
Package toolout keeps the tool-out directory, where truncated answers are saved, from growing without bound: age limit, size cap, and a periodic sweep.
Package toolout keeps the tool-out directory, where truncated answers are saved, from growing without bound: age limit, size cap, and a periodic sweep.
Package web carries the panel's static assets inside the binary: the panel must run from a single file, without a checkout next to it.
Package web carries the panel's static assets inside the binary: the panel must run from a single file, without a checkout next to it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL