blacksmith-mcp

blacksmith-mcp

Enables interaction with Blacksmith CI analytics to query workflow runs, jobs, test results, and usage metrics. It provides detailed access to CI/CD data including job logs and billing information directly through Claude.

Category
访问服务器

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:

# Add to Claude Code
claude 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

claude mcp add blacksmith -- npx blacksmith-mcp

Option 2: Project Configuration

Add to your .mcp.json:

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

Option 3: Global Install

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

Variable Required Description
BLACKSMITH_ORG Yes Your Blacksmith organization name
BLACKSMITH_SESSION_COOKIE No Session cookie (auto-extracted from Chrome if not set)

Available Tools

Workflow Runs

Tool Description
list_runs List workflow runs with filters (status, branch, workflow, actor, PR)
get_run Get run details including all jobs
list_jobs List jobs for a workflow run
get_job Get job details (steps, timing, runner info)
get_job_logs Get raw log output for a job

Test Analytics

Tool Description
get_job_tests Get all test results for a job
get_failed_tests Get failed tests with full error messages
get_failures_by_pattern Group failures by error pattern (e.g., "Cannot read properties")
compare_test_runs Compare failures between two runs (find regressions)
get_flaky_tests Detect tests that fail intermittently
get_slow_tests Find tests exceeding duration threshold
get_test_history Track a specific test's pass/fail history
get_trends Analyze trends: duration, failure rate, test count

Usage & Billing

Tool Description
get_current_usage Current core usage (active vs max)
get_invoice_amount Current billing period amount
get_usage_summary Billable minutes vs free tier
get_cache_stats Cache size, entries by repository
get_cache_entries Detailed cache entries for a repo

Organization

Tool Description
list_orgs List accessible organizations
get_org_status Org status (personal, onboarded, region)
search_logs Search 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:

Test Flake Rate Pattern
should handle concurrent requests 40% (4/10 runs) Fails on CI, passes locally
renders loading state 20% (2/10 runs) Race condition with setTimeout
validates auth token 30% (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

# Install dependencies
pnpm install

# Build
pnpm build

# Development mode (watch)
pnpm dev

# Test with MCP Inspector
npx @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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选