基本能力
产品定位
mcp-server-dify 是一个为 Dify AI 设计的模型上下文协议服务器,旨在通过标准化协议实现大型语言模型(LLMs)与 Dify AI 的交互。
核心功能
- 与 Dify AI 聊天完成 API 的集成
- 餐厅推荐工具(meshi-doko)
- 支持对话上下文
- 流式响应支持
- TypeScript 实现
适用场景
- 开发者在需要集成 Dify AI 聊天完成功能的项目中
- 需要餐厅推荐功能的应用程序
- 需要流式响应和上下文支持的聊天应用
工具列表
meshi-doko
餐厅推荐工具,与 Dify AI 交互:
- 参数:
- LOCATION
(string): 餐厅位置
- BUDGET
(string): 预算限制
- query
(string): 发送给 Dify AI 的查询
- conversation_id
(string, optional): 用于维护聊天上下文
常见问题解答
- 安全性:确保 API 密钥安全,使用 HTTPS 端点,不要将 API 密钥提交到版本控制。
- 贡献:欢迎提交 Pull Request 进行贡献。
使用教程
使用依赖
确保已安装 Node.js 和 npm。
安装教程
使用 npm 安装:
bash
npm install @modelcontextprotocol/server-dify
调试方式
安装完成后,可以通过以下命令进行开发和调试:
```bash
初始设置
make setup
构建项目
make build
格式化代码
make format
运行 linter
make lint
```
使用示例
在 claude_desktop_config.json
中添加以下配置:
json
{
"mcpServers": {
"dify": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dify",
"https://your-dify-api-endpoint",
"your-dify-api-key"
]
}
}
}
替换 your-dify-api-endpoint
和 your-dify-api-key
为实际的 Dify API 凭证。