search-docs

search-docs is a command for Claude Code from KaelSensei/MagicAIBuilder. It costs 0 tokens per session (1,544 once invoked), scanned A, original, MIT.

A command that searches a project’s documentation through an MCP server, a connected service that lets tools provide information to the agent.

In plain words
What is it for?
Use it to find relevant excerpts and links in project docs using the MCP server configured in .cursor/mcp.json.
Why use it?
It reduces the need to search README files and documentation folders manually when looking for project-specific guidance.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: installed under .agents/ (shared by several agents); mentions Cursor.

Good fit Use it to find relevant excerpts and links in project docs using…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kaelsensei/magicaibuilder/search-docs
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.

Clone the repo
git clone --depth 1 https://github.com/KaelSensei/MagicAIBuilder

Made for: Claude Code.

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 search-docs

README.md
[![agentmods](https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/search-docs.svg)](https://agentmods.dev/commands/kaelsensei/magicaibuilder/search-docs)
Your own site
<a href="https://agentmods.dev/commands/kaelsensei/magicaibuilder/search-docs"><img src="https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/search-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,544 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01544
Opus 5 $0.00000 $0.00772
Sonnet 5 $0.00000 $0.00309
Haiku 4.5 $0.00000 $0.00154

Measured 6d ago against content hash 3b41a1757595, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

search-docs 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 6d 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/commands/search-docs.md · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

search-docs Command – Search Project Documentation via MCP

When /search-docs <query> is invoked, automatically search the project documentation using the MCP server configured in .cursor/mcp.json (e.g. the context7 server) and present the most relevant excerpts and links.


Step 1: Load Project Context & Rules

  1. Assume the project root as the working directory
  2. Load and strictly follow ALL Cursor rules from .cursor/rules/*.mdc:
    • security.mdc – Security requirements (no leaking secrets, tokens, or private data)
    • technical-stack.mdc – React Native/SQLite and tooling conventions
    • documentation.mdc – Documentation update requirements
    • version-management.mdc – Git commit/push workflow
    • general-principles.mdc – Project philosophy and quality bar
  3. Read high‑level docs to understand the documentation layout:
    • README.md
    • docs/ (especially docs/installation/, docs/architecture/, docs/development/, docs/troubleshooting/)
    • PROGRESS.md for current feature set
  4. Read .cursor/mcp.json to discover available MCP servers (e.g. "context7") and their URLs/headers
  5. Identify the current Git branch and assume it is a utility/feature branch, not main

Step 2: Parse the Search Request

  1. Parse the natural‑language query after /search-docs (e.g. /search-docs how to build release apk)
  2. Normalize and expand the query with project context when useful, for example:
    • Map “release build” → ANDROID_CONFIG, PLAY_STORE_DEPLOYMENT, RUN_ON_ANDROID
    • Map “life counter” → docs/feature/feature-mtg-life-counter.md
    • Map “local deck builder” → docs/feature/feature-local-deck-builder.md
  3. If the query is ambiguous (e.g. “install”), briefly infer likely intents (Android, iOS, dev env) instead of asking the user to rephrase; you can run multiple focused searches

Step 3: Discover & Use MCP Documentation Tools

  1. Use the MCP configuration from .cursor/mcp.json (e.g. the context7 HTTP server) and follow its own docs:
    • Always read the MCP tool descriptors in mcps/<server>/tools/*.json before calling a tool
    • Respect any rate limits or usage guidelines documented there
  2. Prefer semantic / full‑text search tools exposed by the MCP server for documentation lookups, for example:
    • searchDocs or similar tools that index docs/**, README.md, PROGRESS.md, etc.
    • If there is a dedicated “documentation” or “knowledge base” tool, use it first
  3. When no suitable MCP search tool exists, fall back to local codebase search tools:
    • Grep for keyword search across docs/** and .md files
    • SemanticSearch when you need concept‑level matches (e.g. “how does local deck builder persist data?”)
  4. Never send secrets, environment files, or private user data to external MCP servers

Read the full file on GitHub · 126 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. 6d ago First seen · 126 lines · 0 tokens per session scan A 3b41a1757595

Subscribe to this mod's changes

search-docs is a command published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,544 tokens. 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.