Back to Agent Zero

Advanced MCP Configuration

docs/developer/mcp-configuration.md

1.142.1 KB
Original Source

Advanced MCP Configuration

Most users should start with MCP Setup.

This page is for people who need to paste or review MCP JSON by hand. MCP architecture and source-linked internals live in DeepWiki for Agent Zero.

Basic Shape

Command-based MCP tool:

json
{
  "mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "/root/db.sqlite"]
    }
  }
}

URL-based MCP tool:

json
{
  "mcpServers": {
    "external-api": {
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Common Fields

FieldMeaning
commandStarts a local MCP tool from a command.
argsArguments passed to that command.
urlConnects to an MCP tool that is already running.
headersOptional HTTP headers, often used for authentication.
envOptional environment variables for command-based tools.
disabledTemporarily turns one MCP entry off.

Use command for local tools and url for tools that are already running somewhere else.

Docker Addresses

If Agent Zero runs in Docker, remember that "localhost" means the container, not always your host machine.

Where the MCP tool runsAddress to use from Agent Zero
Host machine on macOS or Windowshost.docker.internal
Another containerThe container name on the same Docker network
Remote machineIts reachable HTTPS URL
Inside Agent Zero's containerA command-based config

On Linux, host.docker.internal may need extra Docker setup. Running the MCP tool in the same Docker network is often simpler.

Safety

  • Use MCP tools you trust.
  • Keep real API keys out of public screenshots and repositories.
  • Prefer project secrets or environment variables for credentials.
  • Remove MCP tools you no longer use.