Knowledge MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Knowledge MCP Server
An MCP server providing project-specific knowledge management for coding agents (Claude Code, Codex, Gemini). Uses stdio transport and YAML-based storage for optimal LLM efficiency.
Better version of similar concept: atlas-mcp
Local-first design: Each project has its own .knowledge directory that can be committed to git.
Note: There is another unrelated project with the same name on PyPI. This project is not published to PyPI. Install from GitHub only.
Quick Start
The easiest way to use knowledge-mcp is via uvx (no installation required).
Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"knowledge-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/sephriot/knowledge-mcp",
"knowledge-mcp",
"--data-path",
".knowledge"
]
}
}
}Or add globally via CLI:
claude mcp add knowledge-mcp -- uvx --from git+https://github.com/sephriot/knowledge-mcp knowledge-mcpVerify it works:
claude mcp listGemini
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"knowledge-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/sephriot/knowledge-mcp",
"knowledge-mcp",
"--data-path",
".knowledge"
]
}
}
}Related MCP server: agtmem-mcp
Alternative Installation
If you prefer to install locally instead of using uvx:
# Clone and install
git clone https://github.com/sephriot/knowledge-mcp
cd knowledge-mcp
pip install -e .
# Then configure your MCP client to use the installed command
claude mcp add knowledge-mcp -- knowledge-mcp --data-path .knowledgeCLI Options
Option | Description |
| Path to knowledge storage directory (default: |
| Persist popularity counts to disk on each atom retrieval |
Running Standalone
# Default: uses .knowledge in current directory
knowledge-mcp
# Custom data path
knowledge-mcp --data-path /path/to/knowledge
# Via environment variable
KNOWLEDGE_MCP_PATH=./my-knowledge knowledge-mcpPopularity Tracking
The server tracks how often each atom is retrieved via get_atom. This popularity score influences search ranking (more popular atoms rank higher). By default, popularity is tracked in memory only and persists when other index changes occur.
Use --persist-popularity to write popularity counts to disk immediately on each retrieval. This is useful when:
Running short-lived sessions where in-memory counts would be lost
You want guaranteed persistence of usage patterns
Multiple server instances share the same storage
Note: Enabling this option increases disk writes. For most use cases, the default behavior is sufficient.
Storage Structure
.knowledge/
├── index.yaml # Fast lookup index (denormalized metadata)
└── atoms/
├── K-000001.yaml # Knowledge atom (YAML)
├── K-000002.yaml
└── ...Knowledge Atom Types
Type | Description |
| Verified information about the codebase |
| Architectural or design decisions |
| Step-by-step processes or workflows |
| Reusable code patterns or practices |
| Common pitfalls or tricky behaviors |
| Domain-specific terminology |
| Reusable code snippets |
Available Tools
Core Tools
Tool | Description |
| Search atoms by title, tags, content |
| Create or update a knowledge atom |
Knowledge Organization
Tool | Description |
| List atoms with optional filtering |
| Get full atom content by ID |
| Deprecate an atom (set status to deprecated) |
| Permanently delete an atom (cannot be undone) |
| List all atom IDs in storage |
Bulk Operations
Tool | Description |
| Export all knowledge as single JSON |
| Rebuild index.yaml from atom files |
Utility
Tool | Description |
| Summary grouped by type/tag/language |
| Get next available K-XXXXXX ID |
Example Usage
Creating a Knowledge Atom
{
"tool": "upsert",
"arguments": {
"title": "Error Handling Pattern",
"type": "pattern",
"status": "active",
"confidence": "high",
"language": "typescript",
"tags": ["error-handling", "async"],
"summary": "Centralized async error handling using Result types.",
"details": "Always wrap async operations in try-catch with specific error types...",
"pitfalls": ["Don't catch generic errors without re-throwing"],
"sources": [
{"kind": "repo_path", "ref": "src/utils/errors.ts"}
]
}
}Searching Knowledge
{
"tool": "search",
"arguments": {
"query": ["error", "handling"],
"types": ["pattern", "gotcha"],
"language": "typescript",
"limit": 5
}
}Deep Content Search
Use include_content: true to search within atom content (summary and details), not just titles and tags:
{
"tool": "search",
"arguments": {
"query": ["exponential", "backoff"],
"include_content": true
}
}File Path Search
Use file_path to find atoms related to specific files. Supports hierarchical matching:
{
"tool": "search",
"arguments": {
"file_path": "src/utils/errors.ts"
}
}Or search multiple files:
{
"tool": "search",
"arguments": {
"file_path": ["src/api/client.ts", "src/api/server.ts"]
}
}Scoring: exact match (+100) > parent directory (+50 decaying) > child match (+30).
Atom Fields Reference
Field | Required | Description |
| Yes | Unique ID (K-XXXXXX format) |
| Yes | Short descriptive title |
| Yes | fact, decision, procedure, pattern, gotcha, glossary, snippet |
| Yes | active, draft, deprecated |
| Yes | high, medium, low |
| Yes | Main content summary |
| No | Detailed explanation or code |
| No | List of potential pitfalls |
| No | Programming language |
| No | Keywords for search |
| No | References (repo_path, ticket, url, conversation) |
| No | Relations (depends_on, see_also, contradicts) |
AI Assistant Integration
To ensure your AI assistant (Claude, Gemini, Codex, etc.) automatically uses knowledge-mcp, add the system prompt to your assistant's configuration file.
For Gemini
Append the contents of SYSTEM_PROMPT.md to ~/.gemini/GEMINI.md.
For Claude Code
Append the contents of SYSTEM_PROMPT.md to ~/.claude/CLAUDE.md or your project's CLAUDE.md.
For other assistants
Copy the contents of SYSTEM_PROMPT.md to your assistant's system prompt or configuration file.
This ensures the assistant will:
Search existing knowledge before starting tasks
Apply relevant knowledge to decisions
Create new atoms when discovering reusable knowledge
Cite knowledge usage in responses
Development
Requirements
Python 3.11+
Dependencies: mcp, pyyaml, pydantic
Running tests
pip install -e ".[dev]"
pytest tests/Type checking
mypy src/knowledge_mcpLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Project memory, documentation and controlled secret access for AI coding agents.
Long-term memory for AI coding agents: durable project facts, recalled by every MCP client.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides 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-
- AlicenseAqualityBmaintenanceEnables coding agents to store, search, and retrieve long-term memory as plain Markdown files with a disposable SQLite index, including note management, decision/bug tracking, and codebase symbol lookup via MCP.8MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to persist and retrieve project knowledge using three MCP tools with local vector and full-text search.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to persistently store, semantically search, and recall project-specific and cross-project knowledge across sessions, with everything kept local in SQLite. It also exposes project context, guidelines, and preferences as MCP resources for agents to read and write directly.-