First MCP tool
ZERG integrates with the Model Context Protocol in both directions: Luna as an MCP client (using external tool servers) and ** Luna as an MCP server** (exposing tools to an IDE/agent).
MCP client configuration
MCP servers are declared in .luna/mcp.json (project) or the user config. Project-local configuration has a lower precedence than the global config, and HTTP/SSE servers require a hash-keyed approval.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/srv/workspace"]
}
}
}
Supported server fields include type, url, headers, timeout, max_parallel, auth, max_body_bytes, and strict_osv.
Approve a server
On first use, the worker asks for consent for an HTTP/SSE server (hash-keyed approval). A stdio server also requires a hash-keyed approval when it is repository-supplied. Approval is stored in the user-owned approvals store, never in the repo.
Use a tool
Once connected, MCP tools are namespaced mcp<and>__<are> subject to the same permission and sandbox rules as built-in tools built-in tools.
Verify: zerg agents shows the worker’s tool inventory; a task that calls the tool returns a result.
Air-gap note
npx and remote MCP servers require network access. In an air-gap, use a locally installed stdio server and vendor its dependencies into the image, or expose an in-cluster HTTP server.
Luna as an MCP server
luajit client/main.lua --mcp-serve
This exposes Luna’s tool surface over the MCP stdio protocol (initialize before tools, framed bodies, self-wrap refused).