openagentry

§04 · Reference

agentry-mcp

The same five commands as the CLI, exposed as MCP tools over stdio. New CLI commands surface as new tools automatically — the registry is shared.


  1. 01

    Run it

    @openagentry/mcp ships a single bin, agentry-mcp, that speaks MCP over stdio. Run it from the workspace directory you want it to operate on.

    npx -p @openagentry/mcp agentry-mcp

    The server resolves .agentry/workspace.json from its working directory the same way the CLI does.

  2. 02

    Configure your client

    Any MCP-aware client that supports stdio servers can drive it. Example: Claude Desktop.

    // ~/Library/Application Support/Claude/claude_desktop_config.json
    {
      "mcpServers": {
        "openagentry": {
          "command": "npx",
          "args": ["-y", "-p", "@openagentry/mcp", "agentry-mcp"],
          "cwd": "/abs/path/to/your/workspace"
        }
      }
    }

    cwd is the workspace root — the directory with .agentry/workspace.json. Without it, agentry_capabilities will report E_NO_WORKSPACE.

  3. 03

    The tool set

    One tool per CLI command. Tool name is agentry_<command>. Input schema is { args: string[] } — the array is forwarded to the CLI dispatcher exactly as if you'd typed it after agentry. --json is always added by the server, so output is always parseable.

    MCP toolCLI equivalentPurpose
    agentry_init agentry init Create a new workspace.
    agentry_version agentry version CLI + protocol versions.
    agentry_doctor agentry doctor Diagnostic checks.
    agentry_list agentry list List declared plugins.
    agentry_capabilities agentry capabilities Load adapters and report what is registered.

    New commands added to @openagentry/cli register themselves with the meta-MCP server automatically — no corresponding change in @openagentry/mcp is needed.

  4. 04

    A request, a response

    Every tool returns the exact JSON document the CLI would have printed on stdout, wrapped in MCP's standard content[] envelope. Failures throw an AgentryError with a stable code.

    // MCP request from the client
    {
      "method": "tools/call",
      "params": {
        "name": "agentry_capabilities",
        "arguments": { "args": [] }
      }
    }
    
    // Response — exactly what agentry capabilities --json prints on stdout.
    {
      "content": [{ "type": "text", "text": "{ \"categories\": { ... }, ... }" }]
    }