{
  "markdown": "# Citadel MCP\n\n[![npm citadel-mcp package](https://img.shields.io/npm/v/citadel-mcp.svg)](https://npmjs.org/package/citadel-mcp)\n\nA Code Mode MCP server that gives AI coding agents curated, per-stack documentation as typed tools.\n\nCitadel is built to be **forked and tailored**. The hosted package ships with a small starter set of stacks, but the real value comes from packaging the docs your agents actually need. Each stack is a tiny module — adding one is mostly mechanical.\n\n## Getting Started\n\n### Requirements\n\n- [Node.js](https://nodejs.org/) v20.19 or a newer [latest maintenance LTS](https://github.com/nodejs/Release#release-schedule) version\n- [npm](https://www.npmjs.com/) or [pnpm](https://pnpm.io/)\n\n### Install with add-mcp\n\nInstall the MCP server for all your coding agents:\n\n```bash\nnpx add-mcp citadel-mcp@latest\n```\n\nAdd `-y` to skip the confirmation prompt and install to all detected agents already in use in the project directory. Add `-g` to install globally across all projects.\n\n### Manual installation\n\nAdd the following config to your MCP client:\n\n```json\n{\n  \"mcpServers\": {\n    \"citadel\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"citadel-mcp@latest\"]\n    }\n  }\n}\n```\n\n> [!NOTE]\n> Using `citadel-mcp@latest` ensures that your MCP client will always use the latest version of the Citadel MCP server.\n\n### MCP Client Configuration\n\n<details>\n<summary>Amp</summary>\n\n**Using Amp CLI:**\n\n```bash\namp mcp add citadel -- npx citadel-mcp@latest\n```\n\n**Or configure manually:**\n\nFollow [Amp's MCP documentation](https://ampcode.com/manual#mcp) and apply the standard configuration shown above.\n\n</details>\n\n<details>\n<summary>Claude Code</summary>\n\nUse the Claude Code CLI to add the Citadel MCP server:\n\n```bash\nclaude mcp add -s user citadel -- npx -y citadel-mcp@latest\n```\n\nUse `-s project` instead of `-s user` to scope the install to the current project. Restart Claude Code, then verify with `claude mcp list`. A working server advertises a single tool named `docs`.\n\n</details>\n\n<details>\n<summary>Codex</summary>\n\n**Using Codex CLI:**\n\n```bash\ncodex mcp add citadel -- npx citadel-mcp@latest\n```\n\n**Or configure manually:**\n\nFollow the MCP setup guide with the standard configuration format:\n- Command: `npx`\n- Arguments: `-y, citadel-mcp@latest`\n\n</details>\n\n<details>\n<summary>Cursor</summary>\n\nGo to `Cursor Settings` -> `MCP` -> `New MCP Server`. Use the JSON config provided above.\n\n</details>\n\n<details>\n<summary>Gemini</summary>\n\n**Using Gemini CLI:**\n\nProject-wide installation:\n```bash\ngemini mcp add citadel npx citadel-mcp@latest\n```\n\nGlobal installation:\n```bash\ngemini mcp add -s user citadel npx citadel-mcp@latest\n```\n\n</details>\n\n<details>\n<summary>VS Code / Copilot</summary>\n\n**Using VS Code CLI:**\n\n```bash\ncode --add-mcp '{\"name\":\"citadel\",\"command\":\"npx\",\"args\":[\"-y\",\"citadel-mcp@latest\"]}'\n```\n\n**Or configure manually:**\n\nFollow the official VS Code MCP server setup guide and add the Citadel server through VS Code settings.\n\n</details>\n\n<details>\n<summary>Warp</summary>\n\nNavigate to `Settings | AI | Manage MCP Servers` and select `+ Add` to register a new MCP server with the following configuration:\n- Name: `citadel`\n- Command: `npx`\n- Arguments: `-y, citadel-mcp@latest`\n\n</details>\n\n## What you get out of the box\n\nThe hosted package includes a starter set of stacks so you can try it immediately:\n\n- Next.js (App Router, Next.js 16)\n- React\n- Turborepo\n- Supabase guides\n\nThis list is intentionally small. **For the best results, fork this repo and add the stacks your agents care about** — your internal libraries, the framework version you actually use, or any docs site that publishes machine-readable markdown. See [docs/adding-a-docs-tool.md](docs/adding-a-docs-tool.md).\n\n## How it works\n\nCitadel is a Code Mode server: instead of advertising one tool per docs source, it advertises a single `docs` tool. The agent writes one `async () => { ... }` per turn that calls `codemode.<stack>_docs(...)` and `codemode.<stack>_index()` directly, and the server runs that code in a local Node sandbox. N doc fetches collapse into one round-trip.\n\nEach stack contributes two callable tools to the sandbox SDK:\n\n- `<stack>_index()` — returns the doc index so the agent can pick a valid path\n- `<stack>_docs({ path })` — fetches that specific doc as markdown\n\nCitadel also exposes a cross-stack ranked search: `codemode.docs_search({ query, stacks?, fetch: true })` returns BM25-ranked matches with markdown content attached in a single call.\n\n## Documentation\n\n- [Using Citadel as an AI agent](src/resources/agent-usage.ts) — playbook for the `docs` tool, served at runtime as MCP resource `citadel://docs/agent-usage`. SDK reference, parallel fan-out, error handling, worked examples.\n- [Adding a docs tool](docs/adding-a-docs-tool.md) — package a new stack as `<stack>_index` + `<stack>_docs`.\n\n## Local Development\n\nTo run the MCP server locally for development:\n\n1. Clone the repository.\n2. Install and build:\n   ```bash\n   pnpm install\n   pnpm build\n   ```\n3. Configure your MCP client to use the local version:\n   ```json\n   {\n     \"mcpServers\": {\n       \"citadel-dev\": {\n         \"command\": \"node\",\n         \"args\": [\"/absolute/path/to/citadel-mcp/dist/index.js\"]\n       }\n     }\n   }\n   ```\n\n   Or with the Claude Code CLI:\n   ```bash\n   claude mcp add -s user citadel-dev -- node /absolute/path/to/citadel-mcp/dist/index.js\n   ```\n\nFor development with auto-reload, point the MCP client at `tsx` and the `src` entry instead:\n\n```bash\nclaude mcp add -s user citadel-dev -- npx tsx /absolute/path/to/citadel-mcp/src/index.ts\n```\n\n## License\n\nMIT\n",
  "bytes": 5618,
  "sha": "01a75ad958dcaace07887a6c102139d114779099063f98d830d96801051cdd16",
  "repo_slug": "sustinbebustin/citadel-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_sustinbebustin_citadel_mcp_e228d694/readme"
}