docs

MCP Tools

Connect any MCP server to your agents — GitHub, Slack, filesystem, browser, and more.

Ninetrix uses the Model Context Protocol (MCP) as its tool layer. Agents call a local MCP gateway, which routes requests to connected MCP workers. Workers spawn MCP server subprocesses — any MCP-compatible server works.

Architecture

  • Agent calls POST /v1/mcp/{workspace_id} on the MCP gateway
  • MCP Gateway routes the call via WebSocket to the correct worker
  • MCP Worker forwards it to the appropriate subprocess (npx, uvx, python, docker)
  • Tool result flows back the same path to the agent

Configure MCP servers

Add servers to ~/.agentfile/mcp-worker.yaml. This file is shared across all your agents:

~/.agentfile/mcp-worker.yaml
servers:
  # Web search
  - name: brave-search
    type: npx
    package: "@modelcontextprotocol/server-brave-search"
    env:
      BRAVE_API_KEY: "${BRAVE_API_KEY}"

  # GitHub
  - name: github
    type: npx
    package: "@modelcontextprotocol/server-github"
    env:
      GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN}"

  # Filesystem (scoped to a directory)
  - name: filesystem
    type: npx
    package: "@modelcontextprotocol/server-filesystem"
    args: ["${HOME}/projects"]

  # Slack
  - name: slack
    type: npx
    package: "@modelcontextprotocol/server-slack"
    env:
      SLACK_BOT_TOKEN: "${SLACK_BOT_TOKEN}"

  # Notion
  - name: notion
    type: npx
    package: "@notionhq/notion-mcp-server"
    env:
      NOTION_API_KEY: "${NOTION_API_KEY}"

  # Python-based MCP server
  - name: my-tools
    type: uvx
    package: my-tools-package

  # Custom command
  - name: internal-api
    type: command
    command: python /path/to/my_mcp_server.py
Environment variable interpolation
${VAR} in mcp-worker.yaml is resolved from the worker container's environment at runtime. Credentials never leave your network.

Reference tools in agentfile.yaml

agentfile.yaml
agents:
  my-agent:
    tools:
      - name: web_search
        source: mcp://brave-search        # matches server "name" in mcp-worker.yaml

      - name: github
        source: mcp://github

      - name: files
        source: mcp://filesystem

Tool naming

Tool calls are namespaced as {server_name}__{tool_name} to prevent collisions. For example, a GitHub server named github exposes tools like github__create_issue, github__list_pull_requests, etc.

List available tools

Bash
ninetrix mcp list --file agentfile.yaml   # list tools the agent will receive
ninetrix mcp list                          # list all registered servers

Server types

TypeRuns viaExample
npxnpx -y <package>Most MCP servers from npm
uvxuvx <package>Python MCP packages via uv
pythonpython -m <module>Python module
dockerdocker run <image>Containerized MCP server
commandarbitrary shell commandCustom scripts
On this page