blacksmith-usage-mcp: Instructions file for Codex

AGENTS.md

blacksmith-usage-mcp AGENTS.md is an instructions file for Codex, OpenCode from dholliday3/blacksmith-usage-mcp. It costs 1,170 tokens per session, scanned A, original, MIT.

Um conjunto de instruções para agentes de programação que trabalham no repositório blacksmith-usage-mcp. Explica a estrutura do projeto, as decisões importantes e as regras que não devem ser quebradas.

In plain words
What is it for?
Orientar alterações no código, na autenticação, nos esquemas de dados, nas rotas e nas ferramentas de leitura de custos e uso de CI do projeto.
Why use it?
Reduz o risco de alterar acidentalmente partes frágeis de um servidor MCP, uma aplicação que permite a um agente chamar ferramentas externas. Também esclarece que a API usada é não oficial e pode mudar.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is dholliday3/blacksmith-usage-mcp's own configuration. It tells Codex and OpenCode how to work on blacksmith-usage-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything blacksmith-usage-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dholliday3/blacksmith-usage-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dholliday3/blacksmith-usage-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/dholliday3/blacksmith-usage-mcp

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for blacksmith-usage-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dholliday3/blacksmith-usage-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/dholliday3/blacksmith-usage-mcp/agents-md)
Your own site
<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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for blacksmith-usage-mcp AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,170 This file is loaded in full into every session.
When invoked 1,170 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01170 $0.01170
Opus 5.5 $0.00468 $0.00468
Sonnet 5.5 $0.00234 $0.00234
Haiku 4.5 $0.00117 $0.00117

Measured 2mo ago against content hash e7fbc21333f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

AGENTS.md · 90 lines

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

  1. The Origin: https://app.blacksmith.sh header is mandatory. The backend is Laravel Sanctum (stateful); the session cookie is rejected with 401 without it. Verified. Don't "clean up" the headers in client.ts.
  2. Read-only by design. No tool may mutate Blacksmith state. Writes would need the X-XSRF-TOKEN header, 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.
  3. 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 0600 file / an env var. .gitignore blocks .auth/ and .session.json — keep it that way. If you add debug logging, make sure it can't echo Cookie/Set-Cookie.
  4. 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.
  5. Schemas stay .passthrough(). Endpoints are unofficial; new fields should surface, not throw. Don't tighten to .strict().
  6. Node ≥ 20. The client relies on global fetch and Headers.getSetCookie(). Don't add a fetch polyfill or drop the engines floor.

Read the full file on GitHub · 90 lines

Changes

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.

  1. 2mo ago First seen · 90 lines · 1,170 tokens per session scan A e7fbc21333f2

Subscribe to this mod's changes

blacksmith-usage-mcp AGENTS.md is an instructions file published in the GitHub repository dholliday3/blacksmith-usage-mcp (1 stars, last pushed 5mo ago), licensed MIT. It adds 1,170 tokens to every session, about $0.0047 per session on Opus 5.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.

Related

blacksmith-usage-mcp AGENTS.md compared with instructions from other repositories

blacksmith-usage-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
blacksmith-usage-mcp AGENTS.mddholliday3/blacksmith-usage-mcpInstructions file15mo agoMITA1,170Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode