Banking MCP Server

Banking MCP Server

A comprehensive banking system with MCP server capabilities and REST API, enabling account management, deposits, withdrawals, transfers, and transaction history through natural language or HTTP endpoints.

Category
访问服务器

README

Pure Banking System# Pure Banking System# Banking MCP Server - Implementation Complete! 🏦

A complete banking system with both console and GUI interfaces, implemented in pure Python with no external dependencies.

Quick StartA simple, standalone banking system implementation in Python with no external dependencies.A comprehensive Banking System with full Model Context Protocol (MCP) support, providing both MCP server capabilities and REST API endpoints.

Windows Launcher Menu:


banking_mcp.bat## Quick Start## 📁 Project Structure

Choose from:

  1. Console Interface (Interactive CLI)

  2. GUI Interface (Graphical)Run the system using the Windows batch file:```

  3. Run Tests


### Direct Python Execution:

```cmdbanking_mcp.bat├── banking_mcp_server.py          # Main server implementation

python banking_ui.py              # GUI Interface

python banking_mcp_server.py      # Console Interface```├── requirements.txt               # Python dependencies

python test_banking_system.py     # Test Suite

```├── banking_mcp.bat               # Windows launch script



## FeaturesOr run directly with Python:├── claude_desktop_config.json    # Claude Desktop configuration



- **Multiple User Interfaces**: Both GUI and console modes```cmd├── test_banking_server.py        # Comprehensive test suite

- **Complete Banking Operations**: Accounts, deposits, withdrawals, transfers

- **Transaction History**: Full audit trail with detailed reportingpython banking_mcp_server.py├── BANKING_NewMCP_README.md      # Original requirements

- **Input Validation**: Comprehensive error checking

- **Data Persistence**: JSON-based storagepython test_banking_system.py  # To run tests└── README.md                     # This file

- **Zero Dependencies**: Uses only Python standard library

User Interfaces

🖥️ GUI Interface (banking_ui.py)

  • Tabbed interface with dedicated sections for each operation## Features## 🚀 Quick Start

  • Real-time account balance updates

  • Transaction history viewer

  • System information dashboard

  • User-friendly forms and validation- Complete banking operations (accounts, deposits, withdrawals, transfers)### 1. Install Dependencies

💻 Console Interface (banking_mcp_server.py)- Transaction history and reporting

  • Interactive menu-driven CLI

  • All banking operations available- Input validation and error handling```powershell

  • Formatted output with emojis and colors

  • Keyboard shortcuts and error handling- JSON-based data persistencepip install -r requirements.txt

For detailed documentation, see BANKING_README.md.- Comprehensive test suite```

For detailed documentation, see BANKING_README.md.### 2. Run Tests

python test_banking_server.py

3. Start the Server

MCP Server Only (for Claude Desktop):

python banking_mcp_server.py --mode mcp

REST API Only:

python banking_mcp_server.py --mode rest --port 3003

Both MCP + REST:

python banking_mcp_server.py --mode both --port 3003

Using Windows Batch File:

banking_mcp.bat --mode both --port 3003

🔧 Claude Desktop Integration

  1. Copy the configuration from claude_desktop_config.json
  2. Add it to your Claude Desktop MCP settings
  3. Restart Claude Desktop
  4. The banking tools will be available in Claude!

🛠️ Available MCP Tools

Tool Description Parameters
create_account Create new banking account userName, initialDeposit, accountType, bankName
get_account Get account details accountNumber
deposit Deposit money accountNumber, amount, description
withdraw Withdraw money accountNumber, amount, description
transfer Transfer between accounts fromAccountNumber, toAccountNumber, amount, description
list_accounts List all accounts -
get_transactions Get transaction history accountNumber
close_account Close account (zero balance) accountNumber

📚 MCP Resources

Access system information through these resources:

  • banking://system/info - System information and capabilities
  • banking://accounts/summary - Accounts summary with totals
  • banking://api/endpoints - Available REST API endpoints

💡 MCP Prompts

Get help with these built-in prompts:

  • banking_guide - Comprehensive banking operations guide
  • transaction_help - Transaction-specific help (with optional transaction_type)
  • account_setup - Account setup guide (with optional account_type)

🌐 REST API Endpoints

When running in REST mode, these endpoints are available:

Account Management

  • POST /api/accounts - Create account
  • GET /api/accounts - List all accounts
  • GET /api/accounts/{account_number} - Get account details
  • DELETE /api/accounts/{account_number} - Close account

Transactions

  • POST /api/accounts/{account_number}/deposit - Deposit money
  • POST /api/accounts/{account_number}/withdraw - Withdraw money
  • POST /api/transfer - Transfer between accounts
  • GET /api/accounts/{account_number}/transactions - Get transaction history

System

  • GET /api/health - Health check
  • GET /api/system/info - System information

💻 Usage Examples

MCP Tool Usage (in Claude Desktop)

// Create a new savings account
create_account(userName="Alice Smith", initialDeposit=1500.00, accountType="savings")

// Make a deposit
deposit(accountNumber="ACC000001", amount=500.00, description="Monthly salary")

// Transfer money
transfer(fromAccountNumber="ACC000001", toAccountNumber="ACC000002", amount=250.00, description="Payment")

// Get account information
get_account(accountNumber="ACC000001")

// View transaction history
get_transactions(accountNumber="ACC000001")

REST API Usage

# Create account
curl -X POST http://localhost:3003/api/accounts \
  -H "Content-Type: application/json" \
  -d '{"userName":"John Doe", "initialDeposit":1000, "accountType":"checking"}'

# Make deposit
curl -X POST http://localhost:3003/api/accounts/ACC000001/deposit \
  -H "Content-Type: application/json" \
  -d '{"amount":500, "description":"Salary deposit"}'

# Get account details
curl http://localhost:3003/api/accounts/ACC000001

# List all accounts
curl http://localhost:3003/api/accounts

✨ Key Features Implemented

✅ MCP Protocol Support

  • Full MCP 2024-11-05 specification compliance
  • Stdio transport for MCP client communication
  • 8 comprehensive banking tools
  • 3 system information resources
  • 3 interactive prompts with help

✅ Banking Operations

  • Account creation (checking, savings, business)
  • Deposits and withdrawals with validation
  • Inter-account transfers
  • Transaction history tracking
  • Account closure (with zero balance requirement)
  • Comprehensive error handling

✅ Data Validation

  • Amount validation (positive, reasonable limits)
  • Account state checking (active/closed)
  • Sufficient balance verification
  • Input sanitization and validation

✅ REST API Wrapper

  • Complete REST endpoints matching MCP tools
  • CORS support for web applications
  • JSON request/response format
  • Health monitoring endpoints

✅ Windows Integration

  • PowerShell-compatible batch file
  • Windows path handling
  • Claude Desktop configuration ready

🧪 Testing

Run the comprehensive test suite:

python test_banking_server.py

Tests cover:

  • All banking operations
  • MCP tool definitions
  • Data validation and edge cases
  • Error handling scenarios

🏗️ Architecture

The system follows a clean architecture:

  1. Core Banking System (BankingSystem class)

    • Pure business logic
    • No external dependencies
    • Comprehensive validation
  2. MCP Server Layer (BankingMCPServer class)

    • MCP protocol implementation
    • Tool/resource/prompt handlers
    • Async communication
  3. REST API Layer (Flask app)

    • HTTP endpoint wrapper
    • JSON serialization
    • CORS support
  4. Data Models

    • Account dataclass
    • Transaction dataclass
    • Type safety with proper validation

🔒 Security & Validation

  • Input validation on all operations
  • Amount range checking (prevents overflow)
  • Account state verification
  • Transaction atomicity
  • Error boundary handling

📈 Future Enhancements

Potential improvements:

  • Persistent data storage (SQLite/PostgreSQL)
  • Authentication and authorization
  • Interest calculation for savings accounts
  • Transaction limits and daily caps
  • Multi-currency support
  • Audit logging

🤝 Usage Tips

  1. For MCP Development: Use --mode mcp for Claude Desktop integration
  2. For Web Development: Use --mode both to test REST APIs while having MCP access
  3. For Testing: Run test suite before deployment
  4. For Production: Consider adding persistent storage and authentication

❓ Troubleshooting

MCP Server Won't Start:

  • Check Python version (3.8+)
  • Verify MCP dependencies: pip install mcp
  • Check file paths in Claude Desktop config

REST API Issues:

  • Install Flask: pip install flask flask-cors
  • Check port availability
  • Verify firewall settings

Tool Not Working in Claude:

  • Restart Claude Desktop after config changes
  • Check MCP server logs in Claude Desktop
  • Verify file paths are absolute

🎉 Your Banking MCP Server is ready! Start with the test suite, then try it in Claude Desktop or via REST API.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选