Skip to content

Connect your AI agent

Install anyvar-mcp and start the AnyVar HTTP API. Keep the API running while you use the tools. Claude Desktop or Codex CLI starts anyvar-mcp using the command you configure below.

Set the environment variables in the examples to your values if you want to override the defaults. See the configuration guide.

Find the server command

Find the executable:

command -v anyvar-mcp

If nothing prints, activate the virtual environment where you installed the server and try again. Save the printed path. Use it as the command if your agent cannot find anyvar-mcp. For a virtual environment, it might look like:

/home/git/anyvar-mcp/.venv/bin/anyvar-mcp

Claude Desktop

  1. Open Settings → Developer → Edit Config to find claude_desktop_config.json.
  2. Add this entry to mcpServers, keeping any existing server entries:
{
  "mcpServers": {
    "anyvar-mcp": {
      "command": "anyvar-mcp",
      "env": {
        "ANYVAR_API_URL": "http://localhost:8000",
        "ANYVAR_ENABLE_REGISTRATION": "true"
      }
    }
  }
}

If Claude Desktop cannot find the command, replace the command value with the full executable path.

  1. Save the file, fully quit Claude Desktop, and reopen it.
  2. In a new chat, open Add files, connectors, and more → Connectors → Manage connectors and select anyvar-mcp to check its tools.

See the Claude Desktop MCP documentation for more setup options and troubleshooting.

Codex CLI

For example, add the MCP server with ANYVAR_API_URL set to http://localhost:8000 and ANYVAR_ENABLE_REGISTRATION set to true:

codex mcp add anyvar-mcp --env ANYVAR_API_URL=http://localhost:8000 --env ANYVAR_ENABLE_REGISTRATION=true -- anyvar-mcp

Confirm that the saved server list includes anyvar-mcp:

codex mcp list

See the Codex MCP documentation and CLI reference for more configuration options and commands.

Change saved settings

Config file

Edit the server's environment variables in ~/.codex/config.toml:

[mcp_servers.anyvar-mcp.env]
ANYVAR_API_URL = "http://localhost:8000"
ANYVAR_ENABLE_REGISTRATION = "true"

CLI

Inspect the current entry, remove it, and add it again with all settings you want to keep. For example, to change the API URL and disable registration:

codex mcp get anyvar-mcp
codex mcp remove anyvar-mcp
codex mcp add anyvar-mcp --env ANYVAR_API_URL=http://localhost:9000 --env ANYVAR_ENABLE_REGISTRATION=false -- anyvar-mcp

Check tools from the terminal

With Node.js and npx installed, you can use the MCP Inspector to list tools independently of your agent:

npx @modelcontextprotocol/inspector --cli anyvar-mcp --method tools/list

Once connected, try the tools.