An agentic financial operations assistant built with the Claude Agent SDK, exposed via an Express HTTP API. Designed for a large-scale digital bank serving millions of customers across checking accounts, savings accounts, and digital wallets.
Express Server (:3000)
POST /api/chat → Claude Agent (claude-sonnet-4-5)
GET /api/health → Health check
│
▼
5 Custom MCP Tools
│
▼
Mock Data Layer
(accounts, transactions, risk profiles)
The agent runs as a single Claude instance with custom tools registered via createSdkMcpServer. It connects to Azure AI Foundry as the model provider.
| Tool | Description |
|---|---|
get_account_balance |
Look up account balance, status, and metadata |
get_transaction_history |
Query transactions with date range and limit filters |
calculate_risk_score |
Get risk score (0-100), risk factors, and recommendation |
generate_compliance_report |
Generate AML, KYC, or daily summary reports |
flag_suspicious_activity |
Flag a transaction and create a fraud investigation case |
- Bun runtime
- Claude Code CLI installed (
claudecommand available) - Azure AI Foundry credentials (or a direct Anthropic API key)
bun installCopy the example env file and fill in your credentials:
cp .env.example .envANTHROPIC_FOUNDRY_API_KEY=your-azure-foundry-api-key
ANTHROPIC_FOUNDRY_BASE_URL=https://your-resource.services.ai.azure.com
PORT=3000To use a direct Anthropic API key instead of Azure Foundry, set
ANTHROPIC_API_KEYand remove the Foundry variables. You'll need to updatesrc/agent.tsto skip theinitAzureFoundry()call.
bun run startOr with auto-reload:
bun run devReturns server status.
curl http://localhost:3000/api/health{ "status": "ok", "timestamp": "2026-03-15T13:35:05.027Z" }Send a message to the agent.
curl -X POST http://localhost:3000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Check the balance and risk score for account ACC-004"}'{ "response": "Account ACC-004 belongs to Can Öztürk..." }# Account investigation
curl -X POST http://localhost:3000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Check the balance and risk score for account ACC-004"}'
# Compliance report
curl -X POST http://localhost:3000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Generate an AML compliance report"}'
# Fraud flagging
curl -X POST http://localhost:3000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Flag transaction TXN-030 — appears to be structuring to avoid reporting thresholds"}'
# Transaction analysis
curl -X POST http://localhost:3000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Show me the recent transactions for account ACC-008 and assess if anything looks suspicious"}'src/
├── index.ts # Express server
├── agent.ts # Agent config, system prompt, Azure Foundry init
├── tools/
│ ├── index.ts # Barrel export
│ ├── helpers.ts # toolResponse/toolError utilities
│ ├── balance.ts # get_account_balance
│ ├── transactions.ts # get_transaction_history
│ ├── risk-score.ts # calculate_risk_score
│ ├── compliance.ts # generate_compliance_report
│ └── fraud.ts # flag_suspicious_activity
└── data/
├── accounts.ts # 10 mock accounts
├── transactions.ts # 31 mock transactions
└── risk-profiles.ts # 10 mock risk profiles
The agent operates on realistic mock data representing a Turkish digital bank:
- 10 accounts across checking, savings, and digital wallet types
- 31 transactions including normal activity, suspicious patterns, and structuring attempts
- 10 risk profiles ranging from low (score 5) to critical (score 92)
Notable accounts for testing:
ACC-004— Frozen account, risk score 92, multiple large withdrawalsACC-008— Active account, risk score 68, crypto structuring patternACC-001— Normal active account, low risk
- Runtime: Bun
- Agent: @anthropic-ai/claude-agent-sdk
- Server: Express 5
- Validation: Zod 4
- Model Provider: Azure AI Foundry (claude-sonnet-4-5)