blacksmith-usage-mcp 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

Install

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.

agentmods
npx agentmods add instructions/dholliday3/blacksmith-usage-mcp/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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.01170 $0.01170
Opus 5 $0.00585 $0.00585
Sonnet 5 $0.00234 $0.00234
Haiku 4.5 $0.00117 $0.00117

Measured 4d ago against content hash e7fbc21333f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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.tsclient.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. 4d 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 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.

Related

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.

openai/codex · 5,182 tokens

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

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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.

langchain-ai/langchain · 4,469 tokens

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

microsoft/vscode · 5,001 tokens

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.

deepseek-ai/deepseek-harness · 3,733 tokens