Banking MCP Server
Enables AI assistants to perform banking operations like creating customers and accounts, checking balances, transferring funds, and viewing transaction history through MCP tools.
README
Banking MCP Server
A Model Context Protocol (MCP) server that exposes banking operations as AI-accessible tools. This allows AI assistants like Claude to perform banking operations—creating customers and accounts, checking balances, transferring funds, and viewing transaction history—through a discoverable tool interface.
Architecture
The system consists of four main components:
┌─────────────────┐
│ MCP Host │ Claude Desktop, VS Code, or custom client
│ (AI Client) │
└────────┬────────┘
│ STDIO transport
↓
┌─────────────────┐
│ MCP Server │ Python server exposing 9 banking tools
│ │ + 5 resources + 3 prompts
└────────┬────────┘
│
↓
┌─────────────────┐
│ SQLite Database│ 4 tables: Customer, Account, Transaction, Transfer
└─────────────────┘
Components:
- MCP Server (Python): Exposes banking operations as MCP tools
- Database (SQLite): Stores customer, account, and transaction data
- MCP Client: Any MCP-compatible host (Claude Desktop, VS Code, custom implementations)
- Transport: STDIO (standard input/output) for local communication
Prerequisites
- Python 3.14+ (tested on 3.14.0)
- pip (Python package manager)
- Git (for cloning the repository)
Optional:
- Claude Desktop or VS Code with MCP support (for testing the server)
Installation
-
Clone the repository
cd path/to/your/projects git clone <repository-url> cd Banking_Assistant -
Create and activate a virtual environment
# Create virtual environment python -m venv venv # Activate (Windows) venv\Scripts\activate # Activate (macOS/Linux) source venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
Initialize the database
# Create database with sample data (20 customers, 50 accounts) python src/database/init_db.py --seedExpected output:
[OK] Created CUSTOMER table [OK] Created ACCOUNT table [OK] Created TRANSACTION table [OK] Created FUND_TRANSFER table [OK] Created 20 customers (CUST001 - CUST020) [OK] Created 50 accounts (ACC000001 - ACC000050)
Configuration
Claude Desktop Setup
-
Locate your Claude Desktop config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
-
Add the MCP server configuration:
{ "mcpServers": { "banking-assistant": { "command": "python", "args": [ "c:/path/to/Banking_Assistant/src/mcp_server/server.py" ] } } }Important: Use the absolute path to
server.pyon your system. -
Restart Claude Desktop to load the new server.
VS Code Setup
See docs/configuration.md for VS Code MCP extension setup.
Running the Server
The MCP server runs automatically when invoked by an MCP host (like Claude Desktop). You can also test it directly:
# Activate your virtual environment first
python src/mcp_server/server.py
Expected output:
Starting Banking MCP Server...
Server name: banking-assistant
Available tools: 9
Available resources: 5
Available prompts: 3
Transport: STDIO
Listening for MCP requests...
The server listens on stdin/stdout and waits for MCP protocol messages.
Testing
Quick Test in Claude Desktop
-
Verify the server is connected:
What banking tools do you have available?Expected: Claude lists 9 banking tools
-
Create a test customer:
Create a bank customer named John Doe with email john@example.com, phone +1234567890, and address 123 Main St, New York, NY 10001 -
Open an account and test a transfer:
For the customer just created: - Create a SAVINGS account with $5,000 - Create a CHECKING account with $2,000 - Transfer $500 from savings to checking - Show me the final balances
For comprehensive test scenarios and troubleshooting, see docs/testing.md.
Running Unit Tests
# Run all tests
python -m pytest tests/ -v
# Run specific test file
python -m pytest tests/test_tools.py -v
Manual Tool Testing
# Test individual tools
python test_tools.py
Project Structure
Banking_Assistant/
├── src/
│ ├── mcp_server/
│ │ ├── server.py # Main MCP server entry point
│ │ ├── tools.py # 9 banking tool implementations
│ │ ├── resources.py # 5 MCP resources (read-only data access)
│ │ └── prompts.py # 3 MCP prompt templates
│ ├── database/
│ │ ├── init_db.py # Database schema creation and seeding
│ │ ├── models.py # Data models (Customer, Account, etc.)
│ │ └── operations.py # CRUD operations
│ ├── client/
│ │ └── mcp_client.py # Example MCP client implementation
│ └── utils/
│ └── validators.py # Input validation functions
├── data/
│ └── banking.db # SQLite database (created by init_db.py)
├── tests/
│ ├── test_tools.py # Tool unit tests
│ ├── test_database.py # Database operation tests
│ └── test_integration.py # Integration tests
├── demo/
│ └── walkthrough.py # End-to-end demo script
├── docs/
│ ├── api-reference.md # Tool, resource, and prompt specifications
│ ├── testing.md # Testing guide and scenarios
│ └── configuration.md # Detailed configuration instructions
├── requirements.txt # Python dependencies
├── README.md # This file
└── CLAUDE.md # Context for AI assistants working on this repo
Key Files
src/mcp_server/server.py- Entry point that registers and exposes all toolssrc/mcp_server/tools.py- Implementation of the 9 banking operationssrc/database/init_db.py- Run this to create and populate the databasedata/banking.db- SQLite database (created automatically)
API Overview
Tools (9)
create_customer- Create a new customercreate_account- Open a bank accountget_balance- Check account balanceget_last_10_transactions- View transaction historytransfer_funds- Transfer money between accountsupdate_customer_address- Update customer addressupdate_customer_phone- Update customer phone numberget_customer_info- Retrieve customer detailsget_customer_accounts- List all accounts for a customer
Resources (5)
customers://all- List all customersaccounts://all- List all accountsaccounts://{id}- Get specific account detailstransactions://recent- View recent transactionstransfers://history- View transfer history
Prompts (3)
customer_summary- Generate customer profile summaryaccount_summary- Generate account overviewspending_pattern- Analyze spending patterns
For detailed specifications, see docs/api-reference.md.
Database Schema
The SQLite database contains 4 tables:
- CUSTOMER - Customer information (ID, name, email, phone, address)
- ACCOUNT - Bank accounts (account number, customer ID, type, balance, status)
- TRANSACTION - Transaction history (ID, account, date, amount, type, description)
- FUND_TRANSFER - Transfer records (ID, from/to accounts, amount, status, timestamp)
Sample data includes 20 customers and 50 accounts with realistic balances and transaction history.
Troubleshooting
Server not appearing in Claude Desktop:
- Verify the config file path is correct
- Check that the absolute path to
server.pyis correct - Restart Claude Desktop after config changes
- Check Claude Desktop logs for errors
Database errors:
- Ensure
data/banking.dbexists (runinit_db.pyif not) - Check file permissions on the database file
- Re-run
init_db.py --seedto recreate the database
Import errors:
- Verify virtual environment is activated
- Run
pip install -r requirements.txtagain - Check Python version is 3.14+
License
Educational project for the Claude Champion Program.
Additional Documentation
- API Reference - Complete tool, resource, and prompt specifications
- Testing Guide - Test scenarios and troubleshooting
- Configuration - Detailed MCP client setup instructions
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。