context-book
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@context-bookSearch my library for best practices in Go concurrency"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
This server cannot be deployed
Maintenance
Related MCP Connectors
- hiveWikiOAuthai.hivewiki
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 gradedqualityCmaintenanceEnables 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.4-
- AlicenseNot gradedqualityBmaintenanceProvides 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.32Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to persistently store and semantically search shared knowledge via MCP tools.2MIT
- FlicenseAqualityCmaintenanceProvides coding agents with a shared, Markdown-based engineering knowledge base to search, capture, create, and update internal conventions, API details, infrastructure configs, and development setup via lightweight MCP tools.6-