Quickstart
Stand up a bank2ai MCP server and ask Claude: "What did I spend on groceries last month?"
1. Install uv
- macOS / Linux / WSL2
- Windows
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
Run in PowerShell, then restart it:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2. Create a project
uv init my-bank
cd my-bank
uv add bank2ai fastmcp
3. Write a server
Create server.py in your project:
from fastmcp import FastMCP
from bank2ai import (
Account, AccountList,
Category, CategoryList,
SpendingSummary, SpendingSummaryGroup, SpendingSummaryPeriod,
register_tools,
)
app = FastMCP("my-bank")
ACCOUNTS = [
Account(
id="acc-1", accountNumber="1234-56-789012", currency="USD",
balance=4250.00, accountType="Current",
isWithdrawalAccount=True, isDefaultAccount=True,
),
]
CATEGORIES = [
Category(id="cat-groceries", name="Groceries"),
Category(id="cat-transport", name="Transportation"),
Category(id="cat-dining", name="Dining"),
]
SPENDING = SpendingSummary(
summary=[
SpendingSummaryGroup(group="Groceries", total_amount=-588.00, transaction_count=6, average_amount=-98.00),
SpendingSummaryGroup(group="Transportation", total_amount=-165.00, transaction_count=4, average_amount=-41.25),
SpendingSummaryGroup(group="Dining", total_amount=-342.50, transaction_count=8, average_amount=-42.81),
],
period=SpendingSummaryPeriod(start_date="2025-04-01", end_date="2025-04-30"),
total=-1095.50,
)
async def get_accounts(*, only_withdrawal_accounts, account_type):
return AccountList(items=ACCOUNTS)
async def get_categories():
return CategoryList(items=CATEGORIES)
async def get_spending_summary(*, group_by="category", start_date=None, end_date=None, categories=None):
return SPENDING
register_tools(
app,
get_accounts=get_accounts,
get_categories=get_categories,
get_spending_summary=get_spending_summary,
)
if __name__ == "__main__":
app.run()
Tools whose handler is omitted are simply not registered — add more as you implement them.
4. Run it
uv run python server.py
5. Connect to Claude
Claude Code
Works on any platform, including Linux and WSL2.
From your my-bank directory:
claude mcp add my-bank -- uv run --directory "$PWD" python server.py
claude
In PowerShell, "$PWD" expands to the current directory — the command works as-is. Or replace it with the full path, e.g. C:\Users\YOU\my-bank.
Type /mcp in the new session — my-bank should appear. Then ask:
What did I spend on groceries last month?
Claude Desktop
Claude Desktop is not available on Linux. Linux users should use Claude Code above.
Open Claude Desktop → Settings → Developer → Edit Config. This opens the correct config file for your install regardless of how Claude Desktop was installed. Add mcpServers alongside any existing keys in that file:
- macOS
- Windows
- Windows + WSL2
{
"mcpServers": {
"my-bank": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/my-bank", "python", "server.py"]
}
}
}
{
"mcpServers": {
"my-bank": {
"command": "uv",
"args": ["run", "--directory", "C:\\Users\\YOU\\my-bank", "python", "server.py"]
}
}
}
Your project lives inside WSL; Claude Desktop runs on Windows. Use wsl.exe to bridge them.
Replace /home/YOU/my-bank with your Linux project path, and verify the uv path with which uv in WSL:
{
"mcpServers": {
"my-bank": {
"command": "wsl.exe",
"args": ["--", "bash", "-lc", "cd /home/YOU/my-bank && /home/YOU/.local/bin/uv run python server.py"]
}
}
}
Fully quit Claude Desktop (hamburger menu in the top-left → File → Exit) and reopen it.
Then ask Claude anything — for example:
What did I spend on groceries last month?
Claude will call your server and return the data. You can ask follow-up questions, request a chart, or try something completely different.
Next steps
- Add more handlers — see Writing handlers.
- Read the Specification to understand the full contract.
- Wire up a real bank in the real-bank guide.