MCP
ForgeaX CLI connects to external tools and data sources via the Model Context Protocol (MCP).
Config files
Auto-discovered and merged (project overrides user):
~/.forgeax/mcp.json<cwd>/.forgeax/mcp.json
Or pass a file explicitly:
bash
forgeax --mcp /path/to/mcp.jsonShape
json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp/workspace"]
}
}
}Exact server fields follow the implementation; unknown keys are passed through to the MCP client assembly layer.
Token injection
Avoid committing secrets into JSON:
bash
forgeax --mcp-token github=GITHUB_TOKEN
forgeax --mcp-token =GLOBAL_TOKEN_ENV # wildcard: same env name for all serversSyntax: server=ENV_NAME or =ENV_NAME (wildcard).
As an MCP server (reverse)
Expose this kernel’s tools to other MCP clients:
bash
forgeax mcp-serve
forgeax mcp-serve --allow-writes- Default is read-leaning; mutating tools need
--allow-writesorFORGEAX_MCP_ALLOW_WRITES=1 - Non-interactive:
askpermissions are always denied;denystill forced - Distinct from
--serve(AgentKernel sidecar): one exposes tools, the other exposes kernel RPC
Troubleshooting
| Symptom | Check |
|---|---|
| Tools missing | Confirm mcp.json exists and JSON is valid; inspect startup logs |
| Auth failures | Ensure --mcp-token / server env point at real env vars |
| Timeout / spawn failure | Can you run command + args directly on this machine? |
More in Troubleshooting.