MCP Server

AgentOps provides a Model Context Protocol (MCP) server that exposes the Public API as a set of tools for AI assistants. This allows AI models to directly query your AgentOps data during conversations and debug AI agents with greater context.

Configuration & Installation

Add the AgentOps MCP to your MCP client’s configuration file. npx configuration:
{
  "mcpServers": {
    "agentops": {
      "command": "npx",
      "args": [
        "agentops-mcp"
      ],
      "env": {
        "AGENTOPS_API_KEY": ""
      }
    }
  }
}
Cursor Deeplink: Add the AgentOps MCP to Cursor with Deeplink. Install MCP Server Smithery: To install agentops-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @AgentOps-AI/agentops-mcp --client claude

Available Tools

The MCP server exposes the following tools that mirror the Public API endpoints:

auth

Authorize using an AgentOps project API key.
  • Parameters: api_key (string) - Your AgentOps project API key
  • Usage: The server will automatically prompt for authentication when needed

get_trace

Get trace information by ID.
  • Parameters: trace_id (string) - The trace identifier
  • Returns: Trace details and metrics

get_span

Get span information by ID.
  • Parameters: span_id (string) - The span identifier
  • Returns: Span attributes and metrics

get_complete_trace

Get complete trace information by ID.
  • Parameters: span_id (string) - The trace identifier
  • Returns: Complete trace and associated span details.

Environment Variables

The MCP server supports the following environment variables:
  • AGENTOPS_API_KEY: Your AgentOps project API key
  • HOST: API endpoint (defaults to https://api.agentops.ai)