跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Rollbar,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
AnythingMCP 已收录在 Claude 的连接器目录中:一键添加到 Claude (在新标签页中打开),然后登录并选择 Claude 可以使用哪些 MCP 服务器。
摘要
在任意 AI 智能体中使用 Rollbar 错误监控:带历史和事件(occurrence)的条目(item)、完整的堆栈跟踪、最活跃的条目和事件报告、Metrics API、部署、环境和代码版本、RQL 查询,以及账户的项目、用户和团队。它还能解决、静音、分配和暂缓条目,为条目添加评论并登记部署。
试试这样问
Rollbar 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Rollbar、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Rollbar + Claude
在任意 AI 智能体中使用 Rollbar 错误监控:带历史和事件(occurrence)的条目(item)、完整的堆栈跟踪、最活跃的条目和事件报告、Metrics API、部署、环境和代码版本、RQL 查询,以及账户的项目、用户和团队。它还能解决、静音、分配和暂缓条目,为条目添加评论并登记部署。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
ROLLBAR_ACCESS_TOKEN
步骤 1 — 获取凭证
设置大约需要 3 分钟。你需要一个 Rollbar 账户和一个访问令牌。粘贴哪种令牌,决定了连接器能访问哪些内容:
- 单个项目:在项目中打开 Settings、Project Access Tokens,创建或复制一个项目访问令牌。读取需要
read权限范围,修改条目需要write,登记部署需要post_server_item。项目令牌始终作用于自己的项目,但无法列出项目、用户或团队。 - 整个账户:改为创建一个账户访问令牌。服务令牌(账户 Settings、API Access Tokens、Service 标签页)可访问所有项目;个人访问令牌(User Settings、Personal access tokens)只能做其用户能做的事。它们的权限范围是
read和write。使用账户令牌时,AI 会在项目类工具中传入project_id(来自rollbar_list_projects);除非你指定project_ids,rollbar_list_items会搜索令牌可读取的所有项目。 - 将令牌粘贴到
ROLLBAR_ACCESS_TOKEN。它通过X-Rollbar-Access-Token请求头发送到https://api.rollbar.com/api/1。 - 安装连接器并运行
rollbar_list_items检查令牌。
只有个人访问令牌可以评论条目,只有带 post_server_item 的项目令牌可以登记部署。
当前出了什么问题:rollbar_get_top_active_items 显示最近几小时(1 到 168,默认 24)事件最多的条目及其每小时计数,与项目仪表盘上的 Top 10 相同。rollbar_list_items 按状态、级别、环境、框架、负责人、暂缓状态,或使用与 Items 页面相同的搜索文本,列出和搜索条目(分组后的错误和消息)。rollbar_get_item 读取单个条目。Rollbar URL 中的数字(#123)是项目内的 counter,不是条目的 id:rollbar_get_item_by_counter 可以根据 counter 或某个事件的 UUID 找到条目。
排查:rollbar_list_item_occurrences 列出单个条目的各次事件,rollbar_list_occurrences 列出整个项目的最新事件,每条都带时间、代码版本和 payload。rollbar_get_occurrence 返回与 Raw JSON 视图相同的完整 payload:异常类和消息、堆栈帧、请求、person、服务器、客户端、自定义数据和遥测。rollbar_list_item_events 显示谁评论、修改、分配、暂缓或合并了条目。
分诊:rollbar_update_item 可以解决条目(可附带 resolved_in_version,例如 git SHA),静音或重新激活条目,修改级别或标题,分配给用户或团队(ID 来自 rollbar_list_users 和 rollbar_list_teams),或将其暂缓指定的秒数(暂缓需要付费套餐)。rollbar_add_item_comment 在条目的时间线上添加 Markdown 评论。这些操作需要 write 权限范围。
趋势和指标:rollbar_get_occurrence_counts 给出每分钟、每小时或每天的事件数,rollbar_get_activated_item_counts 给出每天新增和重新激活的条目数,rollbar_get_item_metrics 给出一组条目的事件数及首次和最近一次事件时间。在 Advanced 套餐中,rollbar_query_occurrence_metrics 可以使用筛选、分组和聚合查询 Metrics API(例如按环境每天的事件数,或某个条目最常见的浏览器),rollbar_get_resolution_time_metrics 按周期给出条目的解决耗时(中位数、平均值、最小值或最大值)。
版本发布:rollbar_list_deploys、rollbar_get_deploy 和 rollbar_list_environments 读取部署和环境。rollbar_report_deploy 登记某个修订版本到某个环境的部署,rollbar_update_deploy 结束一个登记为已开始的部署(succeeded、failed 或 timed_out)。要查看某次发布引入了什么问题,rollbar_get_version 统计某个环境中某个代码版本的新增、重新激活、重复和已解决条目数,rollbar_list_version_items 配合 event: new 列出在该版本中首次出现的条目。
RQL:做临时分析时,AI 用 rollbar_create_rql_job 以 Rollbar 类 SQL 的查询语言发起查询(表为 item_occurrence 和 deploy),轮询 rollbar_get_rql_job 直到 status 为 success,再用 rollbar_get_rql_job_result 读取结果行。rollbar_list_rql_jobs 和 rollbar_cancel_rql_job 管理以前的和正在运行的任务。RQL 不会修改数据。
账户:使用账户令牌时可用 rollbar_list_projects、rollbar_get_project、rollbar_list_users、rollbar_get_user 和 rollbar_list_teams。
安装时默认关闭:rollbar_request_person_deletion,它会从账户的所有项目中删除被追踪的 person(关联到事件的最终用户),例如用于处理 GDPR 请求。该操作无法撤销,因此由工作区管理员在需要时开启;之后用 rollbar_get_person_deletion_status 跟踪任务。
数据格式:每个响应都是 {"err": 0, "result": ...};err: 1 时会附带 message。rollbar_report_deploy 返回 {"data": {"deploy_id": ...}}。所有时间戳都是 GMT 的 Unix 秒,报告图表数据为 [timestamp, count] 数对。条目 status 为 active、resolved、muted 或 archived;level 为 debug、info、warning、error 或 critical。事件列表不包含请求头、Cookie 和 notifier 详情;rollbar_get_occurrence 的完整 payload 可能包含你的最终用户的个人数据。
分页:条目每页 100 条;事件、部署、环境和条目历史默认每页 20 条,支持的工具可用 limit 设到最多 5000。page 从 1 开始;事件列表也可以用 last_id 翻页。条目超过 100,000 个的项目中,total_count 为 null。
限制:每个令牌在 Rollbar 有各自的速率限制,剩余额度见 X-Rate-Limit-Remaining。Metrics API 相关工具需要 Advanced 套餐。
常见错误:401 表示令牌缺失或格式错误。403 表示令牌已停用、缺少所需权限范围、在账户类工具上使用了项目令牌,或(Requires project access)账户令牌没有可用的 project_id。404 表示 ID 不存在或属于其他账户,422 表示参数无效,429 表示达到令牌的速率限制。
该连接器不会向 Rollbar 发送错误(这是应用中 Rollbar SDK 的工作),不会删除条目,也不会创建项目、团队、用户或访问令牌。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Claude 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
推荐路径:在 claude.ai web 上工作,无需触碰任何配置文件。
- 在 Claude 中打开 Customize → Connectors。
- 点击 +,然后点击 Add custom connector。
- 输入名称(例如
Rollbar)和远程 MCP 服务器 URLhttps://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID,然后点击 Add。 - 点击 Connect,登录 AnythingMCP(OAuth)并允许访问。
下面所有工具都会出现在你的聊天中,开始输入提示。
可用工具
| Tool | What it does |
|---|---|
rollbar_list_items | List or search items (grouped errors and messages), 100 per page: id, counter, title, level, status, environment, framework, total… |
rollbar_get_item | Get one item by its id: title, level, status, environment, platform, framework, counter, total occurrences, first and last occurrence (with… |
rollbar_get_item_by_counter | Find an item by the project counter shown in Rollbar URLs and the UI (#123), or by the UUID of one of its occurrences |
rollbar_update_item | Change an item: resolve it (optionally with the version it was fixed in), mute it or reactivate it, change its level or title, assign it to… |
rollbar_list_item_events | List the history of an item, oldest first: comments, status, level, title and assignment changes, snoozes and merges, each with user and… |
rollbar_add_item_comment | Add a comment to an item's timeline, attributed to the token's user |
rollbar_list_occurrences | List the project's latest occurrences (single error events), newest first: occurrence id, item id, timestamp, code version and the payload… |
rollbar_list_item_occurrences | List the occurrences of one item, newest first, with timestamp, code version and payload (exception, stack trace, request, person) |
rollbar_get_occurrence | Get one occurrence with its full payload, as the Raw JSON view in Rollbar: exception class and message, stack trace frames, request… |
rollbar_get_top_active_items | Get the items with the most occurrences in the last hours (like the Top 10 on the project dashboard), each with its hourly occurrence counts |
rollbar_get_occurrence_counts | Get the recent number of occurrences per minute, hour or day as [timestamp, count] pairs (the Hourly and Daily Error/Critical Occurrences… |
rollbar_get_activated_item_counts | Get the number of new and reactivated items per day as [timestamp, count] pairs (the Daily New/Reactivated Items graph), in the project… |
rollbar_get_item_metrics | Get metrics for a list of items of one project: occurrence counts and the time of the first and last occurrence of each |
rollbar_query_occurrence_metrics | Query occurrence metrics over time with filters, grouping and aggregates (count_all, count_distinct, topk and more), e.g. occurrences per… |
rollbar_get_resolution_time_metrics | Get the time to resolve items over a window (median by default, or mean, min, max), per period, filtered by environments, levels and… |
rollbar_list_deploys | List the project's deploys, most recent first: id, environment, revision, status, user, comment and start and finish times |
rollbar_get_deploy | Get one deploy: environment, revision, status, user, comment and start and finish times |
rollbar_report_deploy | Record a deploy of a revision to an environment, so new errors can be linked to it |
rollbar_update_deploy | Finish a deploy reported as started: set its status to succeeded, failed or timed_out, with an optional comment |
rollbar_list_environments | List the environments of the project (production, staging and so on) with their ids, 20 per page |
rollbar_get_version | Get what happened in one code version in one environment: when it was first and last seen, and the number of new, reactivated, repeated and… |
rollbar_list_version_items | List the items of one code version in one environment by what happened in it: new (first seen in this version), repeated, reactivated or… |
rollbar_create_rql_job | Start an RQL query (Rollbar's SQL-like query language over items and occurrences), e.g. `SELECT item.counter, count(*) FROM item_occurrence… |
rollbar_get_rql_job | Check an RQL job: status (new, running, success, failed, cancelled, timed_out), query and times |
rollbar_get_rql_job_result | Get the result of a finished RQL job: column names (selectionColumns) and rows, plus any errors and warnings |
rollbar_list_rql_jobs | List earlier RQL jobs with their query, status and times, newest first |
rollbar_cancel_rql_job | Cancel an RQL job that is still new or running, e.g. a slow query that was started by mistake |
rollbar_list_projects | List the projects of the account: id, name, status and creation date |
rollbar_get_project | Get one project: id, name, account, status, time zone and grouping settings, and creation date (integration settings are left out) |
rollbar_list_users | List the users of the account (id, username, email), optionally only the one with an email address |
rollbar_get_user | Get one user of the account: id, username, email and whether email notifications are on |
rollbar_list_teams | List the teams of the account with id, name and access level (owner, standard, light, view) |
rollbar_request_person_deletion | Erase a tracked person (the end user attached to occurrences) from every project of the account, by exactly one of email, username or id… |
rollbar_get_person_deletion_status | Check a person deletion job: state (new, running, paused, success, cancelled or failed) |
示例提示
- “过去 24 小时 production 中最多的错误有哪些?其中哪些是新出现的?”
- “给我看 Rollbar 条目 #482 最近一次事件的完整堆栈跟踪。”
- “哪些条目是在 production 的 3f9c2ab 版本中首次出现的?按级别分组。”
- “把 TimeoutError 条目标记为在 1.8.3 版本中已解决,并把 NullPointerException 分配给后端团队。”
- “本周每天的 error 和 critical 事件数是多少?和上周相比如何?”
FAQ
Claude Code 和 Claude Desktop 一样工作吗? 是的,两者都指向 https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。
下一步
这份指南对你有帮助吗?