AI Skill Hub 强烈推荐:Nano脑 是一款优质的MCP工具。AI 综合评分 8.0 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
Nano脑 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
Nano脑 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/nano-step/nano-brain
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"nano-": {
"command": "npx",
"args": ["-y", "nano-brain"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 Nano脑 执行以下任务... Claude: [自动调用 Nano脑 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"nano_": {
"command": "npx",
"args": ["-y", "nano-brain"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Persistent memory and code intelligence for AI coding agents.
POST /api/reload-configDeploy one nano-brain server for the whole team. Every developer's AI agent connects to the same PostgreSQL instance — decisions, architecture notes, code intelligence, and session learnings are instantly shared across the team. New team members get full project context from day one without any setup on their machine.
Dev A (office) ──┐
Dev B (remote) ──┼──► nano-brain on team server ──► shared PostgreSQL
Dev C (new hire) ──┘
Role-based access: admins get full read/write, developers get read/write scoped to their workspace, stakeholders or reviewers get read-only access.
The fastest way to get started on a single machine.
Prerequisites: Docker, Ollama, Node.js 18+
```bash
npm install -g @nano-step/nano-brain
npm install -g @nano-step/nano-brain nano-brain serve -d --host=0.0.0.0
```bash
CGO_ENABLED=0 go build -o nano-brain ./cmd/nano-brain
npx @nano-step/nano-brain@latest doctor
npx @nano-step/nano-brain@latest serve -d
Also available as npx nano-brain@latest. Do NOT run from the nano-brain source directory — npm will resolve the local package instead of the registry.
When binding to a non-loopback address, enable auth to protect your memory:
server:
host: 0.0.0.0
port: 3100
auth:
enabled: true
realm: nano-brain
users:
- username: admin
password_hash: "$2a$10$..." # from: nano-brain auth hash <password>
tokens:
- "nbt_..." # from: nano-brain auth token
bypass_paths:
- /health
Generate credentials:
```bash
docker run -d \ -e NANO_BRAIN_CONFIG=/etc/nano-brain/config.yml \ -v /path/to/container-config.yml:/etc/nano-brain/config.yml:ro \ -p 3100:3100 \ nano-brain:latest ```
You work on your office PC, home machine, and personal laptop — each with a different Claude Code or OpenCode session. Without shared memory, your AI agent forgets everything between machines.
Deploy nano-brain on a VPS (or any always-on server) with a PostgreSQL instance. Every session you run on any machine gets harvested and indexed there. When you switch machines, your agent picks up exactly where you left off — decisions, context, code knowledge, all there.
Office PC ──┐
├──► nano-brain on VPS ──► shared PostgreSQL
Home Mac ───┘
Let your AI agent set this up for you. See SETUP_AGENT.md — a step-by-step guide your agent can follow to install, configure, and verify nano-brain, checking for missing dependencies and asking before installing anything.
---
Config file: ~/.nano-brain/config.yml
server:
host: localhost
port: 3100
database:
url: postgres://nanobrain:nanobrain@localhost:5432/nanobrain_dev
embedding:
provider: ollama # ollama or voyage
url: http://localhost:11434
model: nomic-embed-text
dimension: 0 # auto-detect from provider
concurrency: 3
search:
rrf_k: 60
recency_weight: 0.3
recency_half_life_days: 180
limit: 20
harvester:
opencode:
db_root: "" # e.g., ~/.ai-sandbox/opencode-dbs (multi-DB, highest priority)
db_path: "" # e.g., ~/.local/share/opencode/opencode.db (single DB)
session_dir: "" # e.g., ~/.local/share/opencode/storage (legacy JSON)
claudecode:
enabled: false
session_dir: ""
watcher:
debounce_ms: 2000
reindex_interval: 300
# Per-collection exclude_patterns and allowed_extensions are also supported
# via the workspaces map. See "Ignore patterns" section below for the
# global and workspace-local .nano-brainignore files.
storage:
max_file_size: 314572800 # 300MB
max_size: 10737418240 # 10GB
telemetry:
retention_days: 90
logging:
level: info
file: "" # empty = stdout only
summarization:
enabled: false # set to true to generate LLM summaries of harvested sessions
provider_url: "" # OpenAI-compatible endpoint, e.g. https://ai-proxy.example.com/v1
api_key: "" # or set NANO_BRAIN_SUMMARIZE_API_KEY env var
model: "nano-brain" # model name passed to the provider
max_tokens: 8000 # max tokens per LLM completion
concurrency: 3 # parallel map-phase LLM calls
| Variable | Description |
|---|---|
NANO_BRAIN_CONFIG | Path to YAML config file (12-factor; useful in Docker/k8s). Precedence: --config flag > NANO_BRAIN_CONFIG > ~/.nano-brain/config.yml. Leading/trailing whitespace is stripped. If the env-pointed file does not exist, a WARNING: is printed to stderr and defaults are used (operator can spot typos). |
DATABASE_URL | PostgreSQL connection string |
VOYAGE_API_KEY | Voyage AI API key |
OPENCODE_DB_ROOT | OpenCode per-project DB root directory (multi-DB mode) |
OPENCODE_DB_PATH | OpenCode single SQLite database path |
OPENCODE_STORAGE_DIR | OpenCode session directory (legacy) |
NANO_BRAIN_SUMMARIZE_API_KEY | API key for the summarization LLM provider |
NANO_BRAIN_AUTH_ENABLED | Enable Basic Auth + Bearer Token (true/false) |
NANO_BRAIN_AUTH_TOKENS | Comma-separated bearer tokens |
NANO_BRAIN_* | Override any config field (e.g., NANO_BRAIN_SERVER_PORT=3100) |
Docker example — run the server in a container against a host PostgreSQL:
```bash
{
"mcp": {
"nano-brain": {
"type": "remote",
"url": "http://localhost:3100/mcp"
}
}
}
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /api/status | Server status with version, uptime, workspace stats |
| POST | /api/v1/init | Register workspace |
| GET | /api/v1/workspaces | List all workspaces (with doc counts) |
| POST | /api/v1/workspaces/resolve | Resolve path → workspace hash + registered status (read-only) |
| DELETE | /api/v1/workspaces/:hash | Permanently delete a workspace + cascade docs/chunks/embeddings |
| GET | /api/v1/wake-up | Workspace briefing |
| POST | /api/harvest | Trigger session harvesting |
| POST | /api/reload-config | Hot-reload configuration |
Workspace is passed in the JSON body for POST, query param for GET.
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/write | Write/update document |
| POST | /api/v1/embed | Trigger embedding |
| POST | /api/v1/search | BM25 keyword search |
| POST | /api/v1/vsearch | Vector similarity search |
| POST | /api/v1/query | Hybrid search (BM25 + vector + RRF + recency) |
| POST | /api/v1/collections | Add collection |
| GET | /api/v1/collections | List collections |
| PUT | /api/v1/collections/:name | Rename collection |
| DELETE | /api/v1/collections/:name | Remove collection |
| GET | /api/v1/tags | List tags with counts |
| POST | /api/v1/get | Get single document by source_path or id |
| POST | /api/v1/multi-get | Batch fetch documents by paths or ids |
| POST | /api/v1/reindex | Queue reindex (202) |
| POST | /api/v1/update | Queue update (202) |
| POST | /api/v1/summarize | Trigger LLM summarization of harvested sessions |
| POST | /api/v1/wake-up | Workspace briefing with session_dir |
| Method | Path | Description |
|---|---|---|
| GET/POST | /mcp | Streamable HTTP (MCP 2025-03-26) |
| GET/POST | /sse | SSE transport (legacy) |
| Command | Description |
|---|---|
nano-brain (no args) | Start HTTP server (default: port 3100) |
nano-brain init --root=<path> | Register workspace |
nano-brain workspaces list | List registered workspaces with doc counts |
nano-brain workspaces current [--path=<p>] [--export\|--json\|--check] | Resolve current/path workspace hash. --export prints export NANO_BRAIN_WORKSPACE=<hash> for eval; --check exits 2 if not registered |
nano-brain workspaces remove --workspace=<hash> [--dry-run\|--force] | Permanently delete a workspace + all its documents/chunks/embeddings |
nano-brain write | Write document via CLI |
nano-brain query [--scope=all] [--tags=t1,t2] | Hybrid search (BM25 + vector + RRF + recency) |
nano-brain search [--scope=all] [--tags=t1,t2] | BM25 keyword search |
nano-brain vsearch [--scope=all] [--tags=t1,t2] | Vector similarity search |
nano-brain wake-up --workspace=<hash> | Workspace briefing (collections, stats, recent memories) |
nano-brain get <source_path\|uuid> --workspace=<hash> | Fetch a single document by source_path or UUID |
nano-brain tags --workspace=<hash> | List all tags with document counts |
nano-brain multi-get --workspace=<hash> --paths=p1,p2 | Fetch multiple documents in one round-trip |
nano-brain collection add\|remove\|list | Manage collections |
nano-brain harvest | Trigger session harvesting |
nano-brain backfill-summaries [--dry-run] [--workspace=] [--since=] | Export existing DB summaries to disk (.md files for Obsidian etc.) |
nano-brain cleanup-stale-raw [--dry-run] | Delete pre-#192 raw OpenCode session docs superseded by summaries |
nano-brain cleanup-orphan-workspaces [--dry-run] | Delete documents/chunks under workspace_hash values not registered in workspaces. Run BEFORE migration 00011 (issue #238). |
nano-brain bench generate\|run\|compare\|stress | Benchmarking suite |
nano-brain db:migrate | Run pending goose migrations |
nano-brain db:migrate --from-v1 <path> | Import V1 SQLite data |
nano-brain logs [-n 50] [-f] | Tail log file |
nano-brain docker start\|stop\|status | Docker compose management |
nano-brain status [--json] | Server status |
nano-brain auth hash <password> | Generate bcrypt password hash for config |
nano-brain auth token | Generate random bearer token (nbt_-prefixed) |
nano-brain doctor [--json] | Check prerequisites (config, PostgreSQL, pgvector, Ollama, model) |
Query --> BM25 (ts_rank_cd) ---+
+--> RRF Fusion (k=60) --> Recency Decay --> Results
Query --> Vector (HNSW cos) ---+
websearch_to_tsquery + ts_rank_cd on PostgreSQL tsvector高质量的开源MCP工具,提供持久内存和代码智能服务
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
总体来看,Nano脑 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | nano-brain |
| Topics | ai-agentsai-memorygolanghybrid-search |
| GitHub | https://github.com/nano-step/nano-brain |
| 语言 | Go |
收录时间:2026-06-04 · 更新时间:2026-06-04 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端