Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/dholliday3/blacksmith-usage-mcp/agents-mdgit clone --depth 1 https://github.com/dholliday3/blacksmith-usage-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/dholliday3/blacksmith-usage-mcp/agents-md)<a href="https://agentmods.dev/instructions/dholliday3/blacksmith-usage-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/dholliday3/blacksmith-usage-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01170 | $0.01170 |
| Opus 5 | $0.00585 | $0.00585 |
| Sonnet 5 | $0.00234 | $0.00234 |
| Haiku 4.5 | $0.00117 | $0.00117 |
Grade A, and why
blacksmith-usage-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for AI agents (and humans) working on this codebase. End-user docs live in README.md — read it first for what the tool does and how auth works. This file is about contributing without breaking the things that are easy to break.
What this is
A small, single-purpose MCP server that replays a reverse-engineered Blacksmith dashboard session to expose CI usage & cost data as read-only MCP tools. It is unofficial: every endpoint was captured by observing the real dashboard, not from a published spec. Treat the API as something that can change under you.
Architecture (where things live)
src/
index.ts MCP server: registers tools, resolves org, formats output.
client.ts HTTP client (auth headers, cookie rotation) + route builders + monthRange().
types.ts Zod schemas for every response. Verified against live data 2026-06-04.
auth.ts Session storage abstraction (env JSON / macOS Keychain / 0600 file).
login.ts One-time Playwright GitHub login that harvests the cookie.
check.ts CLI smoke test — exercises the real client and prints a cost report.
Data flow: a tool in index.ts → client.get(routes.X(...), schema.parse) →
client.ts attaches the cookie + mandatory Origin header, fetches, persists
any rotated cookie, and returns parsed JSON.
Invariants — do not break these
- The
Origin: https://app.blacksmith.shheader is mandatory. The backend is Laravel Sanctum (stateful); the session cookie is rejected with401without it. Verified. Don't "clean up" the headers inclient.ts. - Read-only by design. No tool may mutate Blacksmith state. Writes would
need the
X-XSRF-TOKENheader, which the client deliberately never sends. Adding a write tool is a real product decision, not a casual change — surface it explicitly, don't sneak it in. - The session cookie is a live credential. Never log it, print it, commit it,
or write it into the repo. It lives only in Keychain / a
0600file / an env var..gitignoreblocks.auth/and.session.json— keep it that way. If you add debug logging, make sure it can't echoCookie/Set-Cookie. - This is a public repo — keep it account-agnostic. No hardcoded org
(
BLACKSMITH_ORG/ explicit arg only), no personal paths, emails, real org names, or real dollar figures in code or docs. There's a CI-free grep worth running before committing:grep -rniE "/Users/|<your-handle>|<your-org>" src. - Schemas stay
.passthrough(). Endpoints are unofficial; new fields should surface, not throw. Don't tighten to.strict(). - Node ≥ 20. The client relies on global
fetchandHeaders.getSetCookie(). Don't add a fetch polyfill or drop the engines floor.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 90 lines · 1,170 tokens per session scan A e7fbc21333f2
blacksmith-usage-mcp AGENTS.md is an instructions file published in the GitHub repository dholliday3/blacksmith-usage-mcp (1 stars, last pushed 3mo ago), licensed MIT. It adds 1,170 tokens to every session, about $0.0059 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.