MCP server
Telemetry runs a hosted Model Context Protocol (MCP) server. Connect it to your agent and the agent can find your tables, read their schemas, and answer questions with SQL without you copying query results into the chat.
POST https://api.telemetry.sh/mcp
There is nothing to install and no key to copy. Add the server URL to your MCP client, then sign in with your Telemetry account when the client opens a browser. You choose a team and approve read-only access. Clients that can't sign in can use an API key instead, as described below.
Connect your agent
Claude Code
Add the server from your terminal:
claude mcp add --transport http telemetry https://api.telemetry.sh/mcp
Then run /mcp in Claude Code, choose telemetry, and sign in, or run claude mcp login telemetry from your terminal. On a remote machine without a browser, add --no-browser and paste the address you land on after approving.
Claude
In Claude on the web or in Claude Desktop, open Settings → Connectors, choose Add custom connector, and enter https://api.telemetry.sh/mcp. Select Connect and sign in to Telemetry. Custom connectors depend on your Claude plan. In a Team or Enterprise organization, an owner may need to add the connector first; each member then connects their own Telemetry account.
Codex
codex mcp add telemetry --url https://api.telemetry.sh/mcp
codex mcp login telemetry
Cursor
Add the server to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project. Cursor asks you to sign in the first time it connects:
{
"mcpServers": {
"telemetry": {
"url": "https://api.telemetry.sh/mcp"
}
}
}
GitHub Copilot
Add the server to .mcp.json at the workspace root, or to ~/.copilot/mcp-config.json for your user:
{
"mcpServers": {
"telemetry": {
"type": "http",
"url": "https://api.telemetry.sh/mcp",
"tools": ["*"]
}
}
}
Other MCP clients that support OAuth need only the server URL.
Sign-in and permissions
- Each sign-in connects one app to one team. If you belong to several teams, you choose one on the approval screen.
- The app gets read-only access: it can list tables, read schemas, and run SQL. It can't change or delete data, send events, or manage your team.
- Access tokens last one hour. Your client refreshes them in the background for up to 30 days of inactivity, so you rarely sign in again.
- These tokens only work with the MCP server. They are refused by the HTTP API.
- Team admins see every connected app under Team Settings → API Keys → Connected apps and can disconnect any of them. Access ends within five minutes. Removing someone from the team also ends their apps' access.
Use an API key instead
For a client without OAuth support, or for automation, send a read key in the Authorization header. A read-and-write key or an anonymous trial key also works, with the same limits as the Query API. An ingest key is refused because it cannot read data.
Store the key in an environment variable such as TELEMETRY_API_KEY. Do not paste it into a configuration file that you commit. See API keys and authentication to create a key with the right scope.
claude mcp add --transport http telemetry https://api.telemetry.sh/mcp \
--header "Authorization: Bearer $TELEMETRY_API_KEY"
codex mcp add telemetry --url https://api.telemetry.sh/mcp \
--bearer-token-env-var TELEMETRY_API_KEY
In Cursor, add "headers": { "Authorization": "Bearer ${env:TELEMETRY_API_KEY}" } to the server entry. In GitHub Copilot, add "headers": { "Authorization": "Bearer ${TELEMETRY_API_KEY}" }.
Tools
| Tool | What it does | Arguments |
|---|---|---|
list_tables |
Lists the tables in your account, one page at a time. | page (optional, default 1) and page_size (optional, 1 to 100, default 50). |
get_table_schema |
Returns a table's columns and types, plus its retention and partition settings. | table (required). |
query |
Runs SQL and returns the rows as JSON in data, with the column order in key_order. |
sql (required) and realtime (optional, default true). |
All three tools are read-only. They return the same data as List tables, Get schema, and the Query API. Queries use Telemetry SQL.
Try asking your agent:
- Which tables do I have, and what does the checkout table record?
- How many checkout errors happened in the last 24 hours, grouped by release?
- Did p95 request latency change after yesterday's deploy?
Errors and limits
- A request without credentials, or with an expired, revoked, or invalid token or key, returns
401 Unauthorizedwith aWWW-Authenticateheader. MCP clients use it to start sign-in or refresh the token. - A key that cannot read data, such as an
ingestkey, returns403 Forbidden. - Errors from a tool, such as invalid SQL or a plan limit, come back as a tool result with
isErrorset totrue. The text holds the HTTP status and the same JSON body the HTTP API would return, so your agent can read the message and fix its query. - Tool output is capped at 100 KB. Larger results are cut off with a note. Ask for fewer columns, aggregate, or add a
LIMIT. - Requests count toward the same rate limits and query usage as the HTTP API.
The server keeps no session state. It does not issue an Mcp-Session-Id, and GET /mcp returns 405 Method Not Allowed because it never streams server-initiated messages. It supports MCP protocol versions 2025-11-25, 2025-06-18, 2025-03-26, and 2024-11-05.
For client developers, the server follows the MCP authorization specification. Its protected resource metadata is at https://api.telemetry.sh/.well-known/oauth-protected-resource/mcp, and the authorization server metadata is at https://telemetry.sh/.well-known/oauth-authorization-server. Clients register dynamically and must use PKCE with S256. The only scope is mcp:read.
Test the connection with cURL
You can call the server directly with an API key. This request lists the available tools:
curl -X POST https://api.telemetry.sh/mcp \
-H "Authorization: Bearer $TELEMETRY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
This request runs a query through the query tool:
curl -X POST https://api.telemetry.sh/mcp \
-H "Authorization: Bearer $TELEMETRY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"query","arguments":{"sql":"SELECT COUNT(*) AS events FROM telemetry_quickstart"}}}'
A successful tool call returns 200 OK:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{
"type": "text",
"text": "{\"data\":[{\"events\":3}],\"key_order\":[\"events\"],\"status\":\"success\"}"
}
],
"isError": false
}
}