mcp-flowise
mcp-flowise
是一个 Python 包,实现了与 Flowise API 集成的模型上下文协议 (MCP) 服务器。它提供了一种标准化且灵活的方式来列出聊天流、创建预测,并为 Flowise 聊天流或助手动态注册工具。
它支持两种操作模式:
- 低级模式(默认) :动态注册从 Flowise API 检索的所有聊天流的工具。
- FastMCP 模式:提供列出聊天流和创建预测的静态工具,适用于更简单的配置。
特征
- 动态工具暴露:低级模式为每个聊天流或助手动态创建工具。
- 更简单的配置:FastMCP 模式公开
list_chatflows
和create_prediction
工具以进行最少设置。 - 灵活过滤:两种模式都支持通过 ID 或名称(正则表达式)通过白名单和黑名单过滤聊天流。
- MCP 集成:无缝集成到 MCP 工作流程中。
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 mcp-flowise:
先决条件
- Python 3.12 或更高版本
uvx
包管理器
通过uvx
安装并运行
确认您可以使用uvx
直接从 GitHub 存储库运行服务器:
添加到 MCP 生态系统( mcpServers
配置)
您可以将mcp-flowise
添加到mcpServers
配置中,从而将其集成到您的 MCP 生态系统中。例如:
操作模式
1.FastMCP模式(简单模式)
通过设置FLOWISE_SIMPLE_MODE=true
启用。此模式:
- 公开两个工具:
list_chatflows
和create_prediction
。 - 允许使用
FLOWISE_CHATFLOW_ID
或FLOWISE_ASSISTANT_ID
进行静态配置。 - 通过
list_chatflows
列出所有可用的聊天流。
2. 低级模式(FLOWISE_SIMPLE_MODE=False)
特征:
- 将所有聊天流动态注册为单独的工具。
- 工具以聊天流程名称命名(规范化)。
- 使用来自
FLOWISE_CHATFLOW_DESCRIPTIONS
变量的描述,如果没有提供描述,则返回到聊天流名称。
例子:
my_tool(question: str) -> str
。
使用uvx
在 Windows 上运行
如果您在 Windows 上使用uvx
时遇到--from git+https
的问题,建议的解决方案是将仓库克隆到本地,并使用uvx.exe
和克隆仓库的完整路径配置mcpServers
。此外,请根据需要添加APPDATA
、 LOGLEVEL
和其他环境变量。
MCP 生态系统的示例配置(Windows 上的mcpServers
)
笔记
- 完整路径:对
uvx.exe
和克隆的存储库使用完整路径。 - 环境变量:如果需要,将
APPDATA
指向您的 Windows 用户配置文件(例如,C:\\Users\\<username>\\AppData\\Roaming
)。 - 日志级别:根据需要调整
LOGLEVEL
(ERROR
、INFO
、DEBUG
等)。
环境变量
一般的
FLOWISE_API_KEY
:您的 Flowise API Bearer 令牌(必需)。FLOWISE_API_ENDPOINT
:Flowise 的基本 URL(默认值:http://localhost:3010
)。
低级模式(默认)
FLOWISE_CHATFLOW_DESCRIPTIONS
:以逗号分隔的chatflow_id:description
对列表。例如:
FastMCP 模式( FLOWISE_SIMPLE_MODE=true
)
FLOWISE_CHATFLOW_ID
:单个聊天流 ID(可选)。FLOWISE_ASSISTANT_ID
:单个助手 ID(可选)。FLOWISE_CHATFLOW_DESCRIPTION
:针对所公开的单个工具的可选描述。
过滤聊天流
可以使用以下环境变量在两种模式下应用过滤器:
- 按 ID 加入白名单:
FLOWISE_WHITELIST_ID="id1,id2,id3"
- 按 ID 加入黑名单:
FLOWISE_BLACKLIST_ID="id4,id5"
- 按名称列入白名单(正则表达式) :
FLOWISE_WHITELIST_NAME_REGEX=".*important.*"
- 按名称列入黑名单(正则表达式) :
FLOWISE_BLACKLIST_NAME_REGEX=".*deprecated.*"
注意:白名单优先于黑名单。如果同时设置了白名单和黑名单,则采用最严格的规则。
安全
- 保护您的 API 密钥:确保
FLOWISE_API_KEY
的安全,不会在日志或存储库中暴露。 - 环境配置:使用
.env
文件或环境变量进行敏感配置。
将.env
添加到你的.gitignore
中:
故障排除
- 缺少 API 密钥:确保
FLOWISE_API_KEY
设置正确。 - 无效配置:如果同时设置了
FLOWISE_CHATFLOW_ID
和FLOWISE_ASSISTANT_ID
,服务器将拒绝启动。 - 连接错误:验证
FLOWISE_API_ENDPOINT
是否可访问。
执照
本项目遵循 MIT 许可证。详情请参阅LICENSE文件。
待办事项
- [x] Fastmcp 模式
- [x] 低级模式
- [x] 过滤
- [x] Claude 桌面集成
- [ ] 助理
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一个 Python 包,实现了用于与 Flowise API 集成的模型上下文协议服务器,允许用户列出聊天流、创建预测并为 Flowise 聊天流或助手动态注册工具。
Related MCP Servers
- -securityAlicense-qualityThe Flowise MCP Server enables clients to list chatflows and call predictions, integrating seamlessly with DIY Flowise or Flowise Cloud accounts. It provides a simple interface for executing chatflows/assistants predictions with existing Flowise configurations.Last updated -18PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that allows management and execution of Blender Python scripts, enabling users to create, edit and run scripts in a headless Blender environment through natural language interfaces.Last updated -4Python
- -securityFlicense-qualityA Model Context Protocol server that allows Claude to make API requests on your behalf, providing tools for testing various APIs including HTTP requests and OpenAI integrations without sharing your API keys in the chat.Last updated -Python
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -1Python