mcp-canon
Universal MCP knowledge server for LLM agents, powered by local RAG, providing domain-specific best practices and playbooks across software engineering, marketing, video editing, and other knowledge areas.
README
mcp-canon
Universal MCP knowledge server for LLM agents, powered by local RAG.
Use Canon to provide domain-specific best practices and playbooks across software engineering, marketing, video editing, and other knowledge areas.
Typical workflows:
- Find the most suitable guide for a task
- Retrieve concise best-practice snippets
- Read full guides for deeper execution context
Quick Start
<details> <summary><b>Install in Cursor</b></summary>
Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server
Pasting the following configuration into your Cursor ~/.cursor/mcp.json file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json in your project folder. See Cursor MCP docs for more info.
Cursor Local Connection
{
"mcpServers": {
"canon": {
"command": "uvx",
"args": ["mcp-canon"]
}
}
}
Cursor Local Connection With Custom Database
{
"mcpServers": {
"canon": {
"command": "uvx",
"args": ["mcp-canon"],
"env": {
"CANON_DB_PATH": "/path/to/my-db"
}
}
}
}
Cursor Remote Server Connection
{
"mcpServers": {
"canon": {
"url": "http://localhost:8080/mcp"
}
}
}
</details>
<details> <summary><b>Install in Claude Code</b></summary>
Run this command. See Claude Code MCP docs for more info.
Claude Code Local Connection
claude mcp add --scope user canon -- uvx mcp-canon
Cursor Local Connection With Custom Database
claude mcp add --scope user -e CANON_DB_PATH=/path/to/my-db canon -- uvx mcp-canon
Claude Code Remote Server Connection
claude mcp add --scope user --transport http canon http://localhost:8080/mcp
Remove
--scope userto install for the current project only.
</details>
<details> <summary><b>Install in Opencode</b></summary>
Add this to your Opencode configuration file. See Opencode MCP docs for more info.
Opencode Local Connection
{
"mcp": {
"canon": {
"type": "local",
"command": ["uvx", "mcp-canon"],
"enabled": true
}
}
}
Opencode Local Connection With Custom Database
{
"mcp": {
"canon": {
"type": "local",
"command": ["uvx", "mcp-canon"],
"enabled": true,
"environment": {
"CANON_DB_PATH": "/path/to/my-db"
}
}
}
}
Opencode Remote Server Connection
"mcp": {
"context7": {
"type": "remote",
"url": "http://localhost:8080/mcp",
"enabled": true
}
}
</details>
<details> <summary><b>Install in Gemini CLI</b></summary>
Run this command. See Gemini CLI MCP docs for more info.
Gemini CLI Local Connection
gemini mcp add --scope user canon uvx mcp-canon
Gemini CLI Local Connection With Custom Database
gemini mcp add --scope user -e CANON_DB_PATH=/path/to/my-db canon uvx mcp-canon
Gemini CLI Remote Server Connection
gemini mcp add --scope user --transport http canon http://localhost:8080/mcp
Remove
--scope userto install for the current project only.
</details>
<details> <summary><b>Install in Google Antigravity</b></summary>
Go to the agent panel and open: ... -> MCP Servers -> Manage MCP Servers -> View raw config.
Add this to your mcp_config.json file. See Google Antigravity MCP docs for more info.
Google Antigravity Local Connection
{
"mcpServers": {
"canon": {
"command": "uvx",
"args": ["mcp-canon"]
}
}
}
Google Antigravity Local Connection With Custom Database
{
"mcpServers": {
"canon": {
"command": "uvx",
"args": ["mcp-canon"],
"env": {
"CANON_DB_PATH": "/path/to/my-db"
}
}
}
}
</details>
Create and index your own guides
Complete workflow from installation to running with your own domain guides.
Step 1: Install with indexing support
pip install "mcp-canon[indexing]"
Step 2: Create library structure
my-library/
├── engineering/
│ └── python-fastapi-guide/
│ ├── INDEX.md # Required: metadata
│ └── GUIDE.md # Content
├── marketing/
│ └── launch-playbook/
│ ├── INDEX.md
│ └── GUIDE.md
└── video-editing/
└── shorts-workflow/
└── INDEX.md # Can reference external URL
Step 3: Create guides
Step 4: Index your library
# Index to custom location
canon index --library ./my-library --output /path/to/my-db
# Validate frontmatter before indexing (optional)
canon validate --library ./my-library
Running as HTTP server
For remote access or multi-client scenarios, run Canon as an HTTP server. This is useful when multiple agents or teams share one cross-domain knowledge base.
Step 1: Install with HTTP support
pip install "mcp-canon[http]"
Step 2: Start the server
# Default port 8080
canon serve
# Custom port and host
canon serve --port 3000 --host 0.0.0.0
# With custom database
CANON_DB_PATH=/path/to/db canon serve --port 8080
Step 3: Configure MCP client
{
"mcpServers": {
"canon": {
"url": "http://localhost:8080/mcp"
}
}
}
Environment Variables
| Variable | Description | Default |
|---|---|---|
CANON_DB_PATH |
Path to custom database | Bundled DB |
CANON_EMBEDDING_MODEL |
Fastembed model name (supported models) | nomic-ai/nomic-embed-text-v1.5-Q |
CANON_EMBEDDING_DIM |
Embedding vector dimensions (must match model) | 768 |
CANON_FASTEMBED_THREADS |
ONNX runtime threads for FastEmbed (lower = less RAM, slower) | auto |
CANON_FASTEMBED_BATCH_SIZE |
Embedding batch size during indexing (lower = less RAM, slower) | 256 |
CANON_FASTEMBED_PARALLEL |
FastEmbed data-parallel workers (>1 increases RAM usage) |
disabled |
CANON_LOG_LEVEL |
Log level (DEBUG, INFO, WARNING, ERROR) | INFO |
CANON_LOG_JSON |
Output logs in JSON format | false |
Note: Changing
CANON_EMBEDDING_MODELorCANON_EMBEDDING_DIMrequires a full reindex:canon index --library ./library
Change embedding model and dimensions
Internal constants EMBEDDING_MODEL_NAME and EMBEDDING_DIM are configured via:
CANON_EMBEDDING_MODELCANON_EMBEDDING_DIM
Example (using BAAI/bge-small-en-v1.5, 384 dims):
CANON_EMBEDDING_MODEL=BAAI/bge-small-en-v1.5 \
CANON_EMBEDDING_DIM=384 \
canon index --library ./library --output ./my-db
Where to find available models:
- FastEmbed supported models: https://qdrant.github.io/fastembed/examples/Supported_Models/
- FastEmbed model card and usage notes: https://qdrant.github.io/fastembed/
Important:
CANON_EMBEDDING_DIMmust match the selected model output size.- After changing model or dimension, rebuild the index before running search/server commands.
MCP Tools
| Tool | Description |
|---|---|
search_best_practices |
Semantic search for best practices in any domain (optionally scoped by guide_id) |
search_suitable_guides |
Find guides that match a task description across domains |
read_full_guide |
Get complete guide content for full context |
CLI Commands
# Indexing
canon index --library ./library # Index guides from any domain (creates new DB)
canon index --library ./lib --append # Add to existing database
canon validate --library ./library # Validate frontmatter
# Server
canon serve --port 8080 # Start HTTP server (requires [http])
# Info
canon list # List indexed guides
canon info # Show database info
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。