Skip to main content
Glama
Tusk Drift MCP
by Use-Tusk

Tusk Drift MCP

npm version

An MCP server for querying API traffic data captured by Tusk Drift. This enables AI assistants to search, analyze, and debug your application's API traffic, including HTTP requests, database queries, and distributed traces.

New to Tusk Drift? Check out our docs and sign up for an account.

Setup

Connect directly to the hosted Tusk Drift MCP server. This is the easiest setup and doesn't require running anything locally.

For Cursor:

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

{
  "mcpServers": {
    "tusk-drift": {
      "url": "https://api.usetusk.ai/api/drift-mcp",
      "headers": {
        "x-api-key": "YOUR_TUSK_API_KEY"
      }
    }
  }
}

For Claude Code:

Option A — CLI command:

claude mcp add --transport http tusk-drift https://api.usetusk.ai/api/drift-mcp \
  --header "x-api-key: YOUR_TUSK_API_KEY"

Option B — Add to .mcp.json in your project root:

{
  "mcpServers": {
    "tusk-drift": {
      "type": "http",
      "url": "https://api.usetusk.ai/api/drift-mcp",
      "headers": {
        "x-api-key": "YOUR_TUSK_API_KEY"
      }
    }
  }
}

For Claude Desktop:

{
  "mcpServers": {
    "tusk-drift": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.usetusk.ai/api/drift-mcp"],
      "env": {
        "MCP_HEADERS": "{\"x-api-key\": \"YOUR_TUSK_API_KEY\"}"
      }
    }
  }
}

Option 2: Local Installation (via NPX)

Run the MCP server locally. This is useful if you need offline access or custom configuration.

For Claude Desktop / Cursor:

Add to your claude_desktop_config.json or Cursor MCP settings:

{
  "mcpServers": {
    "tusk-drift": {
      "command": "npx",
      "args": ["-y", "@use-tusk/drift-mcp"],
      "env": {
        "TUSK_API_KEY": "YOUR_TUSK_API_KEY"
      }
    }
  }
}

Configuration (env vars for local installation)

Variable

Required

Description

TUSK_API_KEY

Yes

Your API token

TUSK_DRIFT_API_URL

No

Backend base URL (defaults to https://api.usetusk.ai). Use origins like https://api.usetusk.ai or http://localhost:8000, not /api/drift-mcp.

TUSK_DRIFT_SERVICE_ID

No

Service ID (auto-discovered from .tusk/config.yaml if not set)

TUSK_WORKSPACE_ROOTS

No

Comma-separated workspace roots to search for .tusk/config.yaml files when auto-discovering services

Related MCP server: @originchain/telemetry-mcp

Available Tools

Tool

Description

query_spans

Search API traffic with flexible filters

get_schema

Get structure/schema of captured traffic

list_distinct_values

Discover available endpoints and field values

aggregate_spans

Calculate latency percentiles, error rates, counts

get_trace

View distributed traces as hierarchical trees

get_spans_by_ids

Fetch specific spans with full payloads

Support

Need help? Open an issue or contact us at support@usetusk.ai.

License

MIT

Available Tools

6 tools
aggregate_spansA

Calculate aggregated metrics and statistics across spans.

Use this tool to:

  • Get latency percentiles for endpoints (p50, p95, p99)

  • Calculate error rates by endpoint

  • Get request counts over time

  • Compare performance across environments

Examples:

  • Endpoint latency: groupBy = ["name"], metrics = ["count", "avgDuration", "p95Duration"]

  • Error rates: groupBy = ["name"], metrics = ["count", "errorCount", "errorRate"]

  • Hourly trends: timeBucket = "hour", metrics = ["count", "errorRate"]

Inputs: metrics (required), observableServiceId, where, groupBy, +3 more.

get_schemaA

Get schema and structure information for span recordings on Tusk Drift.

Use this tool to:

  • Understand what fields are available for a specific instrumentation type

  • See example payloads for HTTP requests, database queries, etc.

  • Learn what to filter on before querying spans

Common package names:

  • http: Incoming HTTP requests (has statusCode, method, url, headers)

  • fetch: Outgoing HTTP calls

  • pg: PostgreSQL queries (has db.statement, db.name)

  • grpc: gRPC calls

  • express: Express.js middleware spans

Inputs: observableServiceId, packageName, instrumentationName, name, +2 more.

get_spans_by_idsA

Fetch specific span recordings by their IDs.

Use this tool when you have span IDs from a previous query and need the full details including payloads.

This is useful for:

  • Getting full details for spans found via query_spans

  • Examining specific requests in detail

  • Comparing multiple specific spans

Inputs: ids (required), observableServiceId, fields, includePayloads, +1 more.

get_traceA

Get all spans in a distributed trace as a hierarchical tree.

Use this tool to:

  • Debug a specific request end-to-end

  • See the full call chain from HTTP request to database queries

  • Understand timing and dependencies between spans

  • Identify bottlenecks in a request

First use query_spans to find spans, then use the traceId to get the full trace.

Inputs: traceId (required), observableServiceId, includePayloads, maxPayloadLength.

list_distinct_valuesA

List unique values for a field, ordered by frequency.

Use this tool to:

  • Discover available endpoints (field: "name")

  • See all instrumentation packages in use (field: "packageName")

  • Find unique environments (field: "environment")

  • Explore JSONB values like status codes (field: "outputValue.statusCode")

This helps you understand what values exist before building specific queries.

Inputs: field (required), observableServiceId, where, limit.

query_spansA

Search and filter API traffic span recordings.

Use this tool to:

  • Find specific API calls by endpoint name, HTTP method, or status code

  • Search for errors or slow requests

  • Get recent traffic for a specific endpoint

  • Debug specific API calls

Examples:

  • Find failed requests: where = { fields: { "outputValue.statusCode": { gte: 400, access: { castAs: "int" } } } }

  • Find slow requests: where = { fields: { duration: { gt: 1000 } } }

  • Recent traffic for endpoint: where = { fields: { name: { eq: "/api/orders" } } }, limit = 10, orderBy = [{ field: "timestamp", direction: "DESC" }]

Inputs: observableServiceId, where, orderBy, limit, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool serves a clear, distinct purpose: aggregation, schema discovery, span detail retrieval, trace tree, field value exploration, and search. No overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with underscores (e.g., aggregate_spans, list_distinct_values, query_spans). No mixing of styles.

    Tool Count5/5

    6 tools is well-scoped for a telemetry/observability server, covering all necessary operations without being overwhelming or too sparse.

    Completeness5/5

    The tool set covers querying, aggregation, trace retrieval, span details, schema exploration, and field value discovery. No obvious gaps for the domain of analyzing API traffic spans.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI coding agents with tools to query, search, and analyze persisted HTTP request logs, enabling efficient debugging without terminal noise.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to query OriginChain's telemetry agent for log patterns, semantic incident analysis, distributed traces, service graphs, and read-only SQL queries over telemetry data.
      10
      4 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Connects AI assistants to OpenTelemetry trace backends (Jaeger, Grafana Tempo, Traceloop, Datadog, Sentry, AWS X-Ray, New Relic and Honeycomb) for natural-language trace and span search, error triage, cross-backend correlation, and LLM analytics such as token usage, model performance and the most expensive or slowest traces.
      19
      169 PyPI
      1
      Apache 2.0