context-book
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
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
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 --- VOYAGETwo Go binaries share a PostgreSQL database:
API server (
cmd/api) β the control plane: user login, OAuth 2.0, dashboard, book/page CRUDMCP server (
cmd/mcp) β the data plane: 8 MCP tools for AI agents, protected by Bearer tokens
Related MCP server: Librarian
MCP Tools
All tools require a valid Bearer token and are scoped to the authenticated user.
Tool | Description |
| Create a Book or update its metadata |
| Paginated list of Book metadata |
| Retrieve all pages of a Book |
| Push an atomic page into a Book; embeds immediately |
| Replace a page's content; re-embeds |
| Remove a page (indices not re-numbered) |
| Semantic search across all Books |
| Returns the usage guide (call once per session) |
Quick Start
Prerequisites
1. Set up the database
CREATE DATABASE contextbook_db;
\c contextbook_db
CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS pg_trgm;Migrations run automatically on API server startup.
2. Configure environment
cp .env.example backend/.env
# Edit backend/.env β set DATABASE_URL, API_KEY_SALT, VOYAGE_API_KEY3. Run the backend
cd backend
go run ./cmd/api/main.go # API + dashboard (:8080)
go run ./cmd/mcp/main.go # MCP server (:8081)4. Run the frontend (optional)
cd frontend
npm install && npm run dev # Vite dev server on :51735. Connect an AI client
For Cursor (.cursor/mcp.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 workspaceContributing
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Make your changes
Ensure the backend compiles (
cd backend && go build ./cmd/api ./cmd/mcp)Ensure the frontend builds (
cd frontend && npm run build)Commit and push
Open a Pull Request
License
MIT β see the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Shared project wiki for AI agents: read and write pages, next actions, and activity logs over MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Knowledge base for AI agents: search, read, tasks; write, correct, report outcomes via /mcp/write.
Shared MCP memory for AI agents: knowledge base, skills, todos and agent-to-agent handoffs.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with a persistent knowledge graph backend using MCP tools for reading, searching, and analyzing wiki pages with vector search and graph algorithms.5-
- AlicenseNot gradedqualityCmaintenanceProvides AI agents with persistent knowledge storage, enabling them to store, search, and retrieve text, documents, and files using semantic and keyword search via MCP tools.34Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to persistently store and semantically search shared knowledge via MCP tools.2MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search, read, update, and batch-manage persistent documents and workspace knowledge through MCP tools, prompts, and resources.-