Banking Model Context Protocol Server
集成 MCP 的银行聊天机器人
一个复杂的银行聊天机器人应用程序,使用 Azure OpenAI 和模型上下文协议 (MCP) 实现安全高效的消息处理。
特征
人工智能银行助手:使用 Azure OpenAI 为银行查询提供智能响应
模型上下文协议(MCP) :实现安全消息通信协议
实时聊天界面:现代、响应式的用户界面,可实现无缝的用户交互
全面的日志记录:用于监控和调试的详细日志系统
银行信息集成:动态显示银行详细信息和服务
Markdown 支持:响应的富文本格式
Related MCP server: agentbox
项目结构
.
├── app.py # Main Flask application
├── mcp_server.py # MCP server implementation
├── mcp_client.py # MCP client implementation
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── templates/ # HTML templates
│ └── index.html # Chat interface
└── logs/ # Log files
├── client_messages.log
├── mcp_client.log
└── mcp_server.log先决条件
Python 3.8 或更高版本
Azure OpenAI API 访问
所需的 Python 包(请参阅 requirements.txt)
安装
克隆存储库:
git clone <repository-url> cd banking-chatbot创建并激活虚拟环境:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate安装依赖项:
pip install -r requirements.txt使用您的凭证创建一个
.env文件:ENDPOINT_URL=your_azure_endpoint AZURE_OPENAI_API_KEY=your_api_key DEPLOYMENT_NAME=your_deployment_name
用法
启动 MCP 服务器:
python mcp_server.py在新的终端中,启动 Flask 应用程序:
python app.py访问聊天机器人界面
http://localhost:5000
MCP 协议
模型上下文协议 (MCP) 用于处理聊天机器人与服务器之间的消息通信。它提供:
安全消息传输
消息队列和可靠性
详细日志记录
实时消息处理
消息类型
聊天消息:用户查询和 AI 响应
系统消息:管理和控制消息
日志记录
应用程序在logs目录中维护详细日志:
client_messages.log:聊天消息历史记录mcp_client.log:客户端连接和操作日志mcp_server.log:服务器操作日志
银行信息
该聊天机器人配置了全面的银行信息,包括:
营业时间
分支机构
可用服务
联系信息
支持渠道
发展
添加新功能
更新
app.py中的BANK_INFO字典以获取新的银行信息修改
SYSTEM_MESSAGE以更新 AI 行为在
mcp_client.py中添加新的消息处理程序以获得附加功能
测试
运行测试客户端来验证 MCP 功能:
python test_client.py清除测试日志:
python clear_logs.py安全
API 密钥和敏感信息存储在
.env中MCP 提供安全的消息传输
实现输入验证和错误处理
贡献
分叉存储库
创建功能分支
提交你的更改
推送到分支
创建拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
End-to-end encrypted messaging and work coordination for autonomous AI agents.
Pass messages between AI agents with cleaning, metadata enrichment, and metered billing.
- ReplySlipDeprecatedcom.replyslip
Relay for messages and schema-checked tasks between AI agents.
Relay for messages and schema-checked tasks between AI agents.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables asynchronous messaging between AI agents, including sending messages, proposals, and managing threaded conversations using the Model Context Protocol.1MIT
- AlicenseNot gradedqualityBmaintenanceA threaded message relay for ChatGPT and local coding agents, enabling message exchange and file sharing via MCP and REST APIs.2Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables bidirectional messaging between Claude Code and Codex Desktop through a SQLite-backed bus, so messages sent from either side appear in the other's chat pane, with acknowledgement and redelivery semantics.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants on different platforms and sessions to exchange persistent messages with one another using simple natural language commands, so they can coordinate tasks and hand off work across restarts. It supports instance registration, addressed messaging, inbox checking, and optional authentication.-