@arikusi/deepseek-mcp-server 1.0.2 → 1.1.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/CHANGELOG.md +142 -79
- package/LICENSE +21 -21
- package/README.md +469 -354
- package/dist/config.d.ts +42 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +63 -0
- package/dist/config.js.map +1 -0
- package/dist/cost.d.ts +24 -0
- package/dist/cost.d.ts.map +1 -0
- package/dist/cost.js +34 -0
- package/dist/cost.js.map +1 -0
- package/dist/deepseek-client.d.ts +2 -3
- package/dist/deepseek-client.d.ts.map +1 -1
- package/dist/deepseek-client.js +72 -13
- package/dist/deepseek-client.js.map +1 -1
- package/dist/index.js +517 -38
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +258 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +56 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +57 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +69 -63
package/README.md
CHANGED
|
@@ -1,354 +1,469 @@
|
|
|
1
|
-
# DeepSeek MCP Server
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@arikusi/deepseek-mcp-server)
|
|
4
|
-
[](https://www.npmjs.com/package/@arikusi/deepseek-mcp-server)
|
|
5
|
-
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://nodejs.org/)
|
|
7
|
-
[](https://www.typescriptlang.org/)
|
|
8
|
-
[](https://github.com/arikusi/deepseek-mcp-server/actions)
|
|
9
|
-
|
|
10
|
-
A Model Context Protocol (MCP) server that integrates DeepSeek AI models with MCP-compatible clients. Access DeepSeek's powerful chat and reasoning models directly from your development environment.
|
|
11
|
-
|
|
12
|
-
**Compatible with:**
|
|
13
|
-
- Claude Code CLI
|
|
14
|
-
- Gemini CLI (if MCP support is available)
|
|
15
|
-
- Any MCP-compatible client
|
|
16
|
-
|
|
17
|
-
>
|
|
18
|
-
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
### For Claude Code
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
# Install and configure with API key (available in all projects)
|
|
25
|
-
claude mcp add -s user deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
26
|
-
|
|
27
|
-
# Or install for current project only
|
|
28
|
-
claude mcp add deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Scope options:**
|
|
32
|
-
- `-s user`: Available in all your projects (recommended)
|
|
33
|
-
- `-s local`: Only in current project (default)
|
|
34
|
-
- `-s project`: Project-specific `.mcp.json` file
|
|
35
|
-
|
|
36
|
-
### For Gemini CLI
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Install and configure with API key
|
|
40
|
-
gemini mcp add deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Get your API key:** [https://platform.deepseek.com](https://platform.deepseek.com)
|
|
44
|
-
|
|
45
|
-
That's it! Your MCP client can now use DeepSeek models!
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Features
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
###
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- `
|
|
141
|
-
- `
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
**
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
1
|
+
# DeepSeek MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@arikusi/deepseek-mcp-server)
|
|
4
|
+
[](https://www.npmjs.com/package/@arikusi/deepseek-mcp-server)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
[](https://github.com/arikusi/deepseek-mcp-server/actions)
|
|
9
|
+
|
|
10
|
+
A Model Context Protocol (MCP) server that integrates DeepSeek AI models with MCP-compatible clients. Access DeepSeek's powerful chat and reasoning models directly from your development environment.
|
|
11
|
+
|
|
12
|
+
**Compatible with:**
|
|
13
|
+
- Claude Code CLI
|
|
14
|
+
- Gemini CLI (if MCP support is available)
|
|
15
|
+
- Any MCP-compatible client
|
|
16
|
+
|
|
17
|
+
> **Note**: This is an unofficial community project and is not affiliated with DeepSeek.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### For Claude Code
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Install and configure with API key (available in all projects)
|
|
25
|
+
claude mcp add -s user deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
26
|
+
|
|
27
|
+
# Or install for current project only
|
|
28
|
+
claude mcp add deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Scope options:**
|
|
32
|
+
- `-s user`: Available in all your projects (recommended)
|
|
33
|
+
- `-s local`: Only in current project (default)
|
|
34
|
+
- `-s project`: Project-specific `.mcp.json` file
|
|
35
|
+
|
|
36
|
+
### For Gemini CLI
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Install and configure with API key
|
|
40
|
+
gemini mcp add deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Get your API key:** [https://platform.deepseek.com](https://platform.deepseek.com)
|
|
44
|
+
|
|
45
|
+
That's it! Your MCP client can now use DeepSeek models!
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- **DeepSeek Chat**: Fast and capable general-purpose model
|
|
52
|
+
- **DeepSeek Reasoner (R1)**: Advanced reasoning with chain-of-thought explanations
|
|
53
|
+
- **Function Calling**: OpenAI-compatible tool use with up to 128 tool definitions
|
|
54
|
+
- **Cost Tracking**: Automatic cost calculation for every request (USD)
|
|
55
|
+
- **Configurable**: Environment-based configuration with validation
|
|
56
|
+
- **12 Prompt Templates**: Pre-built templates for debugging, code review, function calling, and more
|
|
57
|
+
- **Streaming Support**: Real-time response generation
|
|
58
|
+
- **Tested**: 85 tests with 80%+ code coverage
|
|
59
|
+
- **Type-Safe**: Full TypeScript implementation
|
|
60
|
+
- **MCP Compatible**: Works with any MCP-compatible CLI (Claude Code, Gemini CLI, etc.)
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
### Prerequisites
|
|
65
|
+
|
|
66
|
+
- Node.js 18+
|
|
67
|
+
- A DeepSeek API key (get one at [https://platform.deepseek.com](https://platform.deepseek.com))
|
|
68
|
+
|
|
69
|
+
### Manual Installation
|
|
70
|
+
|
|
71
|
+
If you prefer to install manually:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install -g @arikusi/deepseek-mcp-server
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### From Source
|
|
78
|
+
|
|
79
|
+
1. **Clone the repository**
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git clone https://github.com/arikusi/deepseek-mcp-server.git
|
|
83
|
+
cd deepseek-mcp-server
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. **Install dependencies**
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. **Build the project**
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm run build
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage
|
|
99
|
+
|
|
100
|
+
Once configured, your MCP client will have access to the `deepseek_chat` tool and can use DeepSeek models.
|
|
101
|
+
|
|
102
|
+
**Example prompts:**
|
|
103
|
+
```
|
|
104
|
+
"Use DeepSeek to explain quantum computing"
|
|
105
|
+
"Ask DeepSeek Reasoner to solve: If I have 10 apples and buy 5 more..."
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Your MCP client will automatically call the `deepseek_chat` tool.
|
|
109
|
+
|
|
110
|
+
### Manual Configuration (Advanced)
|
|
111
|
+
|
|
112
|
+
If your MCP client doesn't support the `add` command, manually add to your config file:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"deepseek": {
|
|
118
|
+
"command": "npx",
|
|
119
|
+
"args": ["@arikusi/deepseek-mcp-server"],
|
|
120
|
+
"env": {
|
|
121
|
+
"DEEPSEEK_API_KEY": "your-api-key-here"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Config file locations:**
|
|
129
|
+
- **Claude Code**: `~/.claude.json` (add to `projects["your-project-path"].mcpServers` section)
|
|
130
|
+
- **Other MCP clients**: Check your client's documentation for config file location
|
|
131
|
+
|
|
132
|
+
## Available Tools
|
|
133
|
+
|
|
134
|
+
### `deepseek_chat`
|
|
135
|
+
|
|
136
|
+
Chat with DeepSeek AI models with automatic cost tracking and function calling support.
|
|
137
|
+
|
|
138
|
+
**Parameters:**
|
|
139
|
+
|
|
140
|
+
- `messages` (required): Array of conversation messages
|
|
141
|
+
- `role`: "system" | "user" | "assistant" | "tool"
|
|
142
|
+
- `content`: Message text
|
|
143
|
+
- `tool_call_id` (optional): Required for tool role messages
|
|
144
|
+
- `model` (optional): "deepseek-chat" (default) or "deepseek-reasoner"
|
|
145
|
+
- `temperature` (optional): 0-2, controls randomness (default: 1.0)
|
|
146
|
+
- `max_tokens` (optional): Maximum tokens to generate
|
|
147
|
+
- `stream` (optional): Enable streaming mode (default: false)
|
|
148
|
+
- `tools` (optional): Array of tool definitions for function calling (max 128)
|
|
149
|
+
- `tool_choice` (optional): "auto" | "none" | "required" | `{type: "function", function: {name: "..."}}`
|
|
150
|
+
|
|
151
|
+
**Response includes:**
|
|
152
|
+
- Content with formatting
|
|
153
|
+
- Function call results (if tools were used)
|
|
154
|
+
- Request information (tokens, model, cost in USD)
|
|
155
|
+
- Structured data with `cost_usd` and `tool_calls` fields
|
|
156
|
+
|
|
157
|
+
**Example:**
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"messages": [
|
|
162
|
+
{
|
|
163
|
+
"role": "user",
|
|
164
|
+
"content": "Explain the theory of relativity in simple terms"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"model": "deepseek-chat",
|
|
168
|
+
"temperature": 0.7,
|
|
169
|
+
"max_tokens": 1000
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**DeepSeek Reasoner Example:**
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"messages": [
|
|
178
|
+
{
|
|
179
|
+
"role": "user",
|
|
180
|
+
"content": "If I have 10 apples and eat 3, then buy 5 more, how many do I have?"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"model": "deepseek-reasoner"
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The reasoner model will show its thinking process in `<thinking>` tags followed by the final answer.
|
|
188
|
+
|
|
189
|
+
**Function Calling Example:**
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"messages": [
|
|
194
|
+
{
|
|
195
|
+
"role": "user",
|
|
196
|
+
"content": "What's the weather in Istanbul?"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"tools": [
|
|
200
|
+
{
|
|
201
|
+
"type": "function",
|
|
202
|
+
"function": {
|
|
203
|
+
"name": "get_weather",
|
|
204
|
+
"description": "Get current weather for a location",
|
|
205
|
+
"parameters": {
|
|
206
|
+
"type": "object",
|
|
207
|
+
"properties": {
|
|
208
|
+
"location": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"description": "City name"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"required": ["location"]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"tool_choice": "auto"
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
When the model decides to call a function, the response includes `tool_calls` with the function name and arguments. You can then send the result back using a `tool` role message with the matching `tool_call_id`.
|
|
223
|
+
|
|
224
|
+
## Available Prompts
|
|
225
|
+
|
|
226
|
+
Pre-built prompt templates for common tasks (12 total):
|
|
227
|
+
|
|
228
|
+
### Core Reasoning
|
|
229
|
+
- **debug_with_reasoning**: Debug code with step-by-step analysis
|
|
230
|
+
- **code_review_deep**: Comprehensive code review (security, performance, quality)
|
|
231
|
+
- **research_synthesis**: Research topics and create structured reports
|
|
232
|
+
- **strategic_planning**: Create strategic plans with reasoning
|
|
233
|
+
- **explain_like_im_five**: Explain complex topics in simple terms
|
|
234
|
+
|
|
235
|
+
### Advanced
|
|
236
|
+
- **mathematical_proof**: Prove mathematical statements rigorously
|
|
237
|
+
- **argument_validation**: Analyze arguments for logical fallacies
|
|
238
|
+
- **creative_ideation**: Generate creative ideas with feasibility analysis
|
|
239
|
+
- **cost_comparison**: Compare LLM costs for tasks
|
|
240
|
+
- **pair_programming**: Interactive coding with explanations
|
|
241
|
+
|
|
242
|
+
### Function Calling
|
|
243
|
+
- **function_call_debug**: Debug function calling issues with tool definitions and messages
|
|
244
|
+
- **create_function_schema**: Generate JSON Schema for function calling from natural language
|
|
245
|
+
|
|
246
|
+
Each prompt is optimized for the DeepSeek Reasoner model to provide detailed reasoning.
|
|
247
|
+
|
|
248
|
+
## Models
|
|
249
|
+
|
|
250
|
+
### deepseek-chat
|
|
251
|
+
|
|
252
|
+
- **Best for**: General conversations, coding, content generation
|
|
253
|
+
- **Speed**: Fast
|
|
254
|
+
- **Context**: 64K tokens
|
|
255
|
+
- **Cost**: Most economical
|
|
256
|
+
|
|
257
|
+
### deepseek-reasoner (R1)
|
|
258
|
+
|
|
259
|
+
- **Best for**: Complex reasoning, math, logic problems, multi-step tasks
|
|
260
|
+
- **Speed**: Slower (shows thinking process)
|
|
261
|
+
- **Context**: 64K tokens
|
|
262
|
+
- **Special**: Provides chain-of-thought reasoning
|
|
263
|
+
- **Output**: Both reasoning process and final answer
|
|
264
|
+
|
|
265
|
+
## Configuration
|
|
266
|
+
|
|
267
|
+
The server is configured via environment variables. All settings except `DEEPSEEK_API_KEY` are optional.
|
|
268
|
+
|
|
269
|
+
| Variable | Default | Description |
|
|
270
|
+
|----------|---------|-------------|
|
|
271
|
+
| `DEEPSEEK_API_KEY` | (required) | Your DeepSeek API key |
|
|
272
|
+
| `DEEPSEEK_BASE_URL` | `https://api.deepseek.com` | Custom API endpoint |
|
|
273
|
+
| `SHOW_COST_INFO` | `true` | Show cost info in responses |
|
|
274
|
+
| `REQUEST_TIMEOUT` | `60000` | Request timeout in milliseconds |
|
|
275
|
+
| `MAX_RETRIES` | `2` | Maximum retry count for failed requests |
|
|
276
|
+
|
|
277
|
+
**Example with custom config:**
|
|
278
|
+
```bash
|
|
279
|
+
claude mcp add -s user deepseek npx @arikusi/deepseek-mcp-server \
|
|
280
|
+
-e DEEPSEEK_API_KEY=your-key \
|
|
281
|
+
-e SHOW_COST_INFO=false \
|
|
282
|
+
-e REQUEST_TIMEOUT=30000
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Development
|
|
286
|
+
|
|
287
|
+
### Project Structure
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
deepseek-mcp-server/
|
|
291
|
+
├── src/
|
|
292
|
+
│ ├── index.ts # Main MCP server, tool & prompt registration
|
|
293
|
+
│ ├── deepseek-client.ts # DeepSeek API wrapper (OpenAI SDK)
|
|
294
|
+
│ ├── config.ts # Centralized config with Zod validation
|
|
295
|
+
│ ├── cost.ts # Cost calculation and formatting
|
|
296
|
+
│ ├── schemas.ts # Zod input validation schemas
|
|
297
|
+
│ ├── types.ts # TypeScript type definitions
|
|
298
|
+
│ ├── config.test.ts # Config tests
|
|
299
|
+
│ ├── cost.test.ts # Cost tests
|
|
300
|
+
│ ├── schemas.test.ts # Schema validation tests
|
|
301
|
+
│ ├── deepseek-client.test.ts # Client tests
|
|
302
|
+
│ └── function-calling.test.ts # Function calling tests
|
|
303
|
+
├── dist/ # Compiled JavaScript
|
|
304
|
+
├── vitest.config.ts # Test configuration
|
|
305
|
+
├── package.json
|
|
306
|
+
├── tsconfig.json
|
|
307
|
+
└── README.md
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Building
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
npm run build
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Watch Mode (for development)
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
npm run watch
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Testing
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# Run all tests
|
|
326
|
+
npm test
|
|
327
|
+
|
|
328
|
+
# Watch mode
|
|
329
|
+
npm run test:watch
|
|
330
|
+
|
|
331
|
+
# With coverage report
|
|
332
|
+
npm run test:coverage
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Testing Locally
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# Set API key
|
|
339
|
+
export DEEPSEEK_API_KEY="your-key"
|
|
340
|
+
|
|
341
|
+
# Run the server
|
|
342
|
+
npm start
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
The server will start and wait for MCP client connections via stdio.
|
|
346
|
+
|
|
347
|
+
## Troubleshooting
|
|
348
|
+
|
|
349
|
+
### "DEEPSEEK_API_KEY environment variable is not set"
|
|
350
|
+
|
|
351
|
+
**Option 1: Use the correct installation command**
|
|
352
|
+
```bash
|
|
353
|
+
# Make sure to include -e flag with your API key
|
|
354
|
+
claude mcp add deepseek npx @arikusi/deepseek-mcp-server -e DEEPSEEK_API_KEY=your-key-here
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Option 2: Manually edit the config file**
|
|
358
|
+
|
|
359
|
+
If you already installed without the API key, edit your config file:
|
|
360
|
+
|
|
361
|
+
1. **For Claude Code**: Open `~/.claude.json` (Windows: `C:\Users\USERNAME\.claude.json`)
|
|
362
|
+
2. Find the `"mcpServers"` section under your project path
|
|
363
|
+
3. Add the `env` field with your API key:
|
|
364
|
+
```json
|
|
365
|
+
"deepseek": {
|
|
366
|
+
"type": "stdio",
|
|
367
|
+
"command": "npx",
|
|
368
|
+
"args": ["@arikusi/deepseek-mcp-server"],
|
|
369
|
+
"env": {
|
|
370
|
+
"DEEPSEEK_API_KEY": "your-api-key-here"
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
4. Save and restart Claude Code
|
|
375
|
+
|
|
376
|
+
### "Failed to connect to DeepSeek API"
|
|
377
|
+
|
|
378
|
+
1. Check your API key is valid
|
|
379
|
+
2. Verify you have internet connection
|
|
380
|
+
3. Check DeepSeek API status at [https://status.deepseek.com](https://status.deepseek.com)
|
|
381
|
+
|
|
382
|
+
### Server not appearing in your MCP client
|
|
383
|
+
|
|
384
|
+
1. Verify the path to `dist/index.js` is correct
|
|
385
|
+
2. Make sure you ran `npm run build`
|
|
386
|
+
3. Check your MCP client's logs for errors
|
|
387
|
+
4. Restart your MCP client completely
|
|
388
|
+
|
|
389
|
+
### Permission Denied on macOS/Linux
|
|
390
|
+
|
|
391
|
+
Make the file executable:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
chmod +x dist/index.js
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
## Publishing to npm
|
|
398
|
+
|
|
399
|
+
To share this MCP server with others:
|
|
400
|
+
|
|
401
|
+
1. Run `npm login`
|
|
402
|
+
2. Run `npm publish --access public`
|
|
403
|
+
|
|
404
|
+
Users can then install with:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
npm install -g @arikusi/deepseek-mcp-server
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
## Contributing
|
|
411
|
+
|
|
412
|
+
Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) before submitting PRs.
|
|
413
|
+
|
|
414
|
+
### Reporting Issues
|
|
415
|
+
|
|
416
|
+
Found a bug or have a feature request? Please [open an issue](https://github.com/arikusi/deepseek-mcp-server/issues/new/choose) using our templates.
|
|
417
|
+
|
|
418
|
+
### Development
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
# Clone the repo
|
|
422
|
+
git clone https://github.com/arikusi/deepseek-mcp-server.git
|
|
423
|
+
cd deepseek-mcp-server
|
|
424
|
+
|
|
425
|
+
# Install dependencies
|
|
426
|
+
npm install
|
|
427
|
+
|
|
428
|
+
# Build in watch mode
|
|
429
|
+
npm run watch
|
|
430
|
+
|
|
431
|
+
# Run tests
|
|
432
|
+
npm test
|
|
433
|
+
|
|
434
|
+
# Lint
|
|
435
|
+
npm run lint
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
## Changelog
|
|
439
|
+
|
|
440
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
|
|
441
|
+
|
|
442
|
+
## License
|
|
443
|
+
|
|
444
|
+
MIT License - see [LICENSE](LICENSE) file for details
|
|
445
|
+
|
|
446
|
+
## Support
|
|
447
|
+
|
|
448
|
+
- [Documentation](https://github.com/arikusi/deepseek-mcp-server#readme)
|
|
449
|
+
- [Bug Reports](https://github.com/arikusi/deepseek-mcp-server/issues)
|
|
450
|
+
- [Discussions](https://github.com/arikusi/deepseek-mcp-server/discussions)
|
|
451
|
+
- Contact: [GitHub Issues](https://github.com/arikusi/deepseek-mcp-server/issues)
|
|
452
|
+
|
|
453
|
+
## Resources
|
|
454
|
+
|
|
455
|
+
- [DeepSeek Platform](https://platform.deepseek.com) - Get your API key
|
|
456
|
+
- [Model Context Protocol](https://modelcontextprotocol.io) - MCP specification
|
|
457
|
+
- [DeepSeek API Documentation](https://api-docs.deepseek.com) - API reference
|
|
458
|
+
|
|
459
|
+
## Acknowledgments
|
|
460
|
+
|
|
461
|
+
- Built with [Model Context Protocol SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
462
|
+
- Uses [OpenAI SDK](https://github.com/openai/openai-node) for API compatibility
|
|
463
|
+
- Created for the MCP community
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
**Made by [@arikusi](https://github.com/arikusi)**
|
|
468
|
+
|
|
469
|
+
This is an unofficial community project and is not affiliated with DeepSeek.
|