← Documentation

MCP server

The Model Context Protocol (MCP) is an open standard that lets AI tools use outside services. Umlogger's hosted MCP server lets a compatible client work with the metrics you can access.

Quick start

  1. Sign up or log in.
  2. Go to Settings → Access tokens (MCP) and choose New access token.
  3. Choose an expiry, and tick Read-only if the AI only needs to analyze data.
  4. Copy the token, which is shown only once, and add it to your client using the instructions below.
Server URL (Streamable HTTP)
https://data.umlogger.com/mcp

Claude Code

claude mcp add --transport http umlogger https://data.umlogger.com/mcp \
  --header "Authorization: Bearer ump_YOUR_TOKEN"

This adds the server for you in the current project. To use it in all your projects, add --scope user before the server name. Start Claude Code and run /mcp to check the connection.

Team setup (.mcp.json)
{
  "mcpServers": {
    "umlogger": {
      "type": "http",
      "url": "https://data.umlogger.com/mcp",
      "headers": {
        "Authorization": "Bearer ${UMLOGGER_TOKEN}"
      }
    }
  }
}

Each person sets UMLOGGER_TOKEN to their own token, so no token is stored in the repository.

Cursor

Add this to ~/.cursor/mcp.json for all projects, or to .cursor/mcp.json for one project:

{
  "mcpServers": {
    "umlogger": {
      "url": "https://data.umlogger.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:UMLOGGER_TOKEN}"
      }
    }
  }
}

UMLOGGER_TOKEN must be set in the environment Cursor starts from.

OpenCode

These instructions are for OpenCode 2. Set your token in the shell you use to start OpenCode. To keep it for new terminals, add this line to your shell profile, such as ~/.zshrc:

export UMLOGGER_TOKEN="ump_YOUR_TOKEN"

Merge this into ~/.config/opencode/opencode.json for all projects, or into opencode.json in one project. Keep any settings you already have:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "umlogger": {
        "type": "remote",
        "url": "https://data.umlogger.com/mcp",
        "oauth": false,
        "headers": {
          "Authorization": "Bearer {env:UMLOGGER_TOKEN}"
        }
      }
    }
  }
}

Umlogger uses an access token instead of OAuth, so keep "oauth": false. Without it, OpenCode may ask you to sign in when the real problem is a missing token. OpenCode writes variables as {env:NAME}, without a $.

Restart OpenCode's background server, then check the connection
opencode service restart
opencode mcp list

Finish any active OpenCode work before restarting. Run both commands in the shell where you set the token, because a server that's already running won't pick it up. You should see umlogger connected. If no servers are listed, wait a moment and run opencode mcp list again. You can also run /mcps inside OpenCode.

Other clients

Your client needs to support remote Streamable HTTP servers and a custom Authorization header. Config formats vary, so check your client's documentation. Umlogger doesn't support OAuth sign-in for MCP yet, so connectors that require it won't work.

Tools

Identify a metric by slug, ID, or exact name. A ? marks an optional parameter. Timestamps use ISO 8601 with a timezone, such as 2026-11-30T09:00:00Z.

Read tools
  • list_metrics: Lists metrics you can access, with type and latest value.
    Parameters: search?
  • get_metric: Shows type, guide lines, alerts, and a console link. Includes the ingest URL only for metrics you own, and only with a read & write token.
    Parameters: metric
  • query_metric: Returns time buckets and a summary. Can also summarize the preceding period for comparison.
    Parameters: metric, period?, from?, to?, resolution?, comparePrevious?, includeBuckets?
  • get_recent_samples: Returns the latest raw samples, newest first (20 by default, up to 200).
    Parameters: metric, limit?
  • list_annotations: Lists chart notes such as deploys, launches, and incidents.
    Parameters: metric, period?, from?, to?
Write tools (not available to read-only tokens)
  • create_metric: Creates a count or value metric and returns its ingest URL.
    Parameters: name, type, slug?
  • log_sample: Records one value on a metric you created.
    Parameters: metric, value, timestamp?
  • log_samples: Records up to 500 timestamped values on a metric you created.
    Parameters: metric, samples
  • add_annotation: Adds a note to the chart of any metric you can access, including shared ones.
    Parameters: metric, note, timestamp?

No tool can delete data or create or edit alerts. Use the console for those.

How data is summarized

  • Count metrics are added up in each time bucket. Summaries include a total.
  • Value metrics are averaged in each bucket. The summary average gives every non-empty bucket equal weight, even if some have more samples. There is no total.
  • min, max, first, and last describe buckets, not individual samples. Use get_recent_samples for raw values.
  • query_metric covers the last 7 days by default, and list_annotations the last 30. Both accept 2m, 15m, 1h, 24h, 2d, 7d, 14d, 30d, 60d, 180d, or 365d, or explicit dates.
  • Buckets follow UTC, and the first and last may be partial. Periods are rolling, so 7d doesn't mean a calendar week.

Example prompts

List my metrics and tell me which haven't received data in the last 24 hours.
Compare signups for the last 30 days with the 30 days before.
Show API latency for the last 24 hours in 1-hour buckets. When was it highest?
List deploy annotations for error-rate and compare their times with any spikes.
Add the annotation "Deployed v2.3" to api-latency.
Create a count metric called "Trial started", then add its ingest call to my signup handler.

Find more in our prompts for SaaS metrics.

Code samples

curl: list tools
curl -X POST "https://data.umlogger.com/mcp" \
  -H "Authorization: Bearer $UMLOGGER_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
curl: compare two periods
curl -X POST "https://data.umlogger.com/mcp" \
  -H "Authorization: Bearer $UMLOGGER_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"query_metric","arguments":{"metric":"signups","period":"7d","comparePrevious":true,"includeBuckets":false}}}'
TypeScript (@modelcontextprotocol/sdk 1.x)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(
  new StreamableHTTPClientTransport(new URL("https://data.umlogger.com/mcp"), {
    requestInit: {
      headers: { Authorization: `Bearer ${process.env.UMLOGGER_TOKEN}` },
    },
  }),
);

const result = await client.callTool({
  name: "query_metric",
  arguments: { metric: "signups", period: "7d", comparePrevious: true },
});
console.log(result.content);
await client.close();

Permissions & security

  • Your access: a token reaches only metrics you created or that were shared with you, not your whole organization's. Only a metric's creator can log samples through MCP. With a read & write token, you can also annotate shared metrics.
  • Read-only tokens: these have no write tools and can't see ingest keys.
  • Storage and revocation: Umlogger stores a hash, not the token itself. Revoke a token in Settings to block any further requests with it. If a token leaks, revoke it immediately. If it was a read & write token, remember that it could also read the ingest URLs of metrics you own, and revoking it doesn't change those ingest keys.
  • Your AI provider: your AI client receives the results of tool calls and may send them to its model provider. Check that provider's data policy.
  • Review changes: AI can make mistakes or follow misleading text in the content it reads. Review write actions before approving them.

Limits

  • 120 requests per minute per token
  • About 1,000 time buckets per query
  • 200 raw samples per get_recent_samples call
  • 500 samples per log_samples call
  • 20 access tokens per user, including expired tokens you haven't revoked

Troubleshooting

  • 401 Unauthorized: the token is missing, mistyped, expired, or revoked. It must start with ump_; sk_, pk_, and pmk_ keys don't work here. Also check for stray spaces or line breaks.
  • OpenCode returns 401 after you set the token: its background server may have started before the variable was set. Run opencode service restart in a shell where UMLOGGER_TOKEN is set.
  • OpenCode says “needs authentication”: add "oauth": false, check your token, and restart the background server. Don't use opencode mcp auth, because Umlogger doesn't support OAuth.
  • 405 Method not allowed: the endpoint accepts only POST, so opening it in a browser won't work.
  • 406 Not Acceptable: for your own requests, send the Accept header shown in the curl samples.
  • 429 Too Many Requests: wait a minute, then make fewer calls.
  • Write tools are missing: the token is read-only. Create a read & write token if you need them.
  • A metric is missing: ask its creator to share it with you.
  • Too many buckets: use a shorter range or a larger resolution.

Still stuck? Contact us, but never include your token.