docmind-mcp 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +12 -0
- package/README.md +109 -0
- package/dist/cli.js +943 -0
- package/dist/index.js +24969 -0
- package/package.json +47 -0
package/.env.example
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# digmunk MCP server configuration
|
|
2
|
+
# 默认知识库根目录(也可在每次工具调用时用 root 参数覆盖)
|
|
3
|
+
DIGMUNK_ROOT=/path/to/your/docs
|
|
4
|
+
|
|
5
|
+
# Sirchmunk serve 地址
|
|
6
|
+
SIRCHMUNK_URL=http://127.0.0.1:8584
|
|
7
|
+
|
|
8
|
+
# research 超时(秒)
|
|
9
|
+
DIGMUNK_RESEARCH_TIMEOUT=120
|
|
10
|
+
|
|
11
|
+
# zg 超时(秒)
|
|
12
|
+
DIGMUNK_SEARCH_TIMEOUT=30
|
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# docmind
|
|
2
|
+
|
|
3
|
+
**Local Deep Research knowledge base for coding agents.**
|
|
4
|
+
|
|
5
|
+
Point docmind at any folder of documents. Your agent gets three MCP tools:
|
|
6
|
+
|
|
7
|
+
| Tool | What it does | Cost |
|
|
8
|
+
|------|-------------|------|
|
|
9
|
+
| `search` | Instant hybrid retrieval (BM25 + vectors + ripgrep) | Free, sub-second |
|
|
10
|
+
| `research` | Budgeted LLM deep-dive with source citations, auto-saved as a knowledge note | LLM tokens |
|
|
11
|
+
| `remember` | Persist a fact/decision/summary into the knowledge base | Free |
|
|
12
|
+
|
|
13
|
+
**The flywheel:** every `research` conclusion is saved and indexed, so tomorrow's `search` answers instantly what today's `research` had to work for.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Single self-contained package (~180 KB, zero npm dependencies — everything runs locally):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Step 1 — install (or `npx docmind-mcp init` to skip installing)
|
|
21
|
+
npm install -g docmind-mcp
|
|
22
|
+
|
|
23
|
+
# Step 2 — one wizard sets up everything and wires your agent
|
|
24
|
+
docmind init
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`docmind init` walks you through everything (about 5 minutes, most of it waiting for downloads):
|
|
28
|
+
|
|
29
|
+
1. **Dependencies** — detects and installs `zvec-grep`, `ripgrep-all`, CPU-only pytorch, and `sirchmunk` (avoids the 3-4GB CUDA download trap)
|
|
30
|
+
2. **Knowledge folder** — any folder you choose; markdown, PDFs, docx, code, whatever you have
|
|
31
|
+
3. **LLM credentials** — paste `key`, `base url`, and `model` in any format, e.g.:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
key=sk-xxx Base url=https://api.example.com/v1 Model name=my-model
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
4. **Service start** — launches the research engine in the background
|
|
38
|
+
5. **Agent integration** — registers the MCP server into your coding agent (optional, interactive)
|
|
39
|
+
|
|
40
|
+
After init, your agent immediately has `search` / `research` / `remember`. Verify anytime with `docmind doctor`.
|
|
41
|
+
|
|
42
|
+
## Connect your agent
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
docmind install # auto-tries opencode, claude-code, codex
|
|
46
|
+
docmind install --target opencode
|
|
47
|
+
docmind install --target claude-code
|
|
48
|
+
docmind install --target codex
|
|
49
|
+
docmind install --target generic # prints the JSON for any other agent
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Manual registration, if you prefer — the MCP server is a plain stdio process:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{ "docmind": { "command": "docmind-mcp", "env": { "DOCMIND_ROOT": "/path/to/your/docs" } } }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Everyday commands
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
docmind status # is the research engine up?
|
|
62
|
+
docmind doctor # full health check of the whole chain
|
|
63
|
+
docmind up / down # start / stop the background research engine
|
|
64
|
+
docmind search "query" # quick terminal search, no agent needed
|
|
65
|
+
docmind index # rebuild the search index after bulk-importing files
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## How your agent uses it
|
|
69
|
+
|
|
70
|
+
- *"Where is X documented?"* → `search` (free, instant)
|
|
71
|
+
- *"Summarize / compare / explain why..."* → `research` (LLM budget, saves the conclusion)
|
|
72
|
+
- *"Remember this: ..."* → `remember` (teaches your knowledge base)
|
|
73
|
+
|
|
74
|
+
Each tool call accepts an optional `root` parameter to target a different folder — one docmind instance can serve multiple knowledge bases.
|
|
75
|
+
|
|
76
|
+
## How it works
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Agent ──MCP stdio── docmind
|
|
80
|
+
├── search → zvec-grep (BM25 + vectors + ripgrep, local index in <root>/.zvec-grep)
|
|
81
|
+
├── research → Sirchmunk (budgeted LLM evidence exploration, http://127.0.0.1:8584)
|
|
82
|
+
└── remember → markdown notes in <root>/.knowledge/ (frontmatter-tagged, git-friendly)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- Retrieval is fully local; only `research` calls your LLM, with a hard token budget per query.
|
|
86
|
+
- Knowledge notes are plain markdown — readable, editable, versionable.
|
|
87
|
+
- Hidden folders (`.zvec-grep/`, `.knowledge/`) are indexed for search but excluded from research scans.
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
| File | Purpose |
|
|
92
|
+
|------|---------|
|
|
93
|
+
| `~/.docmind/config.json` | default knowledge root, service URL, timeouts |
|
|
94
|
+
| `~/.sirchmunk/.env` | `LLM_API_KEY`, `LLM_BASE_URL`, `LLM_MODEL_NAME` |
|
|
95
|
+
|
|
96
|
+
Environment variables (`DOCMIND_ROOT`, `SIRCHMUNK_URL`) override config values.
|
|
97
|
+
|
|
98
|
+
## Requirements
|
|
99
|
+
|
|
100
|
+
- Node.js >= 18.17
|
|
101
|
+
- Python 3.10+ with pip (for the research engine)
|
|
102
|
+
- Linux x64 or macOS (automatic ripgrep-all install currently covers linux/x64; on macOS run `brew install ripgrep-all`)
|
|
103
|
+
|
|
104
|
+
## Sources
|
|
105
|
+
|
|
106
|
+
Built on two Apache-2.0 engines:
|
|
107
|
+
|
|
108
|
+
- [zvec-grep](https://github.com/zvec-ai/zvec-grep) — local hybrid retrieval
|
|
109
|
+
- [Sirchmunk](https://github.com/modelscope/sirchmunk) — indexless agentic search (LENS)
|