To give Claude Code access to your production logs, add your log tool's MCP server with claude mcp add, then sign in with /mcp. Claude then reads the copy of your logs that tool stores, never your servers or database. Keep it read-only: use a read-only role or key where there is one, and block the tools that change things.
Most monitoring tools have one now: Fixter, Sentry, Datadog, Grafana, Better Stack and more. We compare ten of them, with the install line for each, in monitoring MCP servers for Claude Code, compared, and the two most searched in Datadog MCP vs Sentry MCP. This guide uses Fixter, which is ours, for the examples; the steps are the same for the others. On Cursor or Codex? See give Cursor and Codex access to production logs.
~/.claude/projects on your machine.9 For usage and cost across a team, it can export its own telemetry over OpenTelemetry;8 we explain what that telemetry contains.What MCP is
MCP, the Model Context Protocol, is an open standard that lets a client like Claude Code connect to outside tools and data.1 A tool runs an MCP server; Claude Code connects to it and gets a set of tools it can call, such as "search logs" or "get trace". That is how it reaches logs that live outside your repo.
Why query your logs from Claude Code
It is faster than digging by hand. Instead of opening a log viewer, writing a query and following one request across services, you ask, and the answer comes back in the session you are already working in.
Claude Code also has your codebase. It can take a failing log line, find the code that wrote it, and check what went wrong there, not just show you the line.
How to connect Claude Code to your logs
1. Get your logs into a tool with an MCP server
Claude can only query logs that are stored somewhere. If you already use Sentry, Datadog, Grafana or Better Stack, use that tool's server and skip to step 2.
If you have nothing yet, this is where Fixter fits. Fixter finds and fixes the issues in your app in production, from your coding agent: errors, failing infrastructure, slow requests and downtime. It finds the root cause and fixes it: in your agent over MCP, or as a pull request ready for your review. Nothing to learn, built for small teams. To set it up, paste this into Claude Code in your project:
Read fixter.dev/llms.txt and set up Fixter.
Your app then sends logs, traces and metrics over standard OpenTelemetry, with no Fixter SDK. If you would rather wire it by hand, it is four environment variables.4 Free plan. Paid from €20 a month.
2. Add the MCP server to Claude Code
Run claude mcp add in a terminal with the server's URL and the HTTP transport, then run /mcp inside Claude Code. A browser window opens and you sign in with your account.2,3 Adding the server alone does not sign you in.
# in a terminal, in your project claude mcp add fixter --transport http https://mcp.fixter.dev # then, inside Claude Code /mcp
The same pattern works for other tools. These URLs are from each vendor's docs:5,6,7
# Sentry (org and project in the path are optional) claude mcp add --transport http sentry https://mcp.sentry.dev/mcp # Better Stack claude mcp add --transport http betterstack https://mcp.betterstack.com # Datadog: the endpoint depends on your Datadog site claude mcp add --transport http datadog-mcp <your Datadog MCP endpoint>
3. Share it with your team
To give everyone on the repo the same server, commit a .mcp.json at the project root.2 Each person still signs in with their own account, so nobody shares a token.3
{
"mcpServers": {
"fixter": {
"type": "http",
"url": "https://mcp.fixter.dev"
}
}
}4. For CI and headless agents, use an API key
A browser sign-in does not work in a CI job. For Fixter, create a key under Settings, API keys, and pass it as a header. Keys do not expire on their own, so keep it in your CI secrets.3 From Claude Code 2.1.327, claude mcp add-json with - reads the server's JSON from stdin, so the key stays off the command line.13 It does not run inside a Claude Code session, so run it in a plain terminal or the CI step.
# Claude Code 2.1.327 or later: the key is read from stdin,
# so it never appears in the command line or your shell history
printf '{"type":"http","url":"https://mcp.fixter.dev","headers":{"Authorization":"Bearer %s"}}' "$FIXTER_API_KEY" \
| claude mcp add-json fixter -
# older versions
claude mcp add fixter --transport http https://mcp.fixter.dev \
--header "Authorization: Bearer fixter_sk_<your-key>"5. Ask in plain language
That is it. From the session you code in, ask about your logs and Claude calls the MCP server to answer.
What you can ask once it is connected
Ask the way you would ask a teammate who has the logs open:3
- Why did checkout fail last night?
- What new errors appeared since this morning's deploy?
- Which users hit this error since the deploy?
- Show the slowest endpoints today.
- Set up an alert when payment errors spike.
> what new errors appeared since this morning's deploy? Two new issues since the 09:40 deploy. A timeout on the payments service, 142 times, all in the EU region. And 38 failed signups from a null email field in the signup handler. The first started two minutes after the deploy.
The useful next step is to stay in the same session: ask Claude to open the code behind the error and propose a fix. That is the part a log viewer cannot do.
What the agent can and cannot touch
An MCP server acts with your permissions, or the key's. Claude never gets a shell on your servers or a login to your database: it queries the logs, traces and metrics your app already sent to the monitoring tool. Log queries only read, but most monitoring servers also have tools that change things, and those act right away.3 Here is what that means for Fixter's server:
| What | Over Fixter MCP | How |
|---|---|---|
| Logs, traces, metrics | Read | logs, spans, get_trace, metrics; run_sql runs a read-only SELECT on the copy stored in Fixter |
| Issues and investigations | Read and change | Read issues and root-cause analyses; set_issue_status and set_issue_priority change them |
| Alert rules, dashboards, API tests, channels | Create, change, delete | Write tools such as save_alert_rule and delete_dashboard act right away |
| Your repository | Only with the GitHub App | fix_issue opens a pull request for your review; Fixter never merges |
| Your servers and hosts | No access | Fixter only gets what your app sends over OpenTelemetry |
| Your production database | No access | No database credentials are involved; run_sql reads Fixter, not your database |
From Fixter's MCP docs and tool reference, checked November 18, 2026.3,10
Make it read-only in practice
- Hide the write tools. In Fixter, open User settings, Tools and pick the Debugging preset (reads telemetry and triages, no authoring or deleting), or keep only Telemetry and querying. Start a new session after you save.11 Fixter's docs are clear that hiding a tool is not a permission: it removes the chance of a mistake, nothing is revoked.
- Deny them in Claude Code. A deny rule in
.claude/settings.jsonblocks a tool even if it is visible, and deny wins over any allow rule.12 Commit it so the whole team gets it. These patterns cover every Fixter tool that creates, changes or deletes something, and the one that opens a fix pull request; reading and starting an investigation stay allowed.
{
"permissions": {
"deny": [
"mcp__fixter__save_*",
"mcp__fixter__delete_*",
"mcp__fixter__set_*",
"mcp__fixter__create_*",
"mcp__fixter__update_*",
"mcp__fixter__add_*",
"mcp__fixter__remove_*",
"mcp__fixter__enable_*",
"mcp__fixter__disable_*",
"mcp__fixter__manage_*",
"mcp__fixter__suppress_*",
"mcp__fixter__unsuppress_*",
"mcp__fixter__mint_*",
"mcp__fixter__fix_issue"
]
}
}On other tools the same two layers apply. Datadog checks your Datadog permissions on every call, rejects a write from a read-only user, and lets admins turn off the write tools for the whole organization.6 Better Stack lets you allow or block tools per connection with request headers.7 Sentry's server can be scoped to one organization or project in its URL.5 Query results pass through the vendor's server into your Claude session, so the same data rules apply as for anyone on your team reading those logs.
Key takeaways
- Claude Code reaches your logs through your log tool's MCP server
- Add it with claude mcp add and the server's URL, then sign in with /mcp
- Commit a .mcp.json to share it with the team; use an API key for CI
- No production or database credentials in the agent; deny the write tools you never want called
- No log tool yet? Fixter sets itself up from one prompt in Claude Code
- Then ask in plain language, and let Claude tie the error to your code
Frequently asked questions
How do I give Claude Code access to my production logs?
Add your log tool's MCP server to Claude Code with claude mcp add and its URL, for example claude mcp add fixter --transport http https://mcp.fixter.dev, then run /mcp inside Claude Code and sign in. Claude can then search your logs, errors and traces with your permissions. Your logs have to be in a tool with an MCP server first.
How do I keep Claude Code's access to production logs read-only?
Point it at the tool that stores your logs, not at your servers or database, so no production credentials go into the agent. Then limit the tools that change things: sign in with a read-only role or token where the vendor has one, hide write tools in the vendor's settings, and add deny rules for them in Claude Code's permissions. In Fixter, hiding a tool is a preference, not a permission, so the deny rule is what Claude Code enforces.
Can Claude Code read my production logs by default?
No. Claude Code has no access to your logs until you add an MCP server for the tool that stores them and sign in. From then on it can query them when you ask, scoped to what that server and your account allow.
Which log tools have an MCP server for Claude Code?
Fixter, Sentry, Datadog, Grafana, Better Stack, Axiom, New Relic, Honeycomb and Dash0 all have one. We compare them, with the install line for each, in our post on monitoring MCP servers for Claude Code.
How do I share the log connection with my team?
Commit a .mcp.json file at the root of the repo with the server's URL. Everyone who opens the project in Claude Code gets the server, and each person signs in with their own account through /mcp.
Can I connect logs over MCP in CI or a headless agent?
Yes, with an API key instead of the browser sign-in. For Fixter, create a key under Settings, API keys, and send it as an Authorization: Bearer header. From Claude Code 2.1.327, claude mcp add-json with - reads the server's JSON from stdin, so the key stays off the command line. Other vendors document their own token options.
Where are Claude Code's own logs?
If you mean Claude Code's own session history rather than your app's logs: Claude Code keeps each session's transcript as a JSONL file under ~/.claude/projects on your machine. For usage and cost across a team, Claude Code can export its own telemetry over OpenTelemetry.
For the investigation side of this, reading logs to find root cause, see log analysis. Picking your first error tracking tool? See error tracking for small teams.
Sources (13), all checked November 18, 2026
- Model Context Protocol, introduction (what MCP is)
- Claude Code docs, connect to MCP servers (claude mcp add, /mcp, .mcp.json)
- Fixter docs, MCP server (URL, sign-in, API keys, Cursor, example questions)
- Fixter docs, OpenTelemetry setup
- Sentry MCP (endpoint, OAuth, Claude Code command)
- Datadog docs, MCP Server (permissions, write tools, setup per site)
- Better Stack docs, MCP server
- Claude Code docs, monitoring usage with OpenTelemetry
- Claude Code docs, session storage (transcripts as JSONL under ~/.claude/projects)
- Fixter docs, MCP tools (run_sql is a read-only SELECT, which tools write)
- Fixter docs, managing the MCP tool list (presets, hiding is not a permission)
- Claude Code docs, permissions (deny rules for MCP tools, deny before allow)
- Claude Code v2.1.327 release notes (claude mcp add-json reads JSON from stdin)