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.
README
@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
| Variable | Required | Default | Description |
|---|---|---|---|
INVARIANCE_API_KEY |
Yes | — | Your Invariance API key |
INVARIANCE_BASE_URL |
No | https://api.invariance.ai |
API base URL |
INVARIANCE_MCP_TRANSPORT |
No | stdio |
Transport mode: stdio or sse |
INVARIANCE_MCP_PORT |
No | 3000 |
Port for SSE/HTTP transport |
INVARIANCE_TIMEOUT |
No | 30000 |
Request 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
| Tool | Description |
|---|---|
whoami |
Get information about the authenticated Invariance user and organization |
list_traces |
List recent traces from Invariance with optional filtering |
get_trace |
Get detailed information about a specific trace by ID |
query_invariance |
Query Invariance with a natural language prompt to analyze traces, monitors, and signals |
list_monitors |
List configured monitors in Invariance |
run_monitor |
Trigger a monitor run and return the results |
list_signals |
List signals detected by Invariance monitors |
get_session |
Get detailed information about an agent session |
search_docs |
Search Invariance documentation for a topic |
list_datasets |
List available evaluation datasets |
list_evals |
List evaluation runs with optional dataset filtering |
create_monitor |
Create a new monitor in Invariance to track agent behavior |
create_dataset |
Create a new evaluation dataset in Invariance |
get_monitor |
Get detailed information about a specific monitor including recent runs |
get_eval |
Get detailed results of an evaluation run |
Available prompts
| Prompt | Description |
|---|---|
troubleshooting |
Help troubleshoot an issue with an Invariance-monitored agent |
monitor-investigation |
Investigate why a monitor triggered or is failing |
trace-analysis |
Analyze a trace to identify issues, bottlenecks, or anomalies |
Available resources
| URI | Description |
|---|---|
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
- Verify the config file path is correct for your client
- Restart the client after editing the config
- Check that
npx @invariance/mcpruns 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。