Librarian MCP

Librarian MCP

A Model Context Protocol server providing pre-curated canonical memory, prose/code provenance checking, and benchmark metrics to improve accuracy and reduce costs across AI tools.

Category
访问服务器

README

Librarian MCP

pip install librarian-mcp

PyPI version License: AGPL-3.0 Pledged Commons CI GitHub stars

A real, measured alternative to "bigger context windows." Pre-curated canonical memory + prose/code provenance checking + benchmark metrics, delivered as a Model Context Protocol server that works across Claude Code, Cursor, VSCode (via Continue), and any MCP-capable client.

Try it without installing →

What it does

Five tools, all exposed via MCP:

Tool What it does Added
librarian_context Intent-aware canonical memory packet. Loads curated preload content scoped to your query intent (outreach, architecture, benchmark, founder voice, etc.). Eliminates the "forgets by prompt #21" failure mode. v0.1.0 (stub), v0.2.0 (intent-aware)
prose_provenance Deterministic drift detection between two document versions. Catches silently-removed voice anchors, stale canonical numbers, section changes, register shifts. v0.1.0
record_measurement Log a single benchmark measurement (vendor, model, condition, accuracy, cost, latency) to local JSONL. v0.2.0
metrics_summary Per-vendor and per-model aggregation of recorded measurements. Shows accuracy lift, cost savings, cache hit rate. v0.2.0
opt_in_share Toggle anonymous metrics sharing flag. Default OFF. Commons dashboard POST endpoint ships in a future release. v0.2.0

Why we built this

Independently measured result (Eyewitness Benchmark R10, April 2026, eight models across four vendors, 1,200 graded calls, inter-rater kappa 0.883/0.850):

  • Without the Librarian (COLD): mean 8.7% correct
  • With the Librarian (HOT): mean 94.8% correct — 86.1 percentage-point lift
  • Haiku 4.5 (cheapest) ties Opus 4.7 (most expensive) at 19x cost difference
  • 4.3x more right answers per dollar of compute

Applied inside Microsoft Copilot's inference path, the same architecture recovers an estimated $750M/year in waste. Inside Anthropic's developer tools, ~$130M/year. Full methodology in the R9 Empirical Test Companion Paper.

librarian_context — Intent API

librarian_context(intent="outreach", max_tokens=16000)
Intent What it loads Approx. tokens
"" (default) Base R9-v2 preload only ~4,500
"canonical" Base + canonical values + canonical laws ~15,000
"outreach" Base + canonical + Opening Gambit + letter queue + Cephas + Glass Door + Witness ~30,000
"architecture" Base + canonical + Pledge + IP split + Medallion + Pedestal Stake ~20,000
"founder_voice" Base + Rhetorical Keystones + Pine Books + Anachronism + Cloyd + Three-clock ~10,000
"benchmark" Base + R10 results + R9 brief + 75-Q bank + rubric + posture disclosure ~10,000
"operational" Union of outreach + canonical ~30,000

List inputs for union queries: intent='["benchmark", "founder_voice"]'

Returns:

{
  "packet": "...markdown...",
  "sections_included": ["r9v2_base.md", "canonical/canonical_values.yaml", ...],
  "token_count": 14832,
  "source_version": "a1b2c3d4e5f6",
  "truncation_note": null
}

metrics_summary — Schema

{
  "total_calls": 1200,
  "per_vendor": {
    "anthropic": {
      "calls": 600,
      "hot_accuracy": 95.3,
      "cold_baseline_est": 8.2,
      "dollars_saved_est": 42.17,
      "cache_hit_rate": 50.0
    }
  },
  "per_model": {
    "claude-haiku-4-5-20251001": { "..." : "..." }
  },
  "cumulative_hot_accuracy": 94.8,
  "cumulative_cold_baseline_est": 8.7,
  "cumulative_dollars_saved_est": 127.50,
  "opt_in_share": false,
  "since": "all_time"
}

Pricing

Tier Who it's for Price
Pledged Commons Any nonprofit, cooperative, academic institution, or public-service organization with IRS-verified EIN (or international equivalent) $0 forever. Full feature set. Under the Cooperative Defensive Patent Pledge.
Individual Single developer $0 (community edition, this repo) for local use; $15/mo for hosted multi-repo context + team sharing
Team 2–50 seats $10/seat/mo (min $50)
Enterprise 50+ seats, custom canonical schemas, audit logs, SAML, support Contact. Typically $50–100/seat/mo.

The commercial tiers pay for the commons. No grant funding, no VC, no extractive margin. Cost+20% on operating expense. That's it.

Why MCP (not a Cursor extension)

Because you shouldn't have to pick between your AI assistants. MCP servers work across Claude Code, Cursor (v0.45+), Continue (VSCode / JetBrains), Zed, and every MCP-capable client in the roadmap. One server, all your tools.

Install

Quick start (local, Python 3.10+)

git clone https://github.com/liana-banyan/librarian-mcp.git
cd librarian-mcp
pip install -e .
librarian-mcp  # starts on stdio for MCP clients

With optional dependencies

pip install -e ".[all]"   # tiktoken (accurate token counts) + anthropic + pyyaml
pip install -e ".[dev]"   # + pytest, ruff, mypy for development

Claude Code

claude mcp add librarian python -m librarian_mcp

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "librarian": {
      "command": "python",
      "args": ["-m", "librarian_mcp"]
    }
  }
}

Continue (VSCode / JetBrains)

See docs/continue-integration.md.

Development

pip install -e ".[dev,all]"
ruff check src/ tests/          # lint
mypy --strict src/librarian_mcp/  # type check
pytest -v                        # test (34 tests)

Status

April 21, 2026 — v0.2.0. Intent-aware librarian_context live with bundled preload (R10-validated). Benchmark metrics recording live. Prose Provenance tool upgraded to v0.2.0. PyPI name librarian-mcp reserved. CI/CD staged.

License

AGPL-3.0. Commercial licensing for the paid tiers is a separate agreement; the Pledged Commons tier is covered by AGPL + the Cooperative Defensive Patent Pledge.

Contact

  • General: hello@liana-banyan.com
  • Enterprise: enterprise@liana-banyan.com
  • Press / AI policy / datacenter-alternative questions: press@liana-banyan.com
  • Founder: Jonathan Jones, Founder & General Manager, Liana Banyan Corporation (Wyoming C-Corp)

Contributing

We welcome contributions — code, corpus preloads, benchmark replications, and research extensions.

  • BOUNTIES.md — paid bounties for specific contributions, from $25 good-first-bounty issues to $500 deep bounties
  • BUILDING_TOGETHER.md — guide to running, extending, and contributing back upstream

"You build the Features — We're building the Board."

Pledged into the commons. For the Keep.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选