blacksmith-usage-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@blacksmith-usage-mcp show my CI costs for this month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
blacksmith-usage-mcp
A local MCP server that exposes Blacksmith.sh's usage & cost data, which Blacksmith does not officially publish as an API. It lets you pull CI spend into agents, alerts, dashboards, or scheduled reports instead of eyeballing the web UI.
Unofficial / unaffiliated. It replays your own authenticated dashboard session against Blacksmith's private backend. Endpoints may change without notice.
What it gives you
Read-only tools over the metrics the dashboard itself uses:
Tool | Returns |
| session identity (auth check) |
| your GitHub orgs/installations |
| jobs, minutes, $ cost for a month |
| per-day jobs / minutes / cost |
| cost per repository |
| cost per runner type |
| Docker-cache storage $ + GB-hours (often the biggest line item) |
| daily cache footprint (GB held) — the growth curve; spots an unbounded cache |
| billable vs included-free minutes |
| live vCPU/jobs right now |
| usage over time |
| one-shot month report (totals + free-tier headroom + top repos/runners) |
| month-over-month compute vs sticky-disk cost (last N months) |
Every tool takes an optional month ("YYYY-MM", default current) and org
(defaults to $BLACKSMITH_ORG).
Example
Ask your agent "what's my Blacksmith spend this month?" and
blacksmith_cost_overview returns:
{
"org": "your-org",
"month": "2026-06",
"compute_cost_usd": 2.13,
"sticky_disk_cost_usd": 15.47,
"total_cost_usd": 17.6,
"total_jobs": 141,
"billable_minutes": 1064,
"free_minutes": 3000,
"free_tier_remaining_minutes": 1936,
"cost_by_repo": [{ "repo_name": "your-org/app", "cost": 2.13, "runtime_minutes": 267 }],
"cost_by_runner": [{ "runner_type": "blacksmith-4vcpu-ubuntu-2404", "cost": 2.12, "runtime_minutes": 265 }]
}Note how sticky-disk (Docker cache) storage can dwarf compute — it's frequently the largest single line item, and the one most worth alerting on.
Related MCP server: cloudscope-mcp
How auth works
Blacksmith's dashboard (app.blacksmith.sh) talks to a Laravel backend at
dashboardbackend.blacksmith.sh/api. There is no public API key or bearer
token — auth is a stateful session cookie (blacksmith_session, httponly,
~14-day rolling). GitHub OAuth only bootstraps that cookie, and the
code → session exchange uses Blacksmith's server-side client secret, so the
OAuth flow can't be replayed headlessly.
So the model is: sign in once via GitHub, harvest the cookie, replay it. Two non-obvious details this server handles for you:
The backend is Laravel Sanctum (stateful), so every request sends
Origin: https://app.blacksmith.sh. Without that header the cookie is rejected with a 401.The server rotates the session cookie on every response; the client persists the fresh value back to storage, so the session stays alive as long as it's used within ~14 days. The durable
remember_web_*cookie is harvested too.
Setup
git clone https://github.com/dholliday3/blacksmith-usage-mcp.git
cd blacksmith-usage-mcp
pnpm install # or: npm install
pnpm exec playwright install chromium # one-time, for the login helper
pnpm login # opens a browser; sign in with GitHub
pnpm check # prints a cost overview — confirms it workspnpm login uses a persistent browser profile under .auth/ (gitignored) so
your GitHub session sticks around and future refreshes usually skip 2FA. Re-run
pnpm login whenever a tool returns a "session expired" error (~every 14 days
if unused).
Set your org once so you can omit it from every call:
export BLACKSMITH_ORG=your-github-org-slug # find it via `blacksmith_list_orgs`Register with an MCP client
Claude Code:
claude mcp add blacksmith-usage -s user -- pnpm --dir /abs/path/to/blacksmith-usage-mcp startGeneric mcp.json:
{
"mcpServers": {
"blacksmith-usage": {
"command": "pnpm",
"args": ["--dir", "/abs/path/to/blacksmith-usage-mcp", "start"],
"env": { "BLACKSMITH_ORG": "your-github-org-slug" }
}
}
}Where the session is stored
In priority order:
$BLACKSMITH_SESSION_JSON— full session JSON inline. Handy for CI / headless, where you inject a cookie harvested elsewhere.macOS Keychain (
security, serviceblacksmith-session-cookie) — default on macOS.A
0600file at$BLACKSMITH_SESSION_FILE, or${XDG_CONFIG_HOME:-~/.config}/blacksmith-usage-mcp/session.json— default on Linux/Windows, or whenever$BLACKSMITH_SESSION_FILEis set.
The cookie is a live credential to your Blacksmith account and is never
written into the repo. .gitignore blocks .auth/ and any stray
.session.json.
Notes
Read-only by design — no tool mutates Blacksmith state. (Writes would require sending the
X-XSRF-TOKENheader, which this client deliberately never does.)Schemas use
.passthrough(), so if Blacksmith adds fields they surface rather than break parsing.Requires Node ≥ 20 (uses
fetch+Headers.getSetCookie).
Cost model
docs/blacksmith-cost-model.md explains how Blacksmith bills (compute vs. the two caches), how to run jobs with $0 caching cost, and the unbounded-Docker-cache footgun that makes bills balloon — with citations to Blacksmith's docs and a recording date (pricing can change).
Blacksmith's own LLM docs
Handy to feed an agent alongside this server (product docs, not the usage API):
License
MIT — see LICENSE.
Available Tools
13 toolsblacksmith_cost_by_repoC
Cost broken down by repository for a month.
Inputs: org, month.
blacksmith_cost_by_runnerA
Cost broken down by runner type (e.g. blacksmith-4vcpu-ubuntu-2404) for a month.
Inputs: org, month.
blacksmith_cost_dailyB
Per-day breakdown of jobs, minutes, and cost for a month.
Inputs: org, month.
blacksmith_cost_overviewA
One-shot cost report for a month: totals, free-tier headroom, sticky-disk, and the top repos + runner types by cost.
Inputs: org, month.
blacksmith_cost_summaryB
Headline cost for a month: total jobs, billable minutes, and dollar cost.
Inputs: org, month.
blacksmith_cost_trendA
Month-over-month compute vs sticky-disk cost for the last N months — spots accumulating cache cost vs one-off compute spikes.
Inputs: org, months.
blacksmith_current_vcpuA
Live vCPU/job usage right now, by architecture (null when idle).
Inputs: org.
blacksmith_list_orgsA
List GitHub orgs/installations available to the session.
Inputs: no named parameters.
blacksmith_monthly_usageB
Billable vs included-free minutes for a month (free-tier headroom).
Inputs: org, month.
blacksmith_sticky_disk_costB
Sticky-disk (Docker cache) storage cost and GB-hours for a month. Often the largest line item.
Inputs: org, month.
blacksmith_sticky_disk_dailyA
Daily sticky-disk / Docker-layer-cache footprint (GB held each day) for a month — the cache growth curve. Steadily-climbing totals mean an unbounded cache (set max-cache-size-mb on setup-docker-builder); a flat line means a stable working set.
Inputs: org, month.
blacksmith_vcpu_timeseriesC
vCPU/job usage time series for a month (windowed). Large payload.
Inputs: org, month, window_size.
blacksmith_whoamiA
Who the stored Blacksmith session belongs to (verifies auth is live).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools have a clear, distinct purpose (e.g., cost_daily vs cost_by_repo vs cost_by_runner). However, cost_summary and cost_overview overlap in providing headline totals, which could cause an agent to pick the wrong one for a simple total-cost query.
The blacksmith_ prefix is consistent, and most names follow a <domain>_<granularity> pattern (cost_summary, cost_daily, vcpu_timeseries). Minor deviations exist: list_orgs uses a verb while others are noun phrases, and whoami is a standalone command, but the overall pattern is predictable.
13 tools is well-scoped for a usage/cost monitoring server. Each tool covers a distinct reporting dimension (summary, daily, by repo, by runner, sticky disk, live usage, trends) without redundancy or bloat.
The surface covers the full lifecycle of Blacksmith usage reporting: auth, orgs, compute cost, free-tier allowance, live vCPU, sticky-disk cost and growth, and month-over-month trends. There are no obvious dead ends or critical missing operations for the stated purpose.
Maintenance
Related MCP Connectors
Hosted MCP server for AWS cloud spend: service breakdowns, anomalies, savings and forecasts.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Analytics for MCP servers. Query your tool calls, first-call success, retries and schema cost.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceMCP Server to fetch costs and usage data from your Vantage account.167 npm86MIT- AlicenseAqualityCmaintenanceCloud cost management MCP server for Azure. Ask your AI about your cloud bill.15149 npm1MIT
- AlicenseAqualityBmaintenanceLocal-first FinOps MCP server. Ask about your AWS, Azure, GCP, and SaaS costs in plain English. Anomaly detection, rightsizing, idle-resource cleanup, and Jira/Linear ticketing. Credentials never leave your machine.1020Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server that reads local OpenClaw session files to provide token usage and cost data without any network calls or authentication.MIT