思维流畅MCP
好的!我要去建我自己的主题公园!与二十一点!还有妓女!
一个全面的模型上下文协议(MCP)服务器 流智 -开源LLM编排平台。通过MCP工具提供Flowise聊天流的完整生命周期管理。
为什么选择Fluent Mind MCP?
现有的Flowise MCP包装仅支持 查询 现有的聊天流。Fluent Mind MCP为您提供 全生命周期管理:
- ✅ 从头开始创建聊天流(0→1)
- ✅ 更新和修改现有流
- ✅ 删除聊天流
- ✅ 部署/取消部署流
- ✅ 执行预测
- ✅ 从自然语言描述生成AgentFlow V2
从头开始构建,完全控制。不依赖于其他MCP实现。麻省理工学院免费。
特性
8个综合MCP工具
- list_chatflows -列出所有带有元数据的聊天流
- get_chatflow -按ID获取详细的聊天流信息
- create_chatflow -创建新的聊天流(聊天流、代理流、多代理、助手)
- update_chatflow -更新现有聊天流属性
- delete_chatflow -永久删除聊天流
- run_预测 -使用用户输入执行聊天流
- 部署chatflow -切换部署状态
- generate_agentflow_v2 -从自然语言生成AgentFlow V2
建筑
- FastMCP -现代Python MCP框架
- HTTPX -带连接池的异步HTTP客户端
- 派丹蒂克 -类型安全数据验证
- 清洁分离 -4层架构(MCP服务器、服务逻辑、Flowise客户端、域模型)
- 生产准备就绪 -全面的错误处理、日志记录和测试
文档
在这里开始: 文档中心 -所有文档的中央导航
快速导航
关键资源
- docs/README.md -完整的文档索引和导航中心
- **** -39个生产就绪节点模板
- examples/WORKING_CHATFLOWS_GUIDE.md -如何创建功能性聊天流
- docs/API_FIELD_COMPARION.md文件 -关键API现场参考(camelBase与snake_case)
- specs/001-flowise mcp服务器/ -完整的规范和设计文件
学习路径
初学者:从这里开始
- README.md (此文件)-项目概述
- -快速启动
- examples/WORKING_CHATFLOWS_GUIDE.md -学习模式
中级:构建聊天流
- -浏览39个模板
- -使用辅助工具
- docs/API_FIELD_COMPARION.md文件 -了解API结构
高级:贡献
- specs/001-flowise mcp服务器/spec.md -完整规格
- specs/001-flowise mcp服务器/数据模型.md -数据模型
- .define/memory/constitution.md -发展原则
安装
先决条件
- Python 3.12+ 安装
- Flowise实例 正在运行(本地或远程)
- Claude桌面版 (用于MCP集成)
- Git (克隆存储库)
快速安装
# Clone repository
cd ~/work/ai
git clone fluent-mind-mcp
cd fluent-mind-mcp
# Install dependencies
pip install -e .配置
创建 .env 项目根目录中的文件:
# Required
FLOWISE_API_URL=http://localhost:3000
# Optional (if Flowise is secured)
FLOWISE_API_KEY=your_api_key_here
# Optional (defaults shown)
FLOWISE_TIMEOUT=60
FLOWISE_MAX_CONNECTIONS=10
LOG_LEVEL=INFO用法
1.独立模式
直接运行MCP服务器:
python -m fluent_mind_mcp.server2.克劳德桌面集成
配置Claude Desktop以使用Fluent Mind MCP:
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"fluent-mind": {
"command": "python",
"args": ["-m", "fluent_mind_mcp.server"],
"env": {
"FLOWISE_API_URL": "http://localhost:3000",
"FLOWISE_API_KEY": "your_api_key_here"
}
}
}
}重新启动克劳德桌面 (⌘Q然后重新启动)以使更改生效。
3.测试集成
在Claude中,尝试以下命令:
列出聊天流
List my Flowise chatflows预期响应:包含名称、类型和部署状态的所有聊天流的列表。
获取聊天流详细信息
Get details for chatflow abc-123-def预期响应:完整的聊天流信息,包括flowData结构。
执行聊天流
Run chatflow abc-123-def with question "What is AI?"预期响应:带答案的Chatflow执行结果。
创建聊天流
Create a new chatflow named "Test Flow" with this structure:
{
"nodes": [
{"id": "llm-1", "type": "chatOpenAI", "data": {"model": "gpt-4"}}
],
"edges": []
}更新聊天流
Update chatflow abc-123-def to set deployed=true生成代理流
Generate an AgentFlow V2 for a research agent that searches the web and summarizes findingsapi参考
list_chatflows()
列出所有可用的Flowise聊天流。
退货:
{
"chatflows": [
{
"id": "abc-123-def",
"name": "My Chatflow",
"type": "CHATFLOW",
"deployed": true,
"createdDate": "2025-10-16T12:00:00Z"
}
]
}演出:≤5秒
______________________________________________________________________
get_chatflow(chatflow_id:str)
获取详细的聊天流信息,包括工作流结构。
参数:
chatflow_id(str,必填):唯一的聊天流标识符
退货:
{
"id": "abc-123-def",
"name": "My Chatflow",
"type": "CHATFLOW",
"deployed": true,
"flowData": "{\"nodes\": [...], \"edges\": [...]}",
"createdDate": "2025-10-16T12:00:00Z"
}演出:≤5秒
______________________________________________________________________
create_chatflow(名称:str,flow_data:str,类型:str=“chatflow”,部署:bool=False)
从flowData结构创建新的Flowise聊天流。
参数:
name(str,必填):聊天流显示名称(1-255个字符)flow_data(str,必填):包含工作流节点和边的JSON字符串type(str,可选):聊天流类型-聊天流|代理流|多代理|助手(默认:“聊天流”)deployed(bool,可选):是否立即部署(默认值:False)
退货: 已创建具有指定ID的聊天流对象
演出:≤10秒
例子:
flow_data = json.dumps({
"nodes": [
{"id": "node-1", "type": "chatOpenAI", "data": {"model": "gpt-4"}}
],
"edges": []
})
result = await create_chatflow(
name="My Assistant",
flow_data=flow_data,
type="CHATFLOW",
deployed=False
)______________________________________________________________________
update_chatflow(chatflow_id:str,名称:str=None,flow_data:str=None,部署:bool=None)
更新现有的聊天流属性(支持部分更新)。
参数:
chatflow_id(str,必填):唯一的聊天流标识符name(str,可选):新显示名称flow_data(str,可选):新的工作流结构(JSON字符串)deployed(bool,可选):新部署状态
退货: 已更新聊天流对象
演出:≤10秒
备注:必须至少提供一个可选参数。
______________________________________________________________________
delete_chatflow(chatflow_id:str)
从Flowise中永久删除聊天流。
参数:
chatflow_id(str,必填):唯一的聊天流标识符
退货:
{
"success": true,
"message": "Chatflow abc-123-def deleted successfully",
"chatflow_id": "abc-123-def"
}演出:≤5秒
警告:此操作无法撤消。
______________________________________________________________________
run_presearch(chatflow_id:str,question:str)
使用用户输入执行已部署的聊天流。
参数:
chatflow_id(str,必填):要执行的聊天流question(str,必填):用户输入或问题
退货:
{
"text": "Response from chatflow",
"questionMessageId": "msg-123",
"chatMessageId": "msg-456",
"sessionId": "session-789"
}演出:≤5秒
备注:必须部署Chatflow才能执行。
______________________________________________________________________
deploy_chatflow(chatflow_id:str,部署:bool)
切换聊天流部署状态。
参数:
chatflow_id(str,必填):唯一的聊天流标识符deployed(bool,必填):部署为True,取消部署为False
退货: 已更新聊天流对象
演出:≤10秒
______________________________________________________________________
generate_agentflow_v2(描述:str)
从自然语言描述生成AgentFlow V2结构。
参数:
description(str,必填):所需代理的自然语言描述(至少10个字符)
退货:
{
"flowData": "{\"nodes\": [...], \"edges\": [...]}",
"name": "Generated Agent Name",
"description": "Generated description"
}演出:≤10秒
例子:
description = "Create a research agent that searches the web and summarizes findings"
result = await generate_agentflow_v2(description)
# Optionally create chatflow from generated structure
chatflow = await create_chatflow(
name=result["name"],
flow_data=result["flowData"],
type="AGENTFLOW",
deployed=True
)发展
项目结构
fluent-mind-mcp/
├── src/fluent_mind_mcp/
│ ├── __init__.py
│ ├── server.py # MCP server entry point, tool definitions
│ ├── services/
│ │ ├── __init__.py
│ │ └── chatflow_service.py # Business logic orchestration
│ ├── client/
│ │ ├── __init__.py
│ │ ├── flowise_client.py # HTTP client implementation
│ │ └── exceptions.py # Custom exception hierarchy
│ ├── models/
│ │ ├── __init__.py
│ │ ├── chatflow.py # Chatflow, FlowData domain models
│ │ ├── config.py # Configuration model
│ │ └── responses.py # API response models
│ ├── logging/
│ │ ├── __init__.py
│ │ └── operation_logger.py # Structured logging
│ └── utils/
│ ├── __init__.py
│ └── validators.py # Input validation helpers
├── tests/
│ ├── unit/ # Unit tests (mocked)
│ ├── integration/ # Integration tests (real API)
│ └── acceptance/ # Acceptance tests (user stories)
├── specs/001-flowise-mcp-server/ # Design documentation
│ ├── spec.md # Feature specification
│ ├── plan.md # Implementation plan
│ ├── tasks.md # Task breakdown
│ ├── data-model.md # Data models
│ ├── research.md # Technical research
│ ├── quickstart.md # Quick setup guide
│ └── contracts/ # API contracts
├── README.md # This file
├── pyproject.toml # Python project configuration
└── .env.example # Environment template运行测试
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest tests/
# Run with coverage
pytest --cov=fluent_mind_mcp --cov-report=html tests/
# Run specific test suites
pytest tests/unit/ # Unit tests only
pytest tests/integration/ # Integration tests only
pytest tests/acceptance/ # Acceptance tests only
# Run linting
ruff check src/
# Run type checking
mypy src/代码质量
该项目保持高代码质量标准:
- 测试覆盖率:总体≥80%,100%关键路径
- 类型安全:带有mypy验证的完整类型提示
- 代码风格:有褶皱
- 复杂性:圈复杂度≤10,嵌套≤3
- 文档:解释为什么而不是什么的综合文档
故障排除
问题:“连接被拒绝”
原因:Flowise未运行或URL不正确
解决方案:
# Check Flowise is running
curl http://localhost:3000/api/v1/chatflows
# If not running, start Flowise
cd path/to/flowise
npm start问题:“身份验证失败”
原因:API密钥无效或丢失
解决方案:
- 验证Flowise设置中的API键
- 更新
FLOWISE_API_KEY在.env和克劳德配置 - 重新启动克劳德桌面
问题:“未找到MCP服务器”
原因:Claude Desktop配置不正确或未安装服务器
解决方案:
- 验证
claude_desktop_config.json路径正确 - 检查
python -m fluent_mind_mcp.server运行无错误 - 查看克劳德桌面日志:
~/Library/Logs/Claude/mcp*.log
问题:“导入错误:fluent_mind_mcp”
原因:软件包安装不正确
解决方案:
# Reinstall package
cd ~/work/ai/fluent-mind-mcp
pip install -e . --force-reinstall查看日志
# Claude Desktop logs
tail -f ~/Library/Logs/Claude/mcp-server-fluent-mind.log
# Or check all MCP logs
ls -la ~/Library/Logs/Claude/mcp*.log日志级别:
ERROR:上下文失败INFO:关键操作(创建、更新、删除、执行)WARNING:降级条件(响应缓慢、重试)DEBUG:详细痕迹(默认情况下关闭)
更改中的日志级别 .env:
LOG_LEVEL=DEBUG演出
MCP服务器满足以下性能目标:
- 列表/获取/执行:每次操作≤5秒
- 创建/更新/部署:每次操作≤10秒
- 全生命周期:≤60秒(创建+更新+执行+部署+删除)
- 并发:支持5-10个AI助手同时连接
- 可扩展性:高效处理多达100个聊天流
安全
- 认证:支持Flowise API密钥身份验证
- 无凭证风险:API密钥从未记录或暴露在错误消息中
- 输入验证:处理前验证所有用户输入
- 大小限制:flowData大小限制为1MB,以防止资源耗尽
- 错误处理:妥善处理所有故障情况
许可证
这个项目是 完全开源 从零开始建造。分叉代码没有MIT许可证要求,因为没有分叉代码。你想用它做什么就做什么。
为什么“思维流畅”?
因为与Flowise的交互应该是流畅、直观和智能的。而且听起来很酷。
鸣谢
在发现现有的mcp-flowise工具实际上无法创建聊天流后,出于沮丧而构建。有时你只需要建造自己的主题公园。
支持
- 问题:在存储库问题页面报告
- 文档:参见 docs/README.md 完整的文档中心
- 快速开始:参见 specs/001-flowise mcp服务器/quickstart.md 用于快速设置
- 节点模板:参见 适用于39个生产就绪模板
- 工作聊天流:参见 examples/WORKING_CHATFLOWS_GUIDE.md 如何创建功能性聊天流
快速参考
| 命令 | 目的 |
|---|---|
python -m fluent_mind_mcp.server | 启动MCP服务器 |
pytest tests/ | 运行所有测试 |
pytest --cov=fluent_mind_mcp tests/ | 运行覆盖率测试 |
ruff check src/ | Lint代码 |
mypy src/ | 类型检查 |
______________________________________________________________________
状态: ✅ 生产就绪
版本: 1.0.0
内置于❤️ 以及健康的挫折感。
