Borrowing it
Nothing to install: this file belongs to scottlz0310/mcp-resource-subscriber. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/scottlz0310/mcp-resource-subscriber/main/AGENTS.mdgit clone --depth 1 https://github.com/scottlz0310/mcp-resource-subscriberWrote 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/scottlz0310/mcp-resource-subscriber/agents-md)<a href="https://agentmods.dev/instructions/scottlz0310/mcp-resource-subscriber/agents-md"><img src="https://agentmods.dev/badge/instructions/scottlz0310/mcp-resource-subscriber/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.
<a href="https://agentmods.dev/instructions/scottlz0310/mcp-resource-subscriber/agents-md"><img src="https://agentmods.dev/badge/instructions/scottlz0310/mcp-resource-subscriber/agents-md.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.05126 | $0.05126 |
| Opus 5 | $0.02563 | $0.02563 |
| Sonnet 5 | $0.01025 | $0.01025 |
| Haiku 4.5 | $0.00513 | $0.00513 |
Grade A, and why
mcp-resource-subscriber 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 8d 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 — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
プロジェクトの目的
本リポジトリは、MCP resources/subscribe の互換性検証スパイクとして開始した。CLI AI エージェント(Codex, Gemini, Claude Code, Crush 等)が MCP resource subscription を正しく処理できるかを、再現可能な形でテストするためのものである。この検証フェーズは既に完了しており、現在は以下の 2 つの実運用向けコンポーネントを提供する:
- CLI probe(
mcp-resource-subscriber、src/client/cli.ts)— CLI エージェントのワークフローや外部ツール(例:squirrel-notifier)が、MCP resource を subscribe してnotifications/resources/updatedを待ち、結果を構造化された stdout/JSON として報告させるために呼び出す、公開済みのサブプロセス。protocol revision は2026-07-28に pin しており、legacy へフォールバックしない(#162)。mcp-gateway 向け認証(--login/--logout、キャッシュ済みトークンの自動更新)も担い、これらの呼び出し元がトークンを手動で用意する必要をなくす。callサブコマンド(--tool/--args)は、subscribe とは別に任意の MCP tool を単発tools/call呼び出しして即終了するモードで、同じ認証経路を再利用する(#111)。 - リファレンス MCP Streamable HTTP サーバー(
src/server/)— stateless(legacy: "reject")。1 つの resource(test://review/status)を公開し、subscriptions/listenの stream 開通を起点に更新をシミュレートして、その stream へnotifications/resources/updatedを配信する。probe クライアントのローカル / Docker テスト用に維持されており、本番トラフィック向けではない。
必須コマンド
pnpm install --frozen-lockfile # 依存関係のインストール
pnpm run build # tsc コンパイル → dist/
pnpm test # vitest run(in-process サーバーに対するテスト、Docker 不要)
pnpm run test:coverage # vitest run --coverage
pnpm run typecheck # tsc --noEmit(出力ファイルなし)
pnpm run check # biome check .(lint + フォーマットチェック)
pnpm run format # biome format --write .
pnpm run dev # tsx でサーバーをローカル実行(ビルド不要)
pnpm run start # コンパイル済み dist/ からサーバーを実行(本番エントリ)
pnpm run probe:subscribe -- --url http://127.0.0.1:8089/mcp # 稼働中サーバーに対して probe クライアントを実行
docker compose up --build # ポート 8089 でリファレンスサーバーを起動
Node 要件: >=26.4.0(package.json の engines と CI で強制)。
パッケージマネージャ: [email protected](packageManager で固定。pnpm-lock.yaml が唯一の lockfile)。
アーキテクチャ
src/
server/
index.ts — エントリポイント: 環境設定を読み込み、Express HTTP サーバーを起動
config.ts — TestConfig 型 + configFromEnv()(全環境変数をここでパース)
httpServer.ts — createMcpHttpApp(): createMcpHandler(legacy: "reject")+ toNodeHandler を Express にマウントし、{ app, close } を返す。resource の状態と更新シミュレーションは McpServer がリクエストごとに作り直されるためここ(アプリスコープ)に置く。InMemoryServerEventBus をラップした自前 bus を渡し、listen stream の開閉を観測して更新タイマーを張る
mcpServer.ts — createProbeServer(): MCP ハンドラを登録(list/read + tool)。2026-07-28 に resources/subscribe RPC は無く、通知配信は handler.notify.resourceUpdated() が担う
resourceState.ts — ReviewStatusStore(in-memory、version 1→2)、renderReviewStatus()、定数
logger.ts — createConsoleLogger(config): logLevel が 'silent' でない限り全行を出力する LogSink を返す(レベル階層フィルタなし)
client/
probeClient.ts — runSubscribeProbe(): 全フローを実行し型付き結果を返す SDK クライアント(subscriptions/listen → ack 検証 → 通知待機 → 再 read → stream close)
protocolNegotiation.ts — protocol revision を 2026-07-28 に pin する Client オプションと connectPinned()。negotiation 失敗を ProtocolNegotiationError に正規化する(ネットワーク起因は素通し)
callClient.ts — runToolCall(): call サブコマンド用、単発 tools/call を実行し型付き結果を返す SDK クライアント
callJsonOutput.ts — call サブコマンドの --json 出力スキーマ(CallJsonOutput)
cli.ts — 公開 bin エントリ; --url, --uri, --auth-token, --login, --logout, --skip-resource-list-check, --timeout-ms に加え `call` サブコマンド(--tool, --args)をサポート
auth/
tokenStore.ts — node:sqlite トークンキャッシュ(gateway origin 単位で 1 行、OS state dir、0600); withExclusiveLock() は任意の timeoutMs を受け取り、BEGIN IMMEDIATE の同期的な待機がそれを超えないよう busy_timeout を一時的に下げる(LockTimeoutError を送出)
oauthClient.ts — RFC 8414 discovery / RFC 7591 DCR / RFC 8628 device flow / refresh grant(fetch + sleep を注入可能)
gatewayAuth.ts — loginToGateway() と resolveCachedToken()(rotation 永続化を伴う自動 refresh)
scripts/
subscribe-client.ts — CLI 引数で runSubscribeProbe() を呼び出し、結果を表示する薄いラッパー
test/
mcp-resource-subscribe.test.ts — vitest 統合テスト(ポート 0 で in-process サーバーを起動)
cli.test.ts — CLI サブプロセステスト: --json モード、不正な引数、exit code
e2e.test.ts — 外部 copilot-review-mcp サーバーに対する E2E テスト(環境変数が必要)
tokenStore.test.ts — 一時 SQLite ファイルに対するトークンキャッシュ CRUD; withExclusiveLock() のロック挙動
oauthClient.test.ts — in-process モック認可サーバーに対する device flow / refresh
gatewayAuth.test.ts — login + キャッシュ済みトークン解決(refresh, rotation, re-login エラー, AUTH_TIMEOUT)
cliAuth.test.ts — CLI サブプロセス認証統合(--login, --logout, キャッシュ優先順位, AUTH_LOGIN_REQUIRED, AUTH_TIMEOUT)
call.test.ts — call サブコマンドの CLI サブプロセステスト(引数パース、成功、tool エラー、認証エラー、通信エラー、exit code 0/1/2/3)
helpers/mockAuthServer.ts — mcp-gateway の OAuth surface を模した express モック
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.
- 8d ago First seen · 165 lines · 5,126 tokens per session scan A b74c83d0a3f4
mcp-resource-subscriber AGENTS.md is an instructions file published in the GitHub repository scottlz0310/mcp-resource-subscriber (0 stars, last pushed 4d ago), licensed MIT. It adds 5,126 tokens to every session, about $0.0256 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
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
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).
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).
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.
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.