11# mimir-mcp
22
3- MCP (Model Context Protocol) server that connects your AI coding assistant to the Mimir documentation RAG system. This allows AI assistants like Claude Code, VS Code extensions, or other MCP clients to query your ingested documentation directly .
3+ MCP (Model Context Protocol) server that connects your AI coding assistant to the Mimir documentation RAG system. This allows AI assistants like Claude Code, VS Code extensions, or other MCP clients to semantically search your ingested documentation.
44
55## What is MCP?
66
7- [ Model Context Protocol] ( https://modelcontextprotocol.io/ ) is an open protocol that enables AI assistants to securely access external data sources and tools. This MCP server exposes your Mimir documentation as a tool that AI assistants can use to answer questions based on your ingested docs .
7+ [ Model Context Protocol] ( https://modelcontextprotocol.io/ ) is an open protocol that enables AI assistants to securely access external data sources and tools. This MCP server exposes your Mimir documentation as a semantic search tool that AI assistants can use to find relevant documentation chunks .
88
99## Features
1010
11- - ** Documentation Query Tool** : Provides an ` askDocs ` tool that AI assistants can invoke
12- - ** Dynamic LLM Configuration** : Each MCP client can use its own LLM provider and API key
13- - ** No Server API Key Required** : Bypasses mimir-rag's ` MIMIR_SERVER_API_KEY ` authentication
14- - ** Configurable Parameters** : Supports custom match count, similarity threshold, and system prompts
11+ - ** Documentation Search Tool** : Provides an ` askDocs ` tool that AI assistants can invoke
12+ - ** Zero Configuration** : No API keys or environment variables needed - just install via npm
13+ - ** No Authentication Required** : Bypasses mimir-rag's ` MIMIR_SERVER_API_KEY ` authentication
14+ - ** Fast and Cost-Effective** : Skips additional LLM calls - returns document chunks directly
15+ - ** Configurable Parameters** : Supports custom match count and similarity threshold
1516
1617## Installation
1718
18- 1 . Navigate to the ` mimir-mcp ` directory:
19+ ### Option 1: Install from npm (Recommended)
20+
21+ Once published to npm, users can install and use the MCP server without any local setup:
22+
23+ 1 . Open VS Code Command Palette (` Cmd+Shift+P ` on macOS or ` Ctrl+Shift+P ` on Windows/Linux)
24+ 2 . Search for and select ** "MCP: Open User Configuration"**
25+ 3 . Add the following configuration:
26+
27+ ``` json
28+ {
29+ "mcpServers" : {
30+ "mimir" : {
31+ "command" : " npx" ,
32+ "args" : [" -y" , " @your-org/mimir-mcp" ]
33+ }
34+ }
35+ }
36+ ```
37+
38+ ** Note** : Replace ` @your-org/mimir-mcp ` with the actual npm package name once published.
39+
40+ 4 . Restart VS Code or reload the MCP extension
41+
42+ The MCP server is pre-configured to use the production backend URL - no additional configuration needed!
43+
44+ ### Option 2: Local Development
45+
46+ For local development and testing:
47+
48+ 1 . Clone the repository and navigate to the ` mimir-mcp ` directory:
1949 ``` bash
2050 cd mimir-mcp
2151 ```
@@ -25,123 +55,106 @@ MCP (Model Context Protocol) server that connects your AI coding assistant to th
2555 npm install
2656 ```
2757
28- 3 . Build the project:
58+ 3 . Modify ` MIMIR_API_URL ` in ` src/index.ts ` to point to your local backend:
59+ ``` typescript
60+ const MIMIR_API_URL = " http://localhost:3000" ;
61+ ```
62+
63+ 4 . Build the project:
2964 ``` bash
3065 npm run build
3166 ```
3267
33- ## Configuration for VS Code (Claude Code, Cline, etc.)
68+ 5 . Configure in VS Code:
69+ ``` json
70+ {
71+ "mcpServers" : {
72+ "mimir" : {
73+ "command" : " node" ,
74+ "args" : [" /absolute/path/to/mimir/mimir-mcp/dist/index.js" ]
75+ }
76+ }
77+ }
78+ ```
3479
35- ### Step 1: Build the MCP Server
80+ 6 . Restart VS Code or reload the MCP extension
3681
37- Make sure you've built the project:
82+ ## Configuration for Claude Desktop
3883
39- ``` bash
40- npm run build
41- ```
84+ ** macOS** : ` ~/Library/Application Support/Claude/claude_desktop_config.json `
4285
43- ### Step 2: Configure MCP in VS Code
86+ ** Windows ** : ` %APPDATA%\Claude\claude_desktop_config.json `
4487
45- 1 . Open VS Code Command Palette (` Cmd+Shift+P ` on macOS or ` Ctrl+Shift+P ` on Windows/Linux)
46- 2 . Search for and select ** "MCP: Open User Configuration"**
47- 3 . Add the following configuration to the JSON file that opens:
88+ ### Option 1: Using npm package (Recommended)
4889
4990``` json
5091{
5192 "mcpServers" : {
5293 "mimir" : {
53- "command" : " node" ,
54- "args" : [" /absolute/path/to/mimir/mimir-mcp/dist/index.js" ],
55- "env" : {
56- "MIMIR_API_URL" : " http://localhost:3000" ,
57- "MIMIR_PROVIDER" : " anthropic" ,
58- "MIMIR_MODEL" : " claude-3-5-sonnet-20241022" ,
59- "MIMIR_API_KEY" : " your-api-key-here"
60- }
94+ "command" : " npx" ,
95+ "args" : [" -y" , " @your-org/mimir-mcp" ]
6196 }
6297 }
6398}
6499```
65100
66- ** Important** : Replace ` /absolute/path/to/mimir ` with the actual absolute path to your mimir project directory.
67-
68- ### Step 3: Restart VS Code or Reload the MCP Extension
69-
70- After saving the configuration, restart VS Code or reload the MCP extension to apply the changes.
71-
72- ### Configuration Parameters
101+ ** Note** : Replace ` @your-org/mimir-mcp ` with the actual npm package name once published.
73102
74- The ` env ` object accepts the following parameters:
75-
76- - ** MIMIR_API_URL** (optional): URL of your mimir-rag server. Default: ` http://localhost:3000 `
77- - ** MIMIR_PROVIDER** (required): LLM provider name (` openai ` , ` anthropic ` , ` google ` , ` mistral ` )
78- - ** MIMIR_MODEL** (required): Model identifier (e.g., ` claude-3-5-sonnet-20241022 ` , ` gpt-4 ` , etc.)
79- - ** MIMIR_API_KEY** (required): API key for your chosen LLM provider
80-
81- ## Configuration for Claude Desktop
82-
83- To use this MCP server with Claude Desktop, add it to your Claude Desktop configuration file:
84-
85- ** macOS** : ` ~/Library/Application Support/Claude/claude_desktop_config.json `
86-
87- ** Windows** : ` %APPDATA%\Claude\claude_desktop_config.json `
103+ ### Option 2: Local development
88104
89105``` json
90106{
91107 "mcpServers" : {
92108 "mimir" : {
93109 "command" : " node" ,
94- "args" : [" /absolute/path/to/mimir/mimir-mcp/dist/index.js" ],
95- "env" : {
96- "MIMIR_API_URL" : " http://localhost:3000" ,
97- "MIMIR_PROVIDER" : " anthropic" ,
98- "MIMIR_MODEL" : " claude-3-5-sonnet-20241022" ,
99- "MIMIR_API_KEY" : " your-api-key-here"
100- }
110+ "args" : [" /absolute/path/to/mimir/mimir-mcp/dist/index.js" ]
101111 }
102112 }
103113}
104114```
105115
116+ ** Note** : For local development, remember to modify ` MIMIR_API_URL ` in ` src/index.ts ` to ` http://localhost:3000 ` .
117+
106118## Using the askDocs Tool
107119
108120Once configured, the AI assistant will have access to an ` askDocs ` tool. You can ask questions like:
109121
110- - "Use askDocs to find out how to implement authentication"
111- - "Check the docs for API endpoint examples"
122+ - "Find documentation about authentication implementation "
123+ - "Search the docs for API endpoint examples"
112124- "What does the documentation say about error handling?"
113125
126+ The AI assistant will automatically invoke ` askDocs ` , retrieve relevant documentation chunks, and synthesize an answer for you.
127+
114128The tool accepts these parameters:
115129
116- - ** question** (required): Your documentation question
130+ - ** question** (required): Your documentation search query
117131- ** matchCount** (optional): Number of document chunks to retrieve (default: 10)
118132- ** similarityThreshold** (optional): Minimum similarity score (default: 0.2)
119- - ** systemPrompt** (optional): Custom system prompt to guide the AI's response
120133
121134## How It Works
122135
1231361 . The MCP server registers an ` askDocs ` tool with the AI assistant
124- 2 . When invoked, it sends a request to the mimir-rag server 's ` /mcp/ask ` endpoint
125- 3 . The request includes the question and your configured LLM credentials
126- 4 . mimir-rag retrieves relevant documentation chunks and generates an answer using your LLM
127- 5 . The answer is returned to the AI assistant, which can use it to help you
137+ 2 . When invoked, it sends a request to the mimir-rag backend 's ` /mcp/ask ` endpoint
138+ 3 . mimir-rag performs semantic search using OpenAI embeddings
139+ 4 . Relevant documentation chunks with content and metadata are returned
140+ 5 . The AI assistant synthesizes an answer based on the retrieved content
128141
129142## Prerequisites
130143
131- - A running [ mimir-rag] ( ../mimir-rag ) server with ingested documentation
144+ - A hosted [ mimir-rag] ( ../mimir-rag ) backend with ingested documentation (or running locally for testing)
132145- Node.js 20 or later
133146- An AI assistant that supports MCP (Claude Code, Cline, Claude Desktop, etc.)
134- - API key for your chosen LLM provider
135147
136148## Troubleshooting
137149
138150### Connection Issues
139151
140152If the MCP server can't connect to mimir-rag:
141153
142- 1 . Verify your mimir-rag server is running : ` curl http ://localhost:3000 /health `
143- 2 . Check the ` MIMIR_API_URL ` in your MCP configuration
154+ 1 . Verify the mimir-rag backend is accessible : ` curl https ://your-backend.com /health `
155+ 2 . For local development, ensure you've modified ` MIMIR_API_URL ` in ` src/index.ts ` to ` http://localhost:3000 `
1441563 . Ensure there are no firewall or network issues
157+ 4 . For local testing, verify the backend is running on the correct port
145158
146159### AI Assistant Not Seeing the Tool
147160
@@ -151,11 +164,11 @@ If the MCP server can't connect to mimir-rag:
1511644 . Open Command Palette and verify MCP configuration was saved correctly
1521655 . Check the AI assistant's MCP logs for errors
153166
154- ### API Key Issues
167+ ### Empty Results
155168
156- 1 . Verify your ` MIMIR_API_KEY ` is valid for the specified provider
157- 2 . Check you have sufficient quota/credits with your LLM provider
158- 3 . Ensure the ` MIMIR_PROVIDER ` and ` MIMIR_MODEL ` match your API key
169+ 1 . Verify your mimir-rag server has ingested documentation
170+ 2 . Check the embeddings were created successfully during ingestion
171+ 3 . Try lowering the ` similarityThreshold ` parameter for broader matches
159172
160173## Development
161174
@@ -172,13 +185,11 @@ The build process uses `tsup` to compile TypeScript to ESM format.
172185While this is primarily designed as an MCP server, you can also run it standalone for testing:
173186
174187``` bash
175- # Set environment variables
176- export MIMIR_API_URL=http://localhost:3000
177- export MIMIR_PROVIDER=anthropic
178- export MIMIR_MODEL=claude-3-5-sonnet-20241022
179- export MIMIR_API_KEY=your-api-key-here
188+ # For local testing, first modify MIMIR_API_URL in src/index.ts to:
189+ # const MIMIR_API_URL = "http://localhost:3000";
180190
181- # Run the server
191+ # Then rebuild and run
192+ npm run build
182193node dist/index.js
183194```
184195
0 commit comments