You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(#26): support OpenAI API base URL and model name config
- Added OPENAI_API_BASE support for custom API endpoints
- Renamed EMBEDDING_MODEL_NAME to DOCS_MCP_EMBEDDING_MODEL for clarity
- Updated documentation with environment variable descriptions
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,19 @@ The server exposes MCP tools for:
26
26
- Finding appropriate versions (`find_version`).
27
27
- Removing indexed documents (`remove_docs`).
28
28
29
+
## Configuration
30
+
31
+
The following environment variables are supported to configure the OpenAI API and embedding behavior:
32
+
33
+
-`OPENAI_API_KEY`: **Required.** Your OpenAI API key for generating embeddings.
34
+
-`OPENAI_ORG_ID`: **Optional.** Your OpenAI Organization ID (handled automatically by LangChain if set).
35
+
-`OPENAI_API_BASE`: **Optional.** Custom base URL for OpenAI API (e.g., for Azure OpenAI or compatible APIs).
36
+
-`DOCS_MCP_EMBEDDING_MODEL`: **Optional.** Embedding model name (defaults to "text-embedding-3-small"). Must produce vectors with ≤1536 dimensions. Smaller dimensions are automatically padded with zeros.
37
+
38
+
The database schema uses a fixed dimension of 1536 for embedding vectors. Models that produce larger vectors are not supported and will cause an error. Models with smaller vectors (e.g., older embedding models) are automatically padded with zeros to match the required dimension.
39
+
40
+
These variables can be set regardless of how you run the server (Docker, npx, or from source).
41
+
29
42
## Running the MCP Server
30
43
31
44
There are two ways to run the docs-mcp-server:
@@ -76,6 +89,17 @@ This is the recommended approach for most users. It's easy, straightforward, and
76
89
-`-e OPENAI_API_KEY`: **Required.** Set your OpenAI API key.
77
90
-`-v docs-mcp-data:/data`: **Required for persistence.** Mounts a Docker named volume `docs-mcp-data` to store the database. You can replace with a specific host path if preferred (e.g., `-v /path/on/host:/data`).
78
91
92
+
Any of the configuration environment variables (see [Configuration](#configuration) above) can be passed to the container using the `-e` flag. For example:
This approach is recommended when you need local file access (e.g., indexing documentation from your local file system). While this can also be achieved by mounting paths into a Docker container, using npx is simpler but requires a Node.js installation.
@@ -122,7 +146,7 @@ docker run --rm \
122
146
docs-cli <command> [options]
123
147
```
124
148
125
-
Make sure to use the same volume name (`docs-mcp-data` in this example) as you did for the server.
149
+
Make sure to use the same volume name (`docs-mcp-data` in this example) as you did for the server. Any of the configuration environment variables (see [Configuration](#configuration) above) can be passed using `-e` flags, just like with the server.
126
150
127
151
### Using npx CLI
128
152
@@ -339,6 +363,16 @@ This method is useful for contributing to the project or running un-published ve
339
363
# Required: Your OpenAI API key for generating embeddings.
340
364
OPENAI_API_KEY=your-api-key-here
341
365
366
+
# Optional: Your OpenAI Organization ID (handled automatically by LangChain if set)
367
+
OPENAI_ORG_ID=
368
+
369
+
# Optional: Custom base URL for OpenAI API (e.g., for Azure OpenAI or compatible APIs)
370
+
OPENAI_API_BASE=
371
+
372
+
# Optional: Embedding model name (defaults to "text-embedding-3-small")
0 commit comments