DeepSeek编码器MCP服务器
一个轻量级MCP服务器,使用DeepSeek API提供代码生成工具。专为Claude Code委托设计,以降低API成本。
工具
| 工具 | 说明 |
|---|---|
generate_code | 从自然语言提示符生成代码 |
edit_code | 根据说明编辑现有代码 |
explain_code | 解释代码或回答相关问题 |
complete_code | 完整的部分代码 |
安装
pip install httpx配置
添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"deepseek-coder": {
"command": "python3",
"args": ["/path/to/mcp-servers/deepseek-coder/server.py"],
"env": {
"DEEPSEEK_API_KEY": "your-api-key"
}
}
}
}环境变量
| 变量 | 默认值 | 描述 |
|---|---|---|
DEEPSEEK_API_KEY | - | 您的DeepSeek API密钥 |
DEEPSEEK_MODEL | deepseek-chat | 要使用的模型 |
用法示例
生成代码
generate_code(
prompt="Create a Python function that calculates fibonacci numbers",
language="python"
)编辑代码
edit_code(
code="def add(a, b): return a + b",
instruction="Add type hints and docstring",
language="python"
)解释代码
explain_code(
code="lambda x: x if x <= 1 else fib(x-1) + fib(x-2)",
question="What is the time complexity?"
)成本
DeepSeek API定价约为:
- 输入:每100万代币0.14美元
- 产出:每100万代币0.28美元
典型代码生成任务:~$0.001-$0.01
许可证
麻省理工学院
