Skip to Content
Tares

How do I ask the Cursor agent to investigate slow database queries with Tares?

Tares lets the Cursor agent investigate slow database queries once you add the Tares MCP server to Cursor and ask what happened to your service in the last 15 minutes. Cursor calls the read tool and answers from one correlated timeline of logs, metrics, alerts and findings. You steer it toward slow queries in the wording of your question.

How it works

Tares ingests your sources and labels them, for example by service. All sources that carry the same label value merge into one time-ordered timeline for that service. The Tares MCP server exposes that timeline to any MCP client, including Cursor.

When you ask about a service, Cursor discovers the Tares tools and calls read with a selector on the service label. The reply is a correlated, time-ordered timeline across all matching sources, with logs, metrics, alerts and findings in one read. If a finding is already on that timeline, the read includes it, so Cursor starts from the earlier conclusion.

What Cursor can say about slow queries depends on what your sources carry. If your latency metrics, database or application logs and alerts share the service label, Cursor sees them on one clock. For a layout like that, see Build an AI SRE.

For discovery, catalog_list shows your sources, triggers and projects, and catalog_describe shows one object’s schema, entities and sample events.

Set it up

  1. Start Tares and the MCP endpoint. Locally, the daemon alone does not serve /mcp, so run the MCP server as a second process.

    tares up tares mcp

    The endpoint is http://localhost:8788/mcp. On your own server it is https://<your-domain>/mcp. On Tares Cloud it is shown under Connect in your console, where each instance has its own hostname.

  2. Add Tares to Cursor. Edit ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for one project.

    { "mcpServers": { "tares": { "url": "http://localhost:8788/mcp" } } }
  3. Approve the server in Cursor under Settings, then MCP.

  4. Connecting to a server or Tares Cloud instance? Replace the URL with yours and add the credential. On a secured instance, use a scoped API key with the read scope rather than the root token. The console’s Connect page generates the exact client setup with the endpoint and token filled in. For an agent that should see one project only, use a project key.

  5. Verify the connection. Ask Cursor:

    Use tares: what are you ingesting right now?

    Cursor should call catalog_list and answer with your sources, triggers and projects. In the console, Reads lists each read as it happens, tagged client = mcp.

  6. Ask the investigation question. Name your service and say what you care about:

    Use tares: what happened to api-server in the last 15 minutes? Look for slow database queries and tie each claim to a specific log line, metric or alert.

    Cursor calls read for that service and answers from the correlated timeline. Replace api-server with the value of your own service label.

  7. Narrow it down if needed. Ask Cursor to run catalog_describe on the source that holds your database or latency data, then read again with sources set to just those sources. That leaves only the evidence that matters for the slow queries.

The per-client steps for Claude Code, Codex and other MCP clients are on Connecting agents (MCP).

What you get

  • Cursor answers from the same correlated timeline every Tares agent works from, so a question about a service returns logs, metrics, alerts and findings together.
  • You ask in plain language. There is no query language to learn, and you do not switch between a metrics tool and a log tool.
  • Every read is visible. Reads in the console lists each one, tagged client = mcp, so you can see what Cursor asked for.
  • The access is limited to what you grant. A read key gives Cursor the read surface, and a project key limits it to one project.
  • Earlier conclusions carry forward. When a finding is on the service’s timeline, Cursor reads it along with the raw evidence instead of starting from scratch.

When something else fits

  • Want an agent woken automatically when something breaks, instead of asking by hand? Use a trigger. The Build an AI SRE guide covers the push side.
  • Want Cursor to investigate a project with its own scoped credentials? Use a project key, described on Connecting agents (MCP).
  • Prefer to explore in the browser? The console’s Ask chat uses the same read tools without any client setup.

Still stuck? Get help

Last updated on