跳到正文
DEV Community· Markera·· 6 小時前AI 評分52

停止把日誌貼進 Claude Code:改用 Rudow 的 MCP 伺服器查詢

Stop Pasting Logs Into Claude Code. Give It a Log Agent Instead.

AI 導讀

文章示範如何透過 Rudow 的原生 MCP 伺服器,讓 Claude Code 直接查詢日誌,減少手動搜尋和貼上。連接後,Claude Code 可使用 17 個唯讀工具;作者以模擬結帳後端測試,定位到部署 #842 後資料庫連線池耗盡,回滾至 #841 後錯誤停止。診斷引用日誌錯誤和時間線,也明確指出未能確認的較早部署故障,以及失敗扣款總數。

正文

Your logs live in a dashboard. Your coding agent lives in your terminal. When something breaks in production, you are the copy-paste layer between them: grep the logs, paste the lines into Claude Code, ask what broke, repeat.

There is a shorter path. Give the agent a way to read the logs itself.

That's what Rudow does. Rudow is log observability with a native MCP server. Claude Code is the coding agent. Rudow is the SRE agent it queries: it holds your logs and answers questions about them.

Here is how to set it up, and what it looks like when it works.

1. Connect the MCP server

One line:

claude mcp add --transport http rudow https://mcp.rudow.ai/mcp

You'll be asked for an MCP key. Mint one in the Rudow dashboard under Settings → Account → MCP keys. Keys start with alogmcp_.

That's the whole connection. Claude Code now has 17 read-only tools for your logs: searching, aggregating, listing incidents, pulling metrics. Read-only by design — the agent can investigate, never mutate.

2. Ship your logs

Rudow needs your logs before it can answer questions about them. Three ways in.

Node:

npm install @rudow/node-logger
import { createLogger } from "@rudow/node-logger";
const logger = createLogger({ apiKey: process.env.RUDOW_API_KEY });

Python:

pip install rudow

Or plain HTTP, any language:

curl -X POST https://api.rudow.ai/v1/ingest \
  -H "Authorization: Bearer $RUDOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entries": [{"message": "POST /charge failed", "level": "error", "source": "payment-service"}]}'

Mint an ingest key in the dashboard under Settings → Projects → API keys. Keys start with alog_. Keep it in an environment variable, never in source control. Entries show up in the Logs tab within seconds.

3. Ask what broke

I tested this on a simulated checkout backend: a checkout API and a payment service backed by a Postgres pool capped at 100 connections. Deploy #842 held a connection for 8 seconds across each payment call. The pool saturated, and checkout started failing.

I asked Claude Code one question:

What broke in checkout today? Check the logs.

Claude queried the logs through Rudow and came back with the diagnosis: the payment service had run out of database connections after deploy #842, and the rollback to #841 had fixed it. The evidence it cited:

  • POST /charge and POST /refund failing with "timeout acquiring connection from pool (waited 5000ms)" and "pool exhausted, active=100 idle=0"
  • 139 pool-exhausted errors, starting 47 seconds after #842 went out and stopping at the rollback
  • The pool maxed at 100 out of 100, with 113 requests waiting
  • The warnings showing #842 holding connections for 8 seconds per charge request

It also said what it could not confirm: it had only read errors back to a certain point, so it could not say whether an earlier deploy window had failed too, and it had not counted the total failed charges. That is the right behaviour from a debugging tool: a diagnosis plus its limits, not a confident guess.

The timeline it reconstructed matched the deploy log: #842 out, errors starting 47 seconds later, rollback to #841, errors stopping.

See it in action (44 seconds, real Claude session): https://youtu.be/0AB3DulAIMk

What this replaces

Before this, the flow was: notice the errors, open the log dashboard, search, copy lines, paste them into the agent, explain the context, repeat for each follow-up question. Now the agent does the searching and you ask the question in plain English.

Rudow doesn't write code and doesn't fix the bug. It is the log layer your agent queries. The fixing is still the coding agent's job, and yours.

Why this is the shape of things to come

Coding agents are becoming the default way developers work. But an agent that can't see your production logs is debugging blind — it can read your code, but not what your code actually did at 3 a.m. The teams that win the next era of debugging won't be the ones with the biggest dashboards. They'll be the ones whose agents can interrogate production directly, in plain language, with evidence and stated limits.

Rudow is built for that world: a native MCP server (not a bolt-on), read-only by design, flat pricing with hard caps instead of surprise overages, and the MCP server on the free tier — so the workflow is available to everyone, not gated behind a paid plan.

Try it

The free Hobby tier covers 200,000 log entries a month — enough to wire up a real service and see if the workflow sticks. Paid tiers are flat with hard caps: Dev $9.99, Pro $29.99, Team $79.99.

Sign up free: https://app.rudow.ai/signup

One line installs it. Then just ask what broke.


MCP server: https://mcp.rudow.ai/mcp · Docs: https://rudow.ai/docs/mcp · Site: https://rudow.ai

來源:DEV Community · dev.to