> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trace0hq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Connect AI assistants and other MCP clients to Trace0.

Trace0 provides a Model Context Protocol (MCP) server that allows supported AI assistants and development tools to explore your Trace0 observability data.

## Server

```text theme={null}
https://app.trace0hq.com/api/mcp
```

## Authentication

The Trace0 MCP server uses OAuth 2.0 for authentication.

When you connect an MCP client, such as Claude Code, you will be redirected to Trace0 to sign in and authorize access to your account. After authorization, the client receives an access token that it can use to call the MCP server on your behalf.

The authorization flow uses:

* OAuth 2.0 Authorization Code flow
* PKCE
* Dynamic Client Registration for supported MCP clients
* A consent screen before access is granted

See [this guide](https://code.claude.com/docs/en/mcp-quickstart#connect-a-server-that-requires-sign-in) on how to connect an MCP Server to Claude Code that requires sign-in.

## Tools

The Trace0 MCP server provides tools for querying your environments, services, transactions, logs, and metrics.

Available tools include:

| Tool                           | Description                                                                                                            |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `get_environments`             | Returns the names of all environments in the authenticated user's Trace0 account.                                      |
| `get_services`                 | Returns the name and programming language of all services in the given environment.                                    |
| `get_transactions`             | Returns the summaries of transactions matching the specified filters.                                                  |
| `get_transaction_detail`       | Returns the transaction details for the given transaction ID.                                                          |
| `get_log_count`                | Returns the number of logs matching the specified filters, aggregated by service name, severity level and time bucket. |
| `get_service_metric_summaries` | Returns metric summaries for all services in the given environment and time period.                                    |
| `get_service_metrics`          | Returns detailed metrics for a specific service in the given environment and time period, aggregated by time bucket.   |

<Info>
  All tools, apart from `get_environments`, require an `environmentName` argument. Use `get_environments` first to retrieve the list of environment names in the authenticated user's account.
</Info>

## Fair Use Limits

The Trace0 MCP Server comes with the following fair-use limits:

* 50,000 monthly tool calls

Once a limit is exceeded, the MCP Server will return an error describing the applicable restriction.

If you require higher limits, please contact us at [hello@trace0hq.com](mailto:hello@trace0hq.com) to discuss.
