In short.
This guide shows Python developers how to connect Pydantic AI agents to Logfire, but its default integration exposes tools that can make changes within the supplied credential's permissions. LogfireMCP connects an agent to Logfire's Model Context Protocol server for telemetry queries and project management. The page explains authentication for individual users, US and EU endpoints, self-hosted connections, tool filtering and approval wrappers. Its read-only option depends on server metadata, while credential scopes govern permitted actions. The documented Harness API is subject to changes during 0.x releases. Pricing, licensing and runtime performance are not established, and no examples were executed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is limited to the complete page at [https://pydantic.dev/docs/ai/harness/logfire-mcp/index.md], captured on 2026-11-25T21:15:46.888Z. This includes its documentation-index and query-parameter notices, 0.x compatibility notice, examples, authentication guidance, tool controls and connection customization. Linked pages and source-code files are excluded. The page supplies no pricing or licensing terms. No commands or examples were executed, so runtime functionality, security properties, compatibility and performance remain untested.
The overview
Identity
The resource is the Logfire MCP documentation page for Pydantic AI Harness at [https://pydantic.dev/docs/ai/harness/logfire-mcp/index.md]. It teaches developers to attach the Python LogfireMCP capability to a Pydantic AI agent.
MCP means Model Context Protocol, a way for an AI agent to call external tools. Here, those tools query Logfire telemetry and manage Logfire projects. The page contains installation instructions, configuration details and Python examples.
Assessment
The guide is useful for developers who already use Logfire and want an agent to investigate operational data or manage accessible projects. Its strongest practical detail is the explanation of how credentials, regional endpoints and tool controls interact.
The main adoption decision is how much authority to give the agent. The default capability exposes all tools offered by the server, including tools that make changes. A reading assistant should use the documented read_only=True setting together with credentials scoped to reading. Reliability and production readiness have not been independently assessed.
Users
The intended readers are Python developers building Pydantic AI agents, particularly applications that need access to Logfire traces, telemetry or project-management tools. Developers serving multiple Logfire users receive guidance on selecting a separate credential for each run.
Readers need enough Python knowledge to configure an Agent, manage dependencies and handle credentials. Beginners can follow the basic connection example, while shared applications require additional work on token storage, refresh and approval handling.
Capabilities
LogfireMCP exposes the hosted server's tools to an agent, including logfire_query_run and tools that can change projects. Credential scopes determine which projects and actions are accessible. The page does not enumerate the complete server tool inventory.
Configuration includes static API keys, local browser OAuth, authentication callbacks, regional or self-hosted endpoints, custom tool prefixes, read-only filtering and optional instruction guidance. Existing toolset wrappers can filter tools or require approval, and Tool Output Limits can cap large query results.
Using it
Requirements
The installation example uses pydantic-ai-harness[logfire-mcp] and pydantic-ai-slim[openai]. The agent needs access to the chosen Logfire MCP endpoint and an appropriate credential. Python version requirements, dependency version constraints and model-provider authentication are not specified on this page.
Without an explicit auth value, the capability reads LOGFIRE_API_KEY and raises an error during agent creation if no key is available. Browser OAuth is documented for use on your own machine. Applications serving multiple users must store and refresh each user's API key or OAuth token themselves.
Mechanism
The capability sends MCP tools/call requests to the configured server with a bearer token. The default endpoint is the US region; LOGFIRE_EU_MCP_URL selects the EU region. Tools receive a logfire_ prefix by default to avoid name collisions.
An authentication callback runs at the start of each agent run and may be asynchronous. Its returned credential applies to that run, without falling back to LOGFIRE_API_KEY. Returning None or an empty string removes Logfire tools for that run, but leaves the capability's guidance in place.
The guidance supplies the current UTC hour, encourages short query windows and requests Logfire links only when asked. Hour changes are appended to conversation history to preserve existing prompt-cache content. Setting include_instructions=False disables both this guidance and the server's instructions.
Setup
The documented installation command is pip install "pydantic-ai-harness[logfire-mcp]" "pydantic-ai-slim[openai]". A corresponding uv add command is also supplied. Set LOGFIRE_API_KEY, pass an API key through auth, or use auth='oauth' locally. Import LogfireMCP from pydantic_ai_harness.logfire_mcp and add it to the Agent's capabilities.
For a reading assistant, configure LogfireMCP(read_only=True) and use a credential scoped to reading. Choose the endpoint before supplying credentials: the API key is sent to that URL, and the page instructs readers to use HTTPS. Approval controls require a toolset wrapper and implementation of the deferred-tools workflow.
Example
The basic example constructs Agent('openai:gpt-6.1-sol', capabilities=[LogfireMCP()]), calls run_sync('Summarize the resources I can access') and prints result.output. This illustrates the connection pattern; no output or successful execution is established by the evidence.
A second example stores a logfire_token in a Deps dataclass and returns it from an authentication function. A DynamicCapability example additionally selects the US or EU endpoint for each run and returns no capability when a token is absent. That approach also avoids adding Logfire instructions for unauthenticated users.
Assessment & evidence
Limitations
read_only=True relies on tools being marked read-only by the server. If the server marks none of its read tools, the agent receives no tools and emits MCPReadOnlyNoToolsWarning. Credential permissions remain the underlying access control.
Telemetry can contain text supplied by application users, including request paths, errors and logged prompts. The page warns that instructions embedded in those results could steer an agent toward tools that make changes. Query results can also be large; no fixed result-size ceiling or query-window duration is specified.
A supplied custom client is shared across runs and owns its connection URL and authentication. Combining it with a non-empty auth value or a non-default url raises an error. Multiple LogfireMCP instances require distinct ids and tool prefixes. No latency, throughput or accuracy measurements are provided.
Reasoning
The documented design supports a useful separation between tool availability and account permissions. Read-only filtering limits which tools the model sees, while a credential scoped to reading limits what the server permits. Using both follows the page's advice and avoids relying solely on server annotations.
Authentication callbacks are relevant when users share an application but have different Logfire accounts. Dynamic capabilities address differences beyond credentials, including regional routing and whether instructions should be present. These are conclusions from the documented design, not measured security or isolation guarantees.
Alternatives
The page documents several choices within this integration: API keys, local OAuth or callbacks for authentication; US, EU or self-hosted endpoints; and a supplied FastMCP client or transport for connection customization.
It provides no comparison with competing observability products, other MCP integrations or other agent frameworks. Relative cost, ease of use and performance cannot be assessed from this page.
Evidence
The evidence is the complete documentation page at [https://pydantic.dev/docs/ai/harness/logfire-mcp/index.md], retained as selected-page.txt. It includes installation commands, Python examples, authentication rules, tool controls and connection settings.
Linked provider setup, version-policy documentation, toolset-wrapper documentation, deferred-tool instructions, output-limit documentation and repository contents are outside this evidence. No code was executed, and authentication, query correctness, account isolation and performance were not independently verified.
Access & freshness
Costs
The page supplies no Logfire prices, free allowances, usage charges, model-provider prices or self-hosting costs. It also gives no measurements from which to estimate consumption. Total operating cost is unknown.
A budget would require current terms for the chosen Logfire deployment and model provider, plus any infrastructure costs. The presence of installation commands does not establish that the complete service is free.
Rights
The page links to implementation source at [https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_harness/pydantic_ai_harness/logfire_mcp/], but includes no software license, documentation license or redistribution terms. Permission to modify or redistribute the code or page is therefore unknown from this evidence.
The page explains credential scopes, but does not establish contractual terms for processing or retaining telemetry. Those terms cannot be inferred from the available endpoint choices.
Freshness
The page was captured on 2026-11-25 at 21:15:46.888 UTC. It does not state a publication date, last-update date or exact package version.
Its compatibility notice says Pydantic AI Harness APIs may change between minor releases while on 0.x, with deprecation warnings and release-note migration guidance. The installation examples contain no version pins, so compatibility with a particular installed release remains unverified.
Actions
For a telemetry-reading agent, start with read_only=True, a credential scoped to reading, the appropriate regional endpoint and an output-size limit. If your application requires approval before tool calls, use approval_required() and implement the DeferredToolRequests workflow shown by the page's linked guidance.
For a shared application, provide credentials through run dependencies or an asynchronous authentication callback, and implement token storage and refresh. With durable execution, read credentials from run dependencies rather than globals. Use DynamicCapability when regions vary or unauthenticated users should receive no Logfire instructions.
Before adoption, confirm supported package versions, the actual server tool inventory, current prices and applicable licenses. Validate the intended connection and permission behavior in your own environment; this report establishes no execution results.
