Skip to Content
Tares

How do I ask Claude Code to investigate failed deploys with Tares?

Connect Claude Code to the Tares MCP endpoint, then ask what happened to the failing service in the last 15 minutes, and Claude Code answers from the correlated timeline in Tares. Claude Code calls the read tool, which returns logs, metrics, alerts and findings for that service in one time-ordered read. If your pipeline posts deploy events to Tares, the deploy appears on the same timeline as the errors that followed it.

How it works

Tares does the data side and Claude Code is the agent that asks the question. This is the pull half of an AI SRE setup, described in Build an AI SRE.

  • Your sources (metrics, logs, alerts, and optionally deploys) carry the same service label, so Tares keeps one timeline per service.
  • Claude Code connects to the Tares MCP endpoint and discovers the Tares tools.
  • When you ask about a service, Claude Code calls read with a selector such as {"service": "api-server"}. The selector is a strict AND over label values. project or sources narrows the read.
  • read returns a correlated, time-ordered timeline across all matching sources, so Claude Code sees “deploy landed, errors started two minutes later” in one answer.
  • If a Tares agent or an outside agent already recorded a finding on that service, the read includes it. Claude Code starts from the previous conclusion instead of from scratch.
  • In the console, Reads lists each read as it happens, tagged client = mcp.

Set it up

  1. Start Tares and the MCP endpoint. On your machine, start Tares, then start the MCP server in a second terminal. The daemon alone does not serve /mcp. On a server or Tares Cloud instance the MCP server is already running, and your endpoint is shown under Connect in the console.

    tares up tares mcp
  2. Connect Claude Code. The local endpoint is http://localhost:8788/mcp. Run this in your terminal:

    claude mcp add --transport http tares http://localhost:8788/mcp

    The Tares plugin is the default path for Claude Code. /plugin marketplace add glassflow/tares followed by /plugin install tares@tares wires the MCP read-back and also captures your Claude Code sessions into Tares. Use the CLI command above if you want to connect without capturing sessions.

  3. Add the credential on a secured instance. A server or Tares Cloud instance requires one. Pass a scoped API key with the read scope as a header:

    claude mcp add --transport http tares https://<your-host>/mcp \ --header "Authorization: Bearer <api-key>"

    An open local instance needs no credential.

  4. Verify the connection. Ask Claude Code: “Use tares: what are you ingesting right now?” It should call catalog_list and answer with your sources, triggers and projects.

  5. Ask about the failed deploy. Name the service and the window:

    Use tares: what happened to api-server in the last 15 minutes?

    Replace api-server with your own service name. Claude Code calls read with that service as the selector and answers from the correlated timeline.

  6. Put deploys on the timeline. Create a webhook source with a primary service label, event_type: deploy and a text template such as deploy {commit} by {author}: {message}. Creating it gives you an ingest URL. Add one line to your CD pipeline that runs on every deploy:

    curl -X POST https://<your-tares>/ingest/<ingest_key> \ -H 'content-type: application/json' \ -d '{"service": "checkout", "commit": "9f2c81d", "author": "dana", "message": "raise db pool size"}'

    Each POST lands as a deploy event on that service’s timeline. Failed deploys then show up next to the logs, metrics and alerts they affected.

What you get

  • A single answer to “what happened to this service” that ties the deploy, the error logs, the metrics and the fired alerts together on one clock.
  • Investigation on demand from the tool you already work in, with no dashboards to open first.
  • Continuity between investigations. Findings recorded on the service are part of the read, so each question builds on the last conclusion.
  • A visible audit trail. Every read shows up under Reads in the console.
  • A path to scoped access. Use a read key, or a project key if the agent should work inside one project only.

When something else fits

  • If you want the investigation to start without anyone asking, use a trigger that wakes an agent when an alert fires. Build an AI SRE covers both the pull and the push halves.
  • If your client is Codex, Cursor or another MCP client, the per-client setup shows the exact command or config file for each.
  • If you would rather not wire up an external client, the console includes Ask, an in-app agent with the same read tools.

Still stuck? Get help

Last updated on