@arabold/docs-mcp-server 1.33.1 → 1.34.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/README.md +66 -38
- package/db/migrations/000-initial-schema.sql +1 -1
- package/dist/index.js +4954 -4396
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Grounded Docs: Your AI's Up-to-Date Documentation Expert
|
|
2
2
|
|
|
3
|
+
The open-source alternative to **Context7**, **Nia**, and **Ref.Tools**.
|
|
4
|
+
|
|
3
5
|
AI coding assistants often struggle with outdated documentation and hallucinations. The **Docs MCP Server** solves this by providing a personal, always-current knowledge base for your AI. It **indexes 3rd party documentation** from various sources (websites, GitHub, npm, PyPI, local files) and offers powerful, version-aware search tools via the Model Context Protocol (MCP).
|
|
4
6
|
|
|
5
7
|
This enables your AI agent to access the **latest official documentation**, dramatically improving the quality and reliability of generated code and integration details. It's **free**, **open-source**, runs **locally** for privacy, and integrates seamlessly into your development workflow.
|
|
@@ -57,11 +59,14 @@ Run a standalone server that includes both MCP endpoints and web interface in a
|
|
|
57
59
|
```bash
|
|
58
60
|
docker run --rm \
|
|
59
61
|
-v docs-mcp-data:/data \
|
|
62
|
+
-v docs-mcp-config:/config \
|
|
60
63
|
-p 6280:6280 \
|
|
61
64
|
ghcr.io/arabold/docs-mcp-server:latest \
|
|
62
65
|
--protocol http --host 0.0.0.0 --port 6280
|
|
63
66
|
```
|
|
64
67
|
|
|
68
|
+
**Configuration:** The server writes its configuration to `/config/docs-mcp-server/config.yaml`. Mounting the `/config` volume ensures your settings persist across restarts.
|
|
69
|
+
|
|
65
70
|
**Optional:** Add `-e OPENAI_API_KEY="your-openai-api-key"` to enable vector search for improved results.
|
|
66
71
|
|
|
67
72
|
### Option 2: npx
|
|
@@ -146,6 +151,65 @@ Once a job completes, the docs are searchable via your AI assistant or the Web U
|
|
|
146
151
|
|
|
147
152
|
To stop the server, press `Ctrl+C`.
|
|
148
153
|
|
|
154
|
+
## Configuration overrides
|
|
155
|
+
|
|
156
|
+
- **Configuration Precedence**: Configuration is loaded in the following order (last one wins):
|
|
157
|
+
|
|
158
|
+
> For a complete reference of all configuration options, see the [Configuration Guide](docs/concepts/configuration.md).
|
|
159
|
+
|
|
160
|
+
1. **Defaults**: Built-in default values.
|
|
161
|
+
2. **Config File**: `config.json` or `config.yaml` in global store, project root, or current directory.
|
|
162
|
+
3. **Environment Variables**: Specific `DOCS_MCP_*` variables override file settings.
|
|
163
|
+
4. **CLI Arguments**: Command-line flags (e.g., `--port`) have the highest priority.
|
|
164
|
+
|
|
165
|
+
### Configuration File
|
|
166
|
+
|
|
167
|
+
You can create a `config.json` or `config.yaml` file to persist your settings. The server searches for this file in:
|
|
168
|
+
|
|
169
|
+
1. The path specified by `--config` (**Read-Only**).
|
|
170
|
+
2. The path specified by `DOCS_MCP_CONFIG` environment variable (**Read-Only**).
|
|
171
|
+
3. The system default configuration directory (**Read-Write**):
|
|
172
|
+
- **macOS**: `~/Library/Preferences/docs-mcp-server/config.yaml`
|
|
173
|
+
- **Linux**: `~/.config/docs-mcp-server/config.yaml` (or defined by `$XDG_CONFIG_HOME`)
|
|
174
|
+
- **Windows**: `%APPDATA%\docs-mcp-server\config\config.yaml`
|
|
175
|
+
|
|
176
|
+
> **Note:** On startup, if no explicit configuration file is provided, the server will seek the system default config. If present, it loads it. If missing, it creates it with default values. It will also update it with any new setting keys. If you provide a custom config via `--config` or env var, the server treats it as **Read-Only** and will NOT modify it or write defaults back to it.
|
|
177
|
+
|
|
178
|
+
**Example `config.yaml`:**
|
|
179
|
+
|
|
180
|
+
```yaml
|
|
181
|
+
server:
|
|
182
|
+
host: "0.0.0.0"
|
|
183
|
+
ports:
|
|
184
|
+
mcp: 9000
|
|
185
|
+
default: 8000
|
|
186
|
+
scraper:
|
|
187
|
+
maxPages: 500
|
|
188
|
+
pageTimeoutMs: 10000
|
|
189
|
+
splitter:
|
|
190
|
+
maxChunkSize: 2000
|
|
191
|
+
embeddings:
|
|
192
|
+
vectorDimension: 1536
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Environment Variables
|
|
196
|
+
|
|
197
|
+
Specific configuration options can be set via environment variables. These override values from the configuration file.
|
|
198
|
+
|
|
199
|
+
| Environment Variable | Config Path | Description |
|
|
200
|
+
| -------------------------- | ---------------------- | ----------------------------------------- |
|
|
201
|
+
| `DOCS_MCP_PROTOCOL` | `server.protocol` | Server protocol (`auto`, `stdio`, `http`) |
|
|
202
|
+
| `DOCS_MCP_HOST`, `HOST` | `server.host` | Host to bind the server to |
|
|
203
|
+
| `DOCS_MCP_PORT`, `PORT` | `server.ports.default` | Default server port |
|
|
204
|
+
| `DOCS_MCP_WEB_PORT` | `server.ports.web` | Web interface port |
|
|
205
|
+
| `DOCS_MCP_STORE_PATH` | `app.storePath` | Custom storage directory path |
|
|
206
|
+
| `DOCS_MCP_READ_ONLY` | `app.readOnly` | Enable read-only mode |
|
|
207
|
+
| `DOCS_MCP_AUTH_ENABLED` | `auth.enabled` | Enable authentication |
|
|
208
|
+
| `DOCS_MCP_AUTH_ISSUER_URL` | `auth.issuerUrl` | OIDC Issuer URL |
|
|
209
|
+
| `DOCS_MCP_AUTH_AUDIENCE` | `auth.audience` | JWT Audience |
|
|
210
|
+
| `DOCS_MCP_EMBEDDING_MODEL` | `app.embeddingModel` | Embedding model string |
|
|
211
|
+
| `DOCS_MCP_TELEMETRY` | `app.telemetryEnabled` | Enable/disable telemetry |
|
|
212
|
+
|
|
149
213
|
## Embedded Server
|
|
150
214
|
|
|
151
215
|
Run the MCP server directly embedded in your AI assistant without a separate process or web interface. This method provides MCP integration only.
|
|
@@ -319,45 +383,9 @@ docker compose up -d
|
|
|
319
383
|
|
|
320
384
|
This architecture allows independent scaling of processing (workers) and user interfaces.
|
|
321
385
|
|
|
322
|
-
##
|
|
323
|
-
|
|
324
|
-
The Docs MCP Server runs without any configuration and uses full-text search only. To enable vector search for improved results, configure an embedding provider via environment variables.
|
|
325
|
-
|
|
326
|
-
### Command Line Argument Overrides
|
|
327
|
-
|
|
328
|
-
Many CLI arguments can be overridden using environment variables. This is useful for Docker deployments, CI/CD pipelines, or setting default values.
|
|
329
|
-
|
|
330
|
-
| Environment Variable | CLI Argument | Description | Used by Commands |
|
|
331
|
-
| -------------------------- | ---------------------- | ----------------------------------------------- | ------------------------- |
|
|
332
|
-
| `DOCS_MCP_STORE_PATH` | `--store-path` | Custom path for data storage directory | all |
|
|
333
|
-
| `DOCS_MCP_TELEMETRY` | `--no-telemetry` | Disable telemetry (`false` to disable) | all |
|
|
334
|
-
| `DOCS_MCP_PROTOCOL` | `--protocol` | MCP server protocol (auto, stdio, http) | default, mcp |
|
|
335
|
-
| `DOCS_MCP_PORT` | `--port` | Server port | default, mcp, web, worker |
|
|
336
|
-
| `DOCS_MCP_WEB_PORT` | `--port` (web command) | Web interface port (web command only) | web |
|
|
337
|
-
| `PORT` | `--port` | Server port (fallback if DOCS_MCP_PORT not set) | default, mcp, web, worker |
|
|
338
|
-
| `DOCS_MCP_HOST` | `--host` | Server host/bind address | default, mcp, web, worker |
|
|
339
|
-
| `HOST` | `--host` | Server host (fallback if DOCS_MCP_HOST not set) | default, mcp, web, worker |
|
|
340
|
-
| `DOCS_MCP_EMBEDDING_MODEL` | `--embedding-model` | Embedding model configuration | default, mcp, web, worker |
|
|
341
|
-
| `DOCS_MCP_AUTH_ENABLED` | `--auth-enabled` | Enable OAuth2/OIDC authentication | default, mcp |
|
|
342
|
-
| `DOCS_MCP_AUTH_ISSUER_URL` | `--auth-issuer-url` | OAuth2 provider issuer/discovery URL | default, mcp |
|
|
343
|
-
| `DOCS_MCP_AUTH_AUDIENCE` | `--auth-audience` | JWT audience claim (resource identifier) | default, mcp |
|
|
344
|
-
|
|
345
|
-
**Usage Examples:**
|
|
346
|
-
|
|
347
|
-
```bash
|
|
348
|
-
# Set via environment variables
|
|
349
|
-
export DOCS_MCP_PORT=8080
|
|
350
|
-
export DOCS_MCP_HOST=0.0.0.0
|
|
351
|
-
export DOCS_MCP_EMBEDDING_MODEL=text-embedding-3-small
|
|
352
|
-
npx @arabold/docs-mcp-server@latest
|
|
353
|
-
|
|
354
|
-
# Override with CLI arguments (takes precedence)
|
|
355
|
-
DOCS_MCP_PORT=8080 npx @arabold/docs-mcp-server@latest --port 9090
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
### Embedding Provider Configuration
|
|
386
|
+
## Embeddings
|
|
359
387
|
|
|
360
|
-
|
|
388
|
+
Set the embedding model with YAML (`embeddings.model`), `DOCS_MCP_EMBEDDING_MODEL`, or `--embedding-model`. If you leave the model empty but provide `OPENAI_API_KEY`, the server defaults to `text-embedding-3-small`. Provider credentials use the provider-specific environment variables below.
|
|
361
389
|
|
|
362
390
|
| Variable | Description |
|
|
363
391
|
| ---------------------------------- | ----------------------------------------------------- |
|
|
@@ -18,7 +18,7 @@ CREATE INDEX IF NOT EXISTS idx_documents_version_lower ON documents(lower(librar
|
|
|
18
18
|
|
|
19
19
|
-- Create Embeddings virtual table
|
|
20
20
|
-- Note: Dimension is hardcoded here based on the value in schema.ts at the time of creation.
|
|
21
|
-
-- If
|
|
21
|
+
-- If EMBEDDINGS_VECTOR_DIMENSION changes, a separate migration would be needed to update/recreate this table.
|
|
22
22
|
CREATE VIRTUAL TABLE IF NOT EXISTS documents_vec USING vec0(
|
|
23
23
|
library TEXT NOT NULL,
|
|
24
24
|
version TEXT NOT NULL,
|