Context Book

io.github.aditya201551由 GitHub 账号 aditya201551 发布v1.0.2更新于 Oct 25, 2026

Stop re-explaining yourself to Agents. Give it the right context, right when needed.

已验证Streamable HTTP可网页运行数据库知识与记忆

概览

AI 生成的概览

Context Book 是一个远程 MCP 服务器,为助手提供持久、可搜索的 Book 与 Page 知识库,让上下文跨对话延续。

可以做什么
创建和更新 Book,列出或获取 Book 的元数据与页面,可一次取回某个 Book 的全部页面,列表支持分页。在 Book 中插入、替换或删除单个 Page,写入时立即生成嵌入向量。跨所有 Book 进行语义搜索,取回最相关的已存上下文。每个会话可获取一次使用指南。
适用场景
适合反复向 AI 客户端解释相同背景、偏好或项目笔记,并希望这些内容只存一次、按需检索的场景。适用于 Claude、Cursor、Windsurf 等需要共享可搜索知识库的 MCP 客户端。
运行要求
通过 streamable HTTP 访问的远程 MCP 端点;README 中的自托管方式则需要 Go、Node.js、带 pgvector 和 pg_trgm 的 PostgreSQL,以及 Voyage AI API 密钥。所有工具都要求有效的 Bearer 令牌,且仅限已认证用户;清单未声明任何认证配置。
安装前请注意
工具会写入、替换和删除已存 Page,且 page_delete 不会重新编号索引。内容通过 Voyage AI 生成嵌入,已存文本会发送给该第三方。访问依赖 Bearer 令牌,应妥善保密;清单未声明认证,连接前请确认令牌的签发方式。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Context Book,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.aditya201551%2Fcontext-book-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "context-book": {
      "type": "http",
      "url": "https://context-book-mcp-production.up.railway.app/"
    }
  }
}

README

[ContextBook]

[smithery badge] [License: MIT]

[ContextBook - Stop re-explaining. Give agents the right context | Product Hunt]

Stop re-explaining yourself to Agents. Give it the right context, right when needed.

LLMs are stateless — each conversation starts from scratch. ContextBook gives your AI tools a persistent, searchable knowledge library to draw the right context when they need it. No bloatware, no pre-loaded junk. Just the right information, at the right time.

How It Works

mermaid
flowchart LR    AI["🤖 AI Clients\nClaude · Cursor · Windsurf"]    Browser["🌐 Browser Dashboard"]    MCP["🔌 MCP Server :8081\n8 Bearer-authenticated tools"]    API["⚙️ REST API :8080\nOAuth 2.0 · Books · Pages · Search"]    DB["🗄️ PostgreSQL\npgvector · pg_trgm"]    VOYAGE["🧠 Voyage AI\nvoyage-4 (1024-dim)"]
    AI -- "MCP · Bearer Token" --> MCP    Browser -- "Session · HTTP JSON" --> API    MCP --- DB    API --- DB    API -- "OAuth 2.0 PKCE" --> AI    DB --- VOYAGE

Two Go binaries share a PostgreSQL database:

  • API server (cmd/api) — the control plane: user login, OAuth 2.0, dashboard, book/page CRUD
  • MCP server (cmd/mcp) — the data plane: 8 MCP tools for AI agents, protected by Bearer tokens

MCP Tools

All tools require a valid Bearer token and are scoped to the authenticated user.

ToolDescription
book_create_or_updateCreate a Book or update its metadata
book_listPaginated list of Book metadata
book_getRetrieve all pages of a Book
page_insertPush an atomic page into a Book; embeds immediately
page_updateReplace a page's content; re-embeds
page_deleteRemove a page (indices not re-numbered)
page_searchSemantic search across all Books
readmeReturns the usage guide (call once per session)

Quick Start

Prerequisites

1. Set up the database

sql
CREATE DATABASE contextbook_db;\c contextbook_dbCREATE EXTENSION IF NOT EXISTS vector;CREATE EXTENSION IF NOT EXISTS pg_trgm;

Migrations run automatically on API server startup.

2. Configure environment

bash
cp .env.example backend/.env# Edit backend/.env — set DATABASE_URL, API_KEY_SALT, VOYAGE_API_KEY

3. Run the backend

bash
cd backendgo run ./cmd/api/main.go    # API + dashboard (:8080)go run ./cmd/mcp/main.go     # MCP server (:8081)

4. Run the frontend (optional)

bash
cd frontendnpm install && npm run dev    # Vite dev server on :5173

5. Connect an AI client

For Cursor (.cursor/mcp.json):

json
{  "mcpServers": {    "contextbook": {      "url": "http://localhost:8081/mcp"    }  }}

For any MCP-compatible client, point the server URL to http://localhost:8081/mcp.

Documentation

  • Backend README — API routes, auth flows, database schema, MCP tools, configuration
  • Frontend README — components, routing, design system, development setup
  • Architecture — full system overview with Mermaid diagrams

Project Structure

context-book/├── backend/│   ├── cmd/api/main.go          REST API + auth server│   ├── cmd/mcp/main.go          MCP tool server│   └── internal/│       ├── api/                  REST handlers + routes│       ├── auth/                 OAuth 2.0 PKCE, sessions, SSO│       ├── context/              Book/Page business logic│       ├── db/                  pgx queries + migrations│       ├── embedding/            Voyage AI client│       ├── logger/               slog + HTTP access logging│       └── mcp/                  8 MCP tool handlers├── frontend/                     React 19 + Vite + TypeScript SPA│   └── src/│       ├── App.tsx               Router + app shell│       ├── lib/api.ts            HTTP client│       └── components/           UI components├── Dockerfile                    API server container├── Dockerfile.mcp                MCP server container└── go.work                       Go workspace

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes
  4. Ensure the backend compiles (cd backend && go build ./cmd/api ./cmd/mcp)
  5. Ensure the frontend builds (cd frontend && npm run build)
  6. Commit and push
  7. Open a Pull Request

License

MIT — see the LICENSE file for details.

来源:README.md,提交 390bd24

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分