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 分