muninn-local-mcp
A local-first MCP server providing persistent, project-scoped and global memory for AI agents using ChromaDB and Ollama embeddings, fully offline.
README
Muninn Local MCP
A local-first Model Context Protocol (MCP) server that gives AI agents (such as OpenCode) persistent, project-scoped memory powered by ChromaDB and Ollama embeddings.
All data stays on your machine — no external API calls, no cloud storage.
Note: This project is adapted from muninn-mcp and modified to run fully locally using Ollama + ChromaDB instead of cloud services.
Features
- Persistent memory — store and recall context across sessions via vector search
- Project isolation — each git project gets its own memory namespace, automatically
- Global memory — share cross-project knowledge (tooling, patterns, decisions)
- Local embeddings — vectors generated by a local Ollama model, zero data leaves your machine
- MCP-native — works with any MCP-compatible client (OpenCode, Claude Desktop, etc.)
- Zero-config defaults — sensible defaults that work out of the box
Prerequisites
ollama pull mxbai-embed-large
Installation
git clone https://github.com/wolfcao/muninn-local-mcp.git
cd muninn-local-mcp
uv sync
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
MUNINN_DATA_DIR |
~/.config/opencode/muninn |
ChromaDB data directory |
MUNINN_OLLAMA_URL |
http://localhost:11434 |
Ollama service URL |
MUNINN_EMBED_MODEL |
mxbai-embed-large |
Embedding model name |
MUNINN_PROJECT_ID |
(auto from git root) | Force a specific project ID |
OpenCode Integration
Add the server to your opencode.json:
{
"mcp": {
"muninn": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/path/to/muninn-local-mcp",
"run",
"python",
"-m",
"muninn_local"
]
}
}
}
Standalone
Run the MCP server directly:
python -m muninn_local
MCP Tools
Muninn exposes 7 tools, split between project-scoped and global memory.
Project Memory
| Tool | Parameters | Description |
|---|---|---|
memory_write |
text, memory_type, tags |
Store a project-scoped memory |
memory_search |
query, top_k |
Semantic search within current project |
memory_list |
limit, offset |
List memories (newest first) |
memory_delete |
memory_id |
Delete a specific memory |
Global Memory
| Tool | Parameters | Description |
|---|---|---|
global_memory_write |
text, memory_type, tags |
Store a cross-project memory |
global_memory_search |
query, top_k |
Semantic search across all projects |
global_memory_list |
limit |
List global memories (newest first) |
Memory Types
The memory_type parameter accepts: summary, decision, next-steps, code-pattern, note (default).
How Project Isolation Works
Muninn automatically identifies the current project by resolving the git repository root (git rev-parse --show-toplevel) and hashing the path with SHA256. The resulting fingerprint becomes the project_id, ensuring each project's memories are isolated in their own ChromaDB collection.
Architecture
| Layer | Module | Responsibility |
|---|---|---|
| Entry | __main__.py / server.py |
MCP FastMCP server |
| Business | memory.py (MemoryManager) |
Memory CRUD operations |
| Storage | chroma_store.py (ChromaStore) |
ChromaDB persistence wrapper |
| Embedding | embeddings.py (OllamaEmbedder) |
Vector generation via Ollama API |
| Config | config.py (Config) |
data_dir / ollama_url / embed_model |
| Identity | project.py |
git root → auto project_id |
Notes
- Ollama must be running — the server depends on a local Ollama instance for embedding generation.
- Data is persistent — ChromaDB stores data in
~/.config/opencode/muninn/chroma/. Deleting this directory wipes all memories. - Path-sensitive project IDs — cloning or forking to a different path generates a new
project_id, so memories won't carry over. Override withMUNINN_PROJECT_IDif needed.
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 模型以安全和受控的方式获取实时的网络信息。