{
  "markdown": "# mcp-server-fable\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](#license)\n[![Rust edition 2024](https://img.shields.io/badge/Rust-edition%202024-dea584.svg?logo=rust&logoColor=white)](https://www.rust-lang.org/)\n[![MCP](https://img.shields.io/badge/MCP-server-6f42c1.svg)](https://modelcontextprotocol.io/)\n[![Model: Claude Fable 5](https://img.shields.io/badge/model-Claude%20Fable%205-d97757.svg)](https://www.anthropic.com/)\n\nAn MCP (Model Context Protocol) server for **Anthropic Claude Fable 5** — Anthropic's most capable, most expensive model ($10 / $50 per 1M input / output tokens, ~2× Opus). Built in Rust, it exposes Fable as specialized MCP tools (`plan`, `critique`, `ask`) so **any** MCP client can use them.\n\nFable is **not** a day-to-day chat model here. This server is built for the one thing that justifies the price: using Fable to **plan** and **critique**, then handing the result to a cheaper model (Sonnet / Haiku / Opus) to execute. It works in Claude Code, Claude Desktop, Cursor, custom agents, and any other environment that supports MCP servers over stdio.\n\nCommunicates via stdio using JSON-RPC 2.0. Structurally it mirrors `mcp-server-claude-chat`, but is deliberately adapted to Fable's API surface and purpose-built for the plan-then-execute pattern.\n\n## Why mcp-server-fable (vs. Claude Code's built-in advisor)?\n\nClaude Code has a powerful native advisor feature (`/advisor fable` or the `advisor` tool). It lets a fast executor model (typically Sonnet or Haiku) dynamically ask Fable for guidance on hard decisions inside a single session.\n\nThis MCP server takes a **complementary approach** that is useful in more situations:\n\n- **Explicit tools with handoff-optimized prompts** — `plan` and `critique` use fixed, carefully written system prompts designed so the output can be passed *verbatim* to a cheaper model. Plans are numbered, unambiguous, include exact paths/signatures, edge cases, acceptance criteria, and out-of-scope notes. Critiques are deliberately coverage-first (report everything; filter downstream).\n- **Works everywhere MCP works** — Not limited to Claude Code. Use it in Claude Desktop, Cursor, Windsurf, custom agent frameworks, VS Code MCP extensions, scripts, or any future tool that supports the Model Context Protocol.\n- **You control the orchestration** — Call Fable for planning or review exactly when *you* (or your multi-agent system) decide, instead of relying on the model to escalate.\n- **Clean composability** — Treat Fable as a reusable specialist service alongside your other MCP servers. Perfect for modern \"expensive model for judgment, cheap model for execution\" workflows.\n- **Correct Fable-specific behavior** — Proper `effort` levels, refusal handling (no silent fallback), long timeouts, and accurate per-call cost reporting at Fable rates.\n\nMany teams are converging on the same pattern the community discovered: use Fable narrowly for architecture, planning, and review, then execute with cheaper models. This server gives you first-class, portable tools for the \"Fable parts\" of that pattern.\n\nSee the \"Technical details\" section below for the specific Fable API differences that also required a dedicated implementation.\n\n## Subscription vs. API credits\n\nThis server uses the **Anthropic API with an API key (API credits)** — the only supported, terms-compliant way to drive Claude from a third-party tool. A Claude Pro/Max subscription is not usable here. Point `base_url` at an Anthropic-compatible gateway if you run one.\n\n## Technical details: Fable API differences\n\nFable's Messages API differs from the Opus-era shape (this is why a dedicated server was needed rather than reusing a general Claude chat wrapper):\n\n- **No sampling parameters** — `temperature` / `top_p` / `top_k` are rejected with a 400. There is no `temperature` tool argument.\n- **Adaptive thinking only** — reasoning is always on; depth is controlled by **`effort`** (`low` / `medium` / `high` / `xhigh` / `max`), not a token budget. The raw chain of thought is never returned; `ask` can request a readable *summary* via `show_reasoning`.\n- **Refusals stop, cleanly** — this is a *dedicated Fable server*. Fable's safety classifiers (cyber / bio / model-distillation) can decline a request; that comes back as a successful response with `stop_reason: \"refusal\"`, surfaced with its category and explanation rather than as an answer. It is never silently retried on a different model.\n- **30-day data retention required** — Fable is not available to zero-data-retention orgs; such orgs get a 400 on every request.\n\nEvery response also prints an **estimated USD cost** (at Fable's sticker rates), since cost-consciousness is the whole point.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `plan` | **Flagship.** Turn a goal (+ optional context) into an executor-ready implementation plan: numbered steps, exact paths/signatures, edge cases, acceptance criteria, out-of-scope notes — written to be handed to a cheaper model and executed verbatim. |\n| `critique` | Coverage-first review of code, a diff, or a design. Reports every finding with severity + confidence for downstream filtering. Optional `focus`. |\n| `ask` | Raw one-shot query to Fable. Multi-turn history, system prompt, effort, optional reasoning summary. |\n\n### plan\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `goal` | string | yes | What to build or fix |\n| `context` | string | no | Relevant code, file tree, constraints, error output, prior attempts |\n| `effort` | string | no | `low`/`medium`/`high`/`xhigh`/`max` (default `high`) |\n| `max_tokens` | integer | no | Max tokens to generate (server default otherwise) |\n\n### critique\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `content` | string | yes | Code, diff, or design to review |\n| `focus` | string | no | Area to weight, e.g. `security`, `concurrency` |\n| `effort` | string | no | `low`/`medium`/`high`/`xhigh`/`max` (default `high`) |\n| `max_tokens` | integer | no | Max tokens to generate |\n\n### ask\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `prompt` | string | yes | The user message |\n| `system_prompt` | string | no | System prompt |\n| `messages` | string | no | History as a JSON array of `{role, content}` (roles `user`/`assistant` only) |\n| `effort` | string | no | `low`/`medium`/`high`/`xhigh`/`max` (default `medium`) |\n| `max_tokens` | integer | no | Max tokens to generate |\n| `show_reasoning` | boolean | no | Return a summary of Fable's reasoning in a `[thinking]` block |\n\n## Prerequisites\n\n- Rust (edition 2024)\n- An Anthropic API key from [console.anthropic.com](https://console.anthropic.com/settings/keys), on an org with ≥30-day data retention\n\nThe server expects a config file at `~/.config/mcp-server-fable/config.toml` containing at minimum your `api_key`. See `config.toml.example`.\n\n```toml\napi_key = \"sk-ant-...\"\n\n# Optional overrides:\n# base_url = \"https://api.anthropic.com/v1\"\n# default_model = \"claude-fable-5\"\n# default_max_tokens = 8192\n# default_effort = \"high\"   # low | medium | high | xhigh | max\n```\n\nThe server fails fast at startup if the config is missing, `api_key` is empty, or `default_effort` (if set) is invalid.\n\n## Build\n\n```bash\ncargo build --release   # produces target/release/fable\ncargo build             # debug build\ncargo run               # run in dev mode\nRUST_LOG=debug cargo run\ncargo test              # unit tests (response formatting, cost, refusal, effort, message building)\n```\n\n## Installation & MCP Configuration\n\n### 1. Build the server\n\n```bash\ncargo build --release\n# The binary will be at: target/release/fable\n```\n\nUse the **full absolute path** to `target/release/fable` in all configuration below.\n\n### 2. AI-assisted installation (recommended modern method)\n\nCopy the block below and paste it directly to your AI coding assistant (Claude Code, Cursor, Grok, etc.). The AI will handle cloning (if needed), building, path resolution, and registration for you.\n\n```\nAdd the mcp-server-fable MCP server for me.\n\nRepository: https://github.com/<your-username>/mcp-server-fable   (update this URL if you have a fork)\n\nSteps to perform:\n1. If the repo isn't cloned locally yet, clone it and cd into it.\n2. Build the release binary:\n     cargo build --release\n3. Determine the absolute path to the built binary (target/release/fable).\n4. Set up the config directory and file:\n     mkdir -p ~/.config/mcp-server-fable\n     cp config.toml.example ~/.config/mcp-server-fable/config.toml\n   Then edit the config and add your Anthropic API key (api_key = \"sk-ant-...\").\n\n5. Register it as an MCP server named \"fable\".\n\n   For Claude Code, run:\n     claude mcp add fable -- <ABSOLUTE_PATH_TO>/target/release/fable\n\n   For Claude Desktop or other MCP clients, add this under the \"mcpServers\" key (use the real absolute path):\n{\n  \"fable\": {\n    \"command\": \"<ABSOLUTE_PATH_TO>/target/release/fable\"\n  }\n}\n\nAfter setup, test that the `plan` tool is available and working.\n```\n\n### 3. Manual configuration\n\nClaude Desktop or any MCP client (`~/.config/Claude/claude_desktop_config.json` or equivalent):\n\n```json\n{\n  \"mcpServers\": {\n    \"fable\": {\n      \"command\": \"/absolute/path/to/mcp-server-fable/target/release/fable\"\n    }\n  }\n}\n```\n\nClaude Code (one-liner):\n\n```bash\nclaude mcp add fable -- /absolute/path/to/mcp-server-fable/target/release/fable\n```\n\nReplace the path with your actual absolute path to the release binary.\n\n## Usage\n\nOnce it's registered, an MCP client calls the tools by name — the flagship is `plan`.\n\n### From an MCP client (e.g. Claude Code)\n\nAsk the model to use it, handing over the goal plus whatever context the executor will need:\n\n> Use the fable **plan** tool. goal: \"Add a `--json` flag to the CLI that prints results as JSON\". context: \"Rust `clap` app; output currently goes through `println!` in `src/main.rs`\". effort: high\n\nClaude Code issues a `tools/call` for `plan`; Fable returns a numbered, executor-ready plan — exact paths, signatures, edge cases, acceptance criteria — which you then hand to a cheaper model (Sonnet / Haiku) to implement verbatim.\n\n### Raw JSON-RPC over stdio\n\nThe same call without a client — a `tools/call` request the server reads on stdin:\n\n```json\n{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\n  \"name\":\"plan\",\n  \"arguments\":{\n    \"goal\":\"Add a --json flag to the CLI that prints results as JSON\",\n    \"context\":\"Rust clap app; output currently via println! in src/main.rs\",\n    \"effort\":\"high\"\n  }}}\n```\n\n`plan` and `critique` return their content followed by a token + estimated-cost footer. Here is an **actual** response (from a tiny `ask` probe) showing that footer:\n\n```\nBINARY-OK\n[stop_reason: end_turn]\n[tokens: 21 input + 9 output = 30 total]\n[cost: ≈ $0.0007 (fable rates)]\n```\n\nBecause the server only ever calls Fable, that cost line is always at Fable's $10 / $50 per-1M rates — accurate by construction, not by convention.\n\n## Project Structure\n\n```\nsrc/\n  main.rs    - entry point, config loading, stdio transport setup\n  server.rs  - MCP tool definitions (plan, critique, ask) + fixed prompts\n  api.rs     - Anthropic HTTP client, Effort enum, Messages types, refusal/cost formatter\n  params.rs  - tool parameter types with serde + JSON Schema derives\n  config.rs  - TOML config loading + effort validation\n```\n\n## License\n\nMIT\n",
  "bytes": 11426,
  "sha": "68ee4cbf3dca8acc002ae1dbe54ba88a346c772f0e721c172544e16a088e8327",
  "repo_slug": "codechap/mcp-server-fable",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_codechap_fable_d8a02a44/readme"
}