Borrowing it
Nothing to install: this file belongs to MasihMoafi/rag-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.
curl -O https://raw.githubusercontent.com/MasihMoafi/rag-mcp/main/AGENTS.mdgit clone --depth 1 https://github.com/MasihMoafi/rag-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/masihmoafi/rag-mcp/agents-md)<a href="https://agentmods.dev/instructions/masihmoafi/rag-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/masihmoafi/rag-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.
<a href="https://agentmods.dev/instructions/masihmoafi/rag-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/masihmoafi/rag-mcp/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.00621 | $0.00621 |
| Opus 5.5 | $0.00248 | $0.00248 |
| Sonnet 5.5 | $0.00124 | $0.00124 |
| Haiku 4.5 | $0.00062 | $0.00062 |
Grade A, and why
rag-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 today.
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 — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.
rag-mcp agent rules
rag-mcp is a scoped hybrid-search engine for agents and document work,
shipped as the rag command and a stdio MCP server. It indexes locally,
combines BM25 with optional vector retrieval and reranking, and returns
cited passages or a short answer grounded in them.
Thesis
A coding agent should not have to choose between opening files one at a time and dumping a whole repository into context. Scoped, cited search is the middle path: every query names an explicit file, folder or workspace, and the result must identify the source passages it used.
Non-goals
- Unscoped search across a machine or repository.
- A hosted index or a requirement to upload source documents.
- Broad architectural rewrites without an explicit maintainer request.
Start here
- User promises, install paths and configuration:
README.md. - Contribution workflow:
CONTRIBUTING.md. - Verification standard:
docs/VERIFYING.md. - Optional environment variables:
docs/ENVIRONMENT.md. - Evaluation layout and paid-run guardrails:
evals/paidrun.pyandevals/experiments/. - If
.agents/AGENTS.local.mdexists, read it before acting. It is maintainer-local, untracked and must never be committed.
Rules
- Start public branches from
origin/mainunless the task names another reviewed base. - This repository is public. Never commit credentials, private corpora, personal paths, real user indexes, session logs or machine-specific state.
- Every test or experiment that writes rag state must isolate all four
stores:
RAG_MCP_CONFIG,RAG_MCP_DATA_DIR,RAG_MCP_WORKSPACE_DIRandRAG_MCP_TRACE_DIR. - Use one workspace store per concurrent job. Rag intentionally does not wait for another process holding that store's execution lock.
- Do not place an isolated store inside a git-ignored folder of the repository; rag correctly skips git-ignored input there and appears to find no documents.
- Paid or batch provider runs go through
evals/paidrun.py, with its smoke gate, explicit confirmation, spend cap, isolated stores and lock. Never use a real provider key for ordinary offline verification. - Treat
evals/experiments/as evidence. Do not delete, regenerate or re-score recorded runs without preserving their inputs, outputs and provenance. - Do not broadly refactor
rag/core.pyunless the maintainer asks. Interface adapters such asrag/server.py,rag/cli.pyandrag/companion.pystill need small, test-covered changes. - Source files and indexes stay local. Hosted embedding, reranking, contextual retrieval and answer synthesis send only the configured query, chunks or evidence to their providers; document that boundary when changing it.
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.
- today First seen · 60 lines · 621 tokens per session scan A 678b06c52d12
rag-mcp AGENTS.md is an instructions file published in the GitHub repository MasihMoafi/rag-mcp (9 stars, last pushed today), licensed MIT. It adds 621 tokens to every session, about $0.0025 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-12-01.
rag-mcp AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rag-mcp AGENTS.mdMasihMoafi/rag-mcp | Instructions file | 9 | today | MIT | A | 621 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 9,887 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 144k | today | MIT | A | 7,230 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 5,685 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 150k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 3,303 | GitHub Copilot |
| deno copilot-instructions.mddenoland/deno | Instructions file | 109k | yesterday | MIT | A | 3,077 | GitHub Copilot |