关于 MCP-SERVER-DS
MCP-SERVER-DS 是一个演示如何与 DeepSeek 对话及使用 MCP 工具调用的项目。示例定义了 DeepSeek 聊天工具和用于演示工具执行的加法函数。
主要功能
- 01DeepSeek 聊天 API 工具
- 02加法工具示例
- 03MCP Inspector 演示
- 04Cline 扩展演示
适用场景
- 01通过工具体验 DeepSeek 聊天
- 02测试 MCP 工具调用
- 03使用 MCP Inspector 检查服务
- 04在 VSCode 的 Cline 扩展中试用
MCP 相关
该 MCP 服务提供 DeepSeek 聊天工具和加法工具。README 展示了通过 MCP Inspector 和 VSCode 中的 Cline 扩展使用它。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
MCP-SERVER-DS
一个 MCP 服务示例,用于说明如何与 deepseek 聊天,以及如何使用 MCP 工具调用。
MCP
MCP helps you build agents and complex workflows on top of LLMs. LLMs frequently need to integrate with data and tools, and MCP provides:
- A growing list of pre-built integrations that your LLM can directly plug into
- The flexibility to switch between LLM providers and vendors
- Best practices for securing your data within your infrastructure

MCP 工具
Tools are a powerful primitive in the Model Context Protocol (MCP) that enable servers to expose executable functionality to clients. Through tools, LLMs can interact with external systems, perform computations, and take actions in the real world.
代码
工具定义
// tools.ts
// define deepseek chat api
{
name: "ds_chat",
description: 'forward message to deepseek chat api.',
paramSchema: {
messages: z.array(
z.object({
role: z.enum(['user', 'assistant', 'system']).default('user'),
content: z.string()
})
)
},
cb: async (args) => {
const resp = await ds.request_chat(args.messages)
return {
content: [
{
type: 'text',
text: resp.choices[0].message.content
}
]
}
}
}
// define add() function
{
name: "add",
description: "a function that adds two numbers, with a WRONG result for testing.",
paramSchema: {
a: z.number(),
b: z.number()
},
cb: async ({a, b}) => {
return {
content: [
{
type: 'text',
text: `${a} + ${b} = ${a + b + 1}`
}
]
}
}
}
演示
使用 MCP Inspector
~/Code/mcp-server-ds>npm run inspect
> [email protected] inspect
> npx @modelcontextprotocol/inspector node dist/index.js
Starting MCP inspector...
⚙️ Proxy server listening on port 6277
🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀

使用 VSCode 中的 Cline 扩展

评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。