kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

CLI / mcp / add

kosa8 mcp add

Add an MCP server from the catalog, or any server by its command, to run behind the gateway

Usage#

kosa8 mcp add ID | add NAME -- CMD [ARGS...]

kosa8 mcp add ID adds a server from the catalog (kosa8 mcp search) in one step: it runs the publisher's package at a pinned version in a sandbox of its own (mcp-ID) whose egress is only the hosts that server needs, or reaches the publisher's remote endpoint through the gateway. Secrets it needs are asked for without echo and kept in kosa8's owner-only secret store, not in the registry file. Its tool definitions are pinned the first time kosa8 mcp serve starts it.

kosa8 mcp add NAME -- CMD registers any other server by its command. It runs as a container inside a dedicated sandbox (mcp-NAME) when kosa8 mcp serve starts. Its tools appear namespaced as NAME_tool, filtered by --allow-tool, and the sandbox's egress policy bounds what it can reach.

Either way, an installed org policy is checked first: a server it does not approve is refused.

Options#

FlagTypeWhat it doesDefault
--allow-toolstringArrayonly expose this tool (repeatable; default all)[]
--dirstringcatalog: the directory a file-serving server (filesystem, git) may see, shared read-only—
--egressstringsandbox network policy: any or deny (default: the org policy's default_egress when it sets one, else any)—
--egress-allowstringArraypermit outbound traffic only to these hosts or *.domain wildcards (repeatable)[]
-e, --envstringArrayKEY=VALUE for the server process (repeatable; use for secrets)[]
--imagestringcontainer image the server runs inalpine
--namestringcatalog: register under this name instead of the id—
--secrets-from-envboolcatalog: take each secret from the variable of the same name in this shell instead of asking—
--writableboolcatalog: share --dir read-write—

Example#

  kosa8 mcp add github
  kosa8 mcp add filesystem --dir ~/code/project
  kosa8 mcp add playwright
  kosa8 mcp add mytool --image node:22-alpine -- npx -y some-mcp-server@1.2.3

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA