cd /news/ai-agents/how-to-connect-an-llm-agent-to-your-… · home › topics › ai-agents › article
[ARTICLE · art-176254] src=getbruin.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

How to Connect an LLM Agent to Your Data Pipelines

Bruin released `bruin mcp`, an open-source (Apache 2.0) MCP server that runs over stdio beside a pipeline repository so coding agents such as Claude Code, Cursor and Codex can call the Bruin CLI (`bruin validate`, `bruin run`, `bruin lineage`, `bruin query`), alongside a Bruin Cloud MCP server at `cloud.getbruin.com/mcp` that exposes 36 tools for pipelines, runs, assets, logs and backfills. Each Bruin Cloud tool checks one permission on the token given to the agent, so a read-only token can diagnose a failure without changing anything, and Bruin recommends keeping the agent in a dev environment and reviewing its fixes as pull requests. The local server ships three read-only tools (`bruin_get_overview`, `bruin_get_docs_tree`, `bruin_get_doc_content`) that serve documentation built into the installed binary, and Bruin points to the dbt MCP server, Astronomer's Airflow MCP server and LangGraph with `langchain-mcp-adapters` as alternative routes.

key takeaway

Register `bruin mcp` with the full binary path (editors launched from the Dock or Start menu often miss your shell PATH), and give the agent a read-only Bruin Cloud token so its 36 tools can diagnose failures without changing production.

by read14 min views9 publishedNov 15, 2026
How to Connect an LLM Agent to Your Data Pipelines
Image: Getbruin (auto-discovered)

TL;DR: Connect an LLM agent to your data pipelines by exposing them as MCP tools the agent can call, which in Bruin takes two servers. bruin mcp runs next to your pipeline repo, so a coding agent such as Claude Code, Cursor or Codex can learn and run the Bruin CLI (bruin validate, bruin run, bruin lineage, bruin query). The Bruin Cloud MCP at cloud.getbruin.com/mcp gives the agent 36 tools for pipelines, runs, assets, logs and backfills, and each tool checks one permission on the token you hand the agent, so a read-only token can diagnose a failure and change nothing. Keep the agent in a dev environment and review its fix as a pull request. Other routes: the dbt MCP server for dbt projects, Astronomer's Airflow MCP server for DAGs, and LangGraph with langchain-mcp-adapters for an agent you build yourself.

An LLM on its own knows SQL. It does not know your pipelines: where the code lives, which table feeds which, what failed last night and why. Connecting an agent means giving it those things through tools it can call, and drawing a clear line around what it may change.

We build Bruin, so we use it for the examples and say where other tools fit better.

What an agent needs from your pipelines #

An agent needs four things: the code, the metadata around it, the errors, and a small set of actions. Bruin splits them between a local server for the repo and a cloud server for production.

Need Example question Bruin, local ( bruin mcp + terminal) Bruin Cloud MCP
Code "Where is revenue computed?" Reads the SQL and Python asset files in the repo asset-list-tool (asset details and dependencies)
Metadata "What feeds this table, and which checks guard it?" bruin lineage --full -o json , columns and checks in each asset file asset-list-tool ,asset-health-tool
Errors "Why did last night's run fail?" bruin run output and the locallogs/ folder pipeline-run-list-tool ,asset-instance-list-tool ,asset-instance-logs-tool
Actions "Fix it and prove the fix." Edits files, bruin validate ,bruin run --environment dev asset-rerun-tool ,pipeline-trigger-tool (write permission needed)

The two servers do different jobs. Locally, the agent changes code in a branch. In Bruin Cloud, it reads what happened in production and, only if you allow it, reruns things. Most teams want both.

Step 1: Give the agent your repo with bruin mcp #

bruin mcp bruin mcp is part of the open-source Bruin CLI (Apache 2.0) and runs over stdio next to your project. Register it with the full path to the binary, because editors opened from the Dock or Start menu often don't read your shell's PATH:

claude mcp add --scope user bruin -- "$(which bruin)" mcp
claude mcp list

For Cursor, add the same command to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "bruin": {
      "command": "/Users/you/.local/bin/bruin",
      "args": ["mcp"]
    }
  }
}

VS Code and Codex take the same command. The Bruin MCP docs have each config.

The server itself is deliberately small. It has three read-only tools, bruin_get_overview, bruin_get_docs_tree and bruin_get_doc_content, which serve the Bruin documentation built into the binary. So the agent reads docs that match the CLI version you installed, not a web page about a newer release. The work happens in the agent's terminal, with the commands you would type yourself:

bruin validate ./pipelines                          # config, references, dry-run queries
bruin lineage --full -o json assets/orders.sql      # upstream and downstream as JSON
bruin query -c bq -q "SELECT status, count(*) FROM raw.orders GROUP BY 1" -o json
bruin run --environment dev assets/orders.sql       # build one asset and run its checks

Because these are shell commands, your agent client shows each one and asks before running it unless you have allowed it. That is your review point for local work.

Two additions make the local agent more reliable:

  • Skills and an AGENTS.md. bruin ai skills all adds a Bruin section toAGENTS.md and starter skills such aspipeline-diagnose ,freshness-check andquality-check-investigate , so the agent follows the same steps every time.
  • Dev as the default environment. Withdefault_environment: dev in.bruin.yml , a straybruin run builds prefixed dev tables, not production ones.bruin run --environment production asks for confirmation unless--force is passed, so tell the agent inAGENTS.md never to use--force .
default_environment: dev
environments:
  dev:
    schema_prefix: agent_
    connections:
      google_cloud_platform:
        - name: bq
          project_id: acme-dev
          service_account_file: /path/to/agent-dev.json
  production:   # the agent reads production; Bruin Cloud writes it
    config:
      full_refresh_restricted: true   # --full-refresh can't drop and recreate tables
    connections:
      google_cloud_platform:
        - name: bq
          project_id: acme-prod
          service_account_file: /path/to/reader.json
          read_only: true

BigQuery, ClickHouse, DuckDB and MotherDuck connections accept read_only: true. Pair it with a warehouse user that can only read, and a query the agent gets wrong can't change production data.

Step 2: Give the agent production runs with the Bruin Cloud MCP #

Bruin Cloud runs your pipelines on a schedule and keeps the run history, logs and asset health. Its MCP server lives at https://cloud.getbruin.com/mcp. Create a personal access token in Bruin Cloud (user menu, Access Tokens), then:

claude mcp add --transport http bruin_cloud https://cloud.getbruin.com/mcp \
  --header "Authorization: Bearer YOUR_TOKEN_HERE"

In Cursor, add it to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "bruin_cloud": {
      "type": "streamable-http",
      "url": "https://cloud.getbruin.com/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN_HERE" }
    }
  }
}

In Claude Desktop or on the web there is no token to paste: add https://cloud.getbruin.com/mcp as a custom connector, sign in to Bruin Cloud, and pick the team. That connection is limited to your own permissions on that team, and you can revoke it under Profile → OAuth Apps.

The Cloud MCP docs list 36 tools as of November 2026, 16 that read and 20 that write:

Group Read tools Write tools
Pipelines and runs pipeline-list-tool ,pipeline-run-list-tool ,asset-runs-tool ,run-tags-tool ,validation-error-list-tool pipeline-trigger-tool ,pipeline-rerun-tool ,pipeline-toggle-tool ,mark-pipeline-run-tool ,run-note-tool ,run-delete-tool
Assets and logs asset-list-tool ,asset-health-tool ,asset-instance-list-tool ,asset-instance-logs-tool asset-rerun-tool ,mark-asset-run-tool ,mark-external-dependency-tool , manual asset-health entries
Backfills backfill-list-tool backfill-trigger-tool ,backfill-mark-tool ,backfill-skip-assets-tool ,backfill-delete-tool
Connections connection-list-tool (never secret values),connection-types-tool connection-create-tool ,connection-delete-tool
Costs and alerts cost-explorer-tool ,cost-explorer-schema-tool ,notification-rule-list-tool ,notification-rule-schema-tool create, update and delete notification rules

A failed quality check shows up here as a failed asset instance with its log, and assets that a blocking check stopped show as not run.

If the agent already has a terminal and a token, the CLI covers the same ground: bruin cloud runs diagnose --project-id <id> --pipeline daily_revenue --latest fetches the latest run, finds every failed asset and prints the errors and check results in one command. Bruin's own docs suggest that route when an assistant has shell access, and the MCP when it works through tool calls in chat.

Step 3: Decide what the agent may change #

Every Cloud MCP tool checks one concrete permission, such as pipeline:run:list or pipeline:run:re-run. The token must carry it, and for a personal token your own team role must grant it too. Pick the level when you create the token:

Access level What the agent can do
Read only View pipelines, runs, dashboards and agents
Read & write (no delete) Run pipelines and create or edit resources, without deletion
Read & write Everything your role permits, including deletion
Custom Only the permissions you tick

For an agent that diagnoses failures and proposes fixes, a Custom token with pipeline:list, pipeline:show, pipeline:run:list, pipeline:asset:show and pipeline:run:asset-instance:show is enough. Add pipeline:run:asset-instance:re-run only when you want it to rerun assets itself. There is no reason to give it any delete permission or connection:create.

Set an expiry too: 30, 60 or 90 days, a year, or a custom date (90 days is the default). Bruin Cloud flags a token as expiring 7 days before, and records token creation and changes, plus each API request with the calling token's name, in the audit log. One token per agent and per tool, named for what it does (mcp-cursor-diagnose), makes that log readable.

Walkthrough: from a failed run to a reviewed fix #

Here is an example pipeline, daily_revenue. Setup: Claude Code with both servers registered, a Custom read token for Bruin Cloud, and the repo cloned with dev as the default environment. One prompt:

The daily_revenue pipeline failed last night. Find the cause, fix it on a new branch, prove the fix in dev, and show me the diff with your evidence. Don't rerun anything in production.

What the agent calls, in order:

  1. pipeline-run-list-tool finds the latest failed run of daily_revenue .
  2. asset-instance-list-tool shows that analytics.orders failed on its checks, and thatanalytics.revenue_daily downstream never ran because the check is blocking.
  3. asset-instance-logs-tool returns the failure: the accepted_values check onstatus found rows outside[paid, refunded, pending] .
  4. In the terminal , it readsassets/orders.sql , then runsbruin lineage --full -o json on it to see which tables and dashboards sit downstream.
  5. It runs bruin query in dev to count eachstatus in the source and finds a new value,partially_refunded , that started arriving yesterday.
  6. It writes the change: the new value in accepted_values , and a line in the revenue SQL for partially refunded orders. Then it asks you the one thing it can't know: do partially refunded orders count as revenue, and at what amount?
  7. After your answer, it runs bruin validate andbruin run --environment dev --downstream assets/orders.sql , and the checks pass on the dev tables.
  8. It shows the diff, the log line, and the query result behind its diagnosis.

How you review it: read the diff next to the evidence, not just the summary. Open the pull request, let CI run bruin validate and your unit tests (our CI/CD testing guide has the workflow), and merge. Then rerun the failed run from Bruin Cloud yourself, or give the token pipeline:run:re-run so the agent can call pipeline-rerun-tool. Either way the rerun lands in the audit log.

The business rule in step 6 is why the human stays in the loop. The agent can find a new status in seconds. Whether it counts as revenue is your call.

This works because the agent's context lives in one place. ProphetX runs ingestion, transformation, checks and definitions from one Bruin repo, and its VP of Analytics says a crash gets a root cause analysis in 15 minutes. Read the case study.

Other ways to connect an agent #

Route What the agent can reach Setup Fits when
Bruin (bruin mcp + Bruin Cloud MCP) Ingestion, SQL and Python assets, checks and lineage in the repo; runs, logs, assets, backfills and costs in Cloud One claude mcp add per server; scoped token or OAuth for Cloud Your pipeline, from ingestion to checks, lives in one project
dbt MCP server dbt CLI tools ( build ,run ,test ,compile ,show ; local only), Discovery API lineage and model health, Semantic Layer, read-onlyexecute_sql , Admin API jobs dbt-mcp locally, or the remote server on the dbt platform Transformations live in dbt and ingestion runs elsewhere
Airflow MCP server (Astronomer, Apache 2.0) DAGs, runs, task logs and import errors; trigger, clear and DAGs uvx astro-airflow-mcp --transport stdio Orchestration lives in Airflow 2.x or 3.x
LangGraph withlangchain-mcp-adapters Any MCP server above as LangChain tools, plus your own Python functions MultiServerMCPClient , thenget_tools() You are building your own agent rather than using a coding agent
Your own HTTP tools Whatever you wrap. Bruin Cloud's query API runs read-only SQL with credentials kept in Bruin A team token and an HTTP call A narrow agent that only needs to query

The dbt remote server leaves out the CLI and codegen tools, and which tools you get depends on your dbt plan. Astronomer's server works with open-source Airflow and installs alongside Astronomer's agent skills.

If you build your own agent, the same Bruin Cloud tools load into LangGraph in a few lines:

import os
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent

client = MultiServerMCPClient({
    "bruin_cloud": {
        "transport": "http",
        "url": "https://cloud.getbruin.com/mcp",
        "headers": {"Authorization": f"Bearer {os.environ['BRUIN_CLOUD_TOKEN']}"},
    }
})
tools = await client.get_tools()
agent = create_agent("provider:model-name", tools)
await agent.ainvoke({"messages": "Which assets failed in the latest daily_revenue run?"})

For the wider list of data tools with MCP servers, see which data tools have a built-in MCP server. For building new pipelines with an agent rather than fixing them, see how to build data pipelines with AI agents.

Mistakes to avoid #

  1. A token with delete rights "just in case". Start with read only. Add one write permission when a real task needs it.
  2. Production as the default environment. Makedev the default and give production a read-only connection where your warehouse supports it.
  3. A token in a committed file. Project-level files such as.cursor/mcp.json often end up in Git. Put the Cloud token in the user-level config or an environment variable.
  4. Letting the agent merge its own fix. It opens the pull request. A person merges it, after CI passes.
  5. Connecting the warehouse but not the pipeline. A warehouse-only server shows the agent tables, not how they are produced or which checks guard them. Lineage and checks are what let it trace a wrong number to its cause. More on that inhow to give AI agents context about your company data .

FAQ #

How do I connect an LLM agent to my data pipelines?

Expose the pipelines as MCP tools and register them with your agent. With Bruin, run claude mcp add --scope user bruin -- "$(which bruin)" mcp so the agent can use the Bruin CLI in your repo, and add the Bruin Cloud MCP at https://cloud.getbruin.com/mcp with a scoped token so it can read runs and logs. For dbt projects use the dbt MCP server, and for Airflow use Astronomer's Airflow MCP server.

Does Bruin have an MCP server?

Yes, two. bruin mcp ships with the open-source Bruin CLI and gives a coding agent the Bruin docs for your installed version, so it can run commands like bruin validate and bruin run in your terminal. The Bruin Cloud MCP has 36 tools for pipelines, runs, assets, logs, backfills, connections and costs, each behind a token permission.

Can an AI agent rerun my data pipelines safely?

Yes, if you scope it. In Bruin Cloud each MCP tool needs one permission on the agent's token, so an agent can rerun an asset only if you grant pipeline:run:asset-instance:re-run, and every rerun is recorded in the audit log. Locally, bruin run asks for confirmation before running in a production environment unless --force is passed.

What permissions should I give an AI agent's token?

Start with a read-only or Custom token that can list pipelines, runs and assets and read logs, with an expiry of 90 days or less. In Bruin Cloud that is pipeline:list, pipeline:show, pipeline:run:list, pipeline:asset:show and pipeline:run:asset-instance:show. Add rerun or trigger permissions only for a task that needs them, and never give an agent delete permissions.

Do I need Bruin Cloud to connect an agent to Bruin pipelines?

No. bruin mcp is part of the open-source CLI and works on any local Bruin project, including DuckDB projects on a laptop. Bruin Cloud adds scheduled runs, run history, logs, asset health and costs, and its MCP server is how an agent reads them.

Can I connect my own LangGraph agent to Bruin?

Yes. Load the Bruin Cloud MCP tools into LangGraph with MultiServerMCPClient from langchain-mcp-adapters, passing your Bruin token in the Authorization header. If the agent only needs to query data, Bruin Cloud's query API runs read-only SQL with the warehouse credentials kept in Bruin.

Try Bruin #

Install the Bruin CLI, run bruin init to create a project, register bruin mcp with your agent, and ask it to explain one pipeline before you let it change one. When you are ready for production, create a read-only token in Bruin Cloud and connect the Cloud MCP. The API token docs cover every access level, and the Bruin MCP page shows what agents can do with it.

── more in #ai-agents 4 stories · sorted by recency
── more on @bruin 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-connect-an-ll…] indexed:0 read:14min 2026-11-15 · —