Blacksmith

io.github.grahamnotgrant由 GitHub 帳號 grahamnotgrant 發布v0.1.1更新於 Oct 24, 2026

MCP server for Blacksmith CI - query runs, analyze test failures, detect flaky tests.

概覽

AI 產生的概覽

讓助理查詢 Blacksmith CI 的工作流程執行、分析測試失敗、偵測不穩定測試,並查看用量與帳單。

可以做什麼
透過一組工具把助理連接到 Blacksmith CI 資料,可列出並檢視工作流程執行、作業與作業日誌。測試分析工具會回傳失敗測試、依錯誤模式分組的失敗、兩次執行之間的比較、不穩定與耗時過長的測試、單一測試的歷史紀錄以及趨勢。另有工具回報核心用量、帳單金額、用量摘要、快取統計與快取項目,以及組織清單、組織狀態和跨作業日誌搜尋。
適用情境
適合團隊在 Blacksmith 上執行 CI 時使用:以對話方式排查失敗的執行、找出不穩定或過慢的測試、比較拉取請求與基準分支的失敗差異,或查看用量與快取佔用,而不必在多個儀表板之間來回點選。
執行需求
以 stdio 方式在本機執行,通常透過 npx blacksmith-mcp 啟動,因此需要 Node.js。需要設定 BLACKSMITH_ORG 環境變數。身分驗證可自動從 macOS 上的 Chrome 擷取工作階段 cookie,也可手動設定 BLACKSMITH_SESSION_COOKIE 環境變數。需要連線至 Blacksmith API 的網路。
安裝前請注意
此伺服器會讀取已登入的 Blacksmith 工作階段:預設從 Chrome 擷取工作階段 cookie,而 BLACKSMITH_SESSION_COOKIE 變數保存的是可存取帳戶的憑證。它依賴 Blacksmith 未公開的內部 Web API,該 API 由網頁應用程式逆向得出,可能隨時變更。工具以讀取為主,但會暴露用量與帳單資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Blacksmith,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Blacksmith MCP

[npm version] [License: MIT] [MCP]

An MCP server that connects Claude to your Blacksmith CI data. Query workflow runs, analyze test failures, detect flaky tests, and monitor usage—all through natural conversation.

Why?

Debugging CI failures usually means clicking through dashboards, copying run IDs, and piecing together information across multiple pages. With this MCP, you can just ask:

  • "Why did the last CI run fail?"
  • "Which tests are flaky this week?"
  • "Compare test failures between main and my PR"
  • "What's using the most cache storage?"

Claude handles the API calls and gives you actionable insights.

Quick Start

Zero-config if you're logged into Blacksmith in Chrome:

bash
# Add to Claude Codeclaude mcp add blacksmith -- npx blacksmith-mcp
# Set your org (run once)export BLACKSMITH_ORG="your-org-name"

The MCP automatically extracts your session from Chrome cookies. No manual token copying needed.

Installation

Option 1: Claude Code CLI

bash
claude mcp add blacksmith -- npx blacksmith-mcp

Option 2: Project Configuration

Add to your .mcp.json:

json
{  "mcpServers": {    "blacksmith": {      "type": "stdio",      "command": "npx",      "args": ["blacksmith-mcp"],      "env": {        "BLACKSMITH_ORG": "your-org-name"      }    }  }}

Option 3: Global Install

bash
npm install -g blacksmith-mcp

Configuration

Authentication

Automatic (recommended): Log into app.blacksmith.sh in Chrome. The MCP extracts your session cookie automatically.

Manual: Set BLACKSMITH_SESSION_COOKIE environment variable with your session cookie value.

Environment Variables

VariableRequiredDescription
BLACKSMITH_ORGYesYour Blacksmith organization name
BLACKSMITH_SESSION_COOKIENoSession cookie (auto-extracted from Chrome if not set)

Available Tools

Workflow Runs

ToolDescription
list_runsList workflow runs with filters (status, branch, workflow, actor, PR)
get_runGet run details including all jobs
list_jobsList jobs for a workflow run
get_jobGet job details (steps, timing, runner info)
get_job_logsGet raw log output for a job

Test Analytics

ToolDescription
get_job_testsGet all test results for a job
get_failed_testsGet failed tests with full error messages
get_failures_by_patternGroup failures by error pattern (e.g., "Cannot read properties")
compare_test_runsCompare failures between two runs (find regressions)
get_flaky_testsDetect tests that fail intermittently
get_slow_testsFind tests exceeding duration threshold
get_test_historyTrack a specific test's pass/fail history
get_trendsAnalyze trends: duration, failure rate, test count

Usage & Billing

ToolDescription
get_current_usageCurrent core usage (active vs max)
get_invoice_amountCurrent billing period amount
get_usage_summaryBillable minutes vs free tier
get_cache_statsCache size, entries by repository
get_cache_entriesDetailed cache entries for a repo

Organization

ToolDescription
list_orgsList accessible organizations
get_org_statusOrg status (personal, onboarded, region)
search_logsSearch logs across all jobs

Example Conversations

Debug a Failed Run

You: Why did the last CI run fail?

Claude: Uses list_runs(status="failure", limit=1) then get_failed_tests

The last run failed with 34 test failures. The main issues are:

  • Connection timeout (12 tests) - Tests in api/ are timing out connecting to the test database
  • Undefined property (8 tests) - user.settings.theme is undefined in the new dark mode code
  • Assertion failures (14 tests) - Snapshot mismatches in UI components

Find Flaky Tests

You: Which tests are flaky?

Claude: Uses get_flaky_tests(days=7, min_runs=5)

Found 3 flaky tests:

TestFlake RatePattern
should handle concurrent requests40% (4/10 runs)Fails on CI, passes locally
renders loading state20% (2/10 runs)Race condition with setTimeout
validates auth token30% (3/10 runs)Intermittent network timeout

Compare Branches

You: Did my PR introduce new test failures?

Claude: Uses compare_test_runs with PR run vs base branch

Your PR introduced 2 new failures:

  • UserProfile.test.tsx: "Cannot read property 'avatar' of undefined"
  • api/users.test.ts: Expected 200, got 404

5 previously failing tests now pass (nice!).

Development

bash
# Install dependenciespnpm install
# Buildpnpm build
# Development mode (watch)pnpm dev
# Test with MCP Inspectornpx @modelcontextprotocol/inspector node dist/index.js

Troubleshooting

Session Expired

If you see SESSION_EXPIRED, your Blacksmith session has expired. Simply log back into app.blacksmith.sh in Chrome and retry.

Cookie Extraction Failed

The automatic cookie extraction requires:

  • macOS with Chrome installed
  • Being logged into Blacksmith in Chrome
  • Chrome not running with a locked profile

If it fails, set BLACKSMITH_SESSION_COOKIE manually.

No Organization Set

Run list_orgs to see available organizations, then set BLACKSMITH_ORG to your org name.

API Notes

This MCP uses Blacksmith's internal web API, which is undocumented. The API was reverse-engineered from the Blacksmith web app and may change without notice.

License

MIT

Contributing

Contributions welcome! Please open an issue first to discuss proposed changes.

來源:README.md,提交 f9ea93d

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分