MCP Hub
Back to servers

Invariance MCP

Connects AI assistants to the Invariance observability platform, enabling natural language queries of traces, monitors, and signals to investigate issues and analyze agent behavior. Supports debugging, monitoring, and evaluation dataset management through Claude Desktop, Cursor, and Claude Code.

glama
Updated
Apr 7, 2026

@invariance/mcp

An MCP (Model Context Protocol) server that connects AI coding agents to the Invariance observability platform. It gives tools like Claude Desktop, Cursor, and Claude Code direct access to your traces, monitors, signals, and more.

MCP is an open protocol that lets AI assistants use external tools and data sources. This server implements it for Invariance, so your AI assistant can query observability data, investigate issues, and analyze agent behavior without leaving the conversation.

Install

npm install -g @invariance/mcp

Or run directly with npx (recommended for MCP client configs):

npx @invariance/mcp

Setup

Environment variables

VariableRequiredDefaultDescription
INVARIANCE_API_KEYYesYour Invariance API key
INVARIANCE_BASE_URLNohttps://api.invariance.aiAPI base URL
INVARIANCE_MCP_TRANSPORTNostdioTransport mode: stdio or sse
INVARIANCE_MCP_PORTNo3000Port for SSE/HTTP transport
INVARIANCE_TIMEOUTNo30000Request timeout in milliseconds

Get your API key at app.invariance.ai/settings/api-keys.

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "invariance": {
      "command": "npx",
      "args": ["-y", "@invariance/mcp"],
      "env": {
        "INVARIANCE_API_KEY": "your-api-key"
      }
    }
  }
}

Claude Code

Add to your Claude Code config (.claude/settings.json or ~/.claude/settings.json):

{
  "mcpServers": {
    "invariance": {
      "command": "npx",
      "args": ["-y", "@invariance/mcp"],
      "env": {
        "INVARIANCE_API_KEY": "your-api-key"
      }
    }
  }
}

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

{
  "mcpServers": {
    "invariance": {
      "command": "npx",
      "args": ["-y", "@invariance/mcp"],
      "env": {
        "INVARIANCE_API_KEY": "your-api-key"
      }
    }
  }
}

Available tools

ToolDescription
whoamiGet information about the authenticated Invariance user and organization
list_tracesList recent traces from Invariance with optional filtering
get_traceGet detailed information about a specific trace by ID
query_invarianceQuery Invariance with a natural language prompt to analyze traces, monitors, and signals
list_monitorsList configured monitors in Invariance
run_monitorTrigger a monitor run and return the results
list_signalsList signals detected by Invariance monitors
get_sessionGet detailed information about an agent session
search_docsSearch Invariance documentation for a topic
list_datasetsList available evaluation datasets
list_evalsList evaluation runs with optional dataset filtering
create_monitorCreate a new monitor in Invariance to track agent behavior
create_datasetCreate a new evaluation dataset in Invariance
get_monitorGet detailed information about a specific monitor including recent runs
get_evalGet detailed results of an evaluation run

Available prompts

PromptDescription
troubleshootingHelp troubleshoot an issue with an Invariance-monitored agent
monitor-investigationInvestigate why a monitor triggered or is failing
trace-analysisAnalyze a trace to identify issues, bottlenecks, or anomalies

Available resources

URIDescription
invariance://docs/{topic}Invariance documentation by topic

Topics: getting-started, authentication, traces, monitors, signals, queries, datasets, evals

SSE/HTTP transport

To run the server in SSE/HTTP mode instead of stdio:

INVARIANCE_API_KEY=your-api-key INVARIANCE_MCP_TRANSPORT=sse INVARIANCE_MCP_PORT=3000 npx @invariance/mcp

The server exposes a Streamable HTTP endpoint at http://127.0.0.1:3000/mcp and a health check at http://127.0.0.1:3000/health.

MCP clients that support HTTP transport can connect using the /mcp endpoint URL instead of spawning a subprocess.

Troubleshooting

"INVARIANCE_API_KEY environment variable is required"

Make sure you've set the INVARIANCE_API_KEY environment variable in your MCP client configuration. See the setup guides above.

Server not appearing in your MCP client

  1. Verify the config file path is correct for your client
  2. Restart the client after editing the config
  3. Check that npx @invariance/mcp runs without errors in your terminal

Authentication errors

Verify your API key is valid at app.invariance.ai/settings/api-keys.

Connection timeouts

If using a custom INVARIANCE_BASE_URL, verify the URL is reachable.

Contributing

See CONTRIBUTING.md.

License

MIT

Reviews

No reviews yet

Sign in to write a review