Y.A.N.I. MCP Server
Connect any LLM to YaniPay services via the Model Context Protocol. 37 tools, 3 resources, 3 prompts, and 3 transports to power AI-driven fintech experiences.
Overview
The Y.A.N.I. MCP Server exposes the full YaniPay platform to any AI model that supports the Model Context Protocol (MCP). It provides real-time access to user wallets, transactions, loyalty programs, KYC status, crypto portfolios, referral data, and a fintech knowledge base covering French regulation, DOM fiscal specifics, and competitive analysis.
37 Tools
5 advisory (sync) + 32 platform (async) tools covering finance, loyalty, identity, banking, wallets, trading, analytics, and more
3 Resources + 3 Prompts
MCP resources for config, data models, and knowledge base. Pre-built prompts for financial analysis and KYC diagnostic
3 Transports
stdio (Claude Code), HTTP/SSE (web clients), and REST API (any LLM) with API key auth and rate limiting
What is MCP?
The Model Context Protocol is an open standard created by Anthropic that lets AI models securely interact with external data sources and tools. Instead of building custom integrations for each AI provider, MCP provides a single protocol that works with Claude, GPT, Gemini, and any compatible LLM.
For fintech, this is transformative: an AI assistant can now directly query a user's wallet balance, analyze their transaction history, check their KYC status, and provide personalized financial advice — all through a standardized, secure interface.
// 1. LLM receives user question
User: "What's my account balance?"
// 2. LLM calls MCP tool
MCP Tool: yani_get_balance({ email: "user@example.com" })
// 3. Server queries YaniPay database via Prisma
const wallets = await db.wallet.findMany({ where: { userId } })
// 4. Formatted response returned to LLM
Result: "## Soldes de Johan\n- EUROS: 1,234.56 EUR\n- YANI_COIN: 500.00 YANI"
// 5. LLM presents natural response to user
AI: "You have 1,234.56 EUR in your main wallet and 500 YANI tokens."Architecture
The Y.A.N.I. MCP Server is a standalone Node.js TypeScript project inside the YaniPay monorepo at mcp-server-yani/. It connects to the same PostgreSQL database via Prisma ORM and serves three independent transport layers.
┌─────────────────────────────────────────────────────┐
│ AI Clients │
│ Claude Code │ ChatGPT │ Gemini │ Custom LLM │
└───────┬───────┴─────┬─────┴────┬─────┴──────┬───────┘
│ │ │ │
┌────▼────┐ ┌─────▼────┐ ┌─▼──────┐ ┌──▼───────┐
│ stdio │ │ HTTP/SSE │ │ REST │ │ Future │
│ :pipe │ │ :3100 │ │ :3101 │ │ WebSocket│
└────┬────┘ └─────┬────┘ └──┬─────┘ └──────────┘
│ │ │
┌────▼─────────────▼──────────▼────────────────────┐
│ Y.A.N.I. MCP Server v1.2.0 │
│ │
│ ┌─────────────┐ ┌──────────────────────────┐ │
│ │ 5 Advisory │ │ 9 Platform Tools │ │
│ │ Tools │ │ (Prisma DB queries) │ │
│ └─────────────┘ └──────────────────────────┘ │
│ ┌─────────────┐ ┌──────────────────────────┐ │
│ │ 3 Resources │ │ 3 Prompts │ │
│ └─────────────┘ └──────────────────────────┘ │
│ ┌────────────────────────────────────────────┐ │
│ │ Knowledge Base (4 skills, 50+ references) │ │
│ └────────────────────────────────────────────┘ │
└──────────────────────┬───────────────────────────┘
│
┌─────────▼─────────┐
│ PostgreSQL DB │
│ (Prisma ORM) │
└───────────────────┘Y.A.N.I. v3 Internal Integration
Starting with Y.A.N.I. v3.0, the agent hierarchy uses an internal MCPClientService that gives the primary YANI agent awareness of all configured MCP tools at inference time. This is separate from the external MCP server: it runs inside the agent process and injects tool names into every system prompt.
Auto-initialization
YANIHierarchyManager.initialize() calls initializeMCPServers() non-fatally. MCP server failures do not block agent startup.
Tool-aware prompts
mcpClient.getToolNamesForPrompt() returns available tool names that are injected into the SystemPromptEngine for each user message, enabling LLM tool-routing decisions.
System status
getSystemStatus().services.mcp exposes server connection states, total tool count and resource count for monitoring dashboards.
Response metrics
handleUserMessage() now returns metrics.mcpToolsAvailable alongside RAG chunk count, prompt token estimate and session message count.
// Y.A.N.I. v3: enriched handleUserMessage pipeline
const ragContext = ragKnowledge.getContextForPrompt(message, 3);
const mcpTools = mcpClient.getToolNamesForPrompt();
const prompt = systemPromptEngine.generatePrompt(
userProfile, conversationContext, ragContext, mcpTools
);
// Metrics returned with every response
return {
success: true,
data: response,
metrics: {
ragChunksUsed: ragContext.length,
mcpToolsAvailable: mcpTools.length,
promptTokenEstimate: prompt.tokenEstimate,
sessionMessages: session.messageHistory.length,
},
};14 Tools
The server exposes 14 tools organized in two categories: advisory tools (sync, knowledge-based) and platform tools (async, database-backed).
Advisory Tools (5)
yani_financial_advice
Finance, fiscal, crypto, epargne
yani_loyalty_advice
Fidelite, cashback, gamification
yani_identity_advice
KYC, RGPD, ZKP, biometrie
yani_banking_analysis
Neobanques, TPE, PSAN comparatif
yani_search_knowledge
Recherche cross-skills dans la KB
Platform Tools (9)
yani_get_balance
Soldes wallets EUR/YANI/BTC
yani_get_transactions
Historique avec stats aggregees
yani_get_payment_cards
Cartes physiques et virtuelles
yani_get_loyalty_cards
Programmes fidelite et points
yani_get_stores
Stores et commercants Pro
yani_tts_summary
Synthese vocale ElevenLabs
yani_get_kyc_status
Soumissions KYC et documents
yani_get_crypto_wallets
Wallets crypto internes + externes
yani_get_referrals
Parrainage, codes et conversions
Transports
stdio (Claude Code)
Direct pipe transport for Claude Code and CLI clients. Fastest option with zero network overhead.
src/index.tsHTTP/SSE (:3100)
Streamable HTTP with SSE for web clients. Session-based with API key authentication.
src/server-http.tsREST API (:3101)
Simple REST endpoints usable by any LLM via HTTP. Rate limited at 100 req/min/IP.
src/server-api.tsQuick Start
The fastest way to start using the Y.A.N.I. MCP Server is with Claude Code (stdio transport):
- Configure Claude Code— Add the MCP server to your
.claude/settings.json:.claude/settings.jsonjson{ "mcpServers": { "yani-advisor": { "command": "npx", "args": ["tsx", "mcp-server-yani/src/index.ts"], "cwd": "/path/to/yanipay-animation", "env": { "DATABASE_URL": "postgresql://user:pass@localhost:5432/yanipay" } } } } - Build the server:
cd mcp-server-yani pnpm install pnpm build - Test with the CLI:
# List all 14 tools ./yani-query.sh --list # Query financial advice ./yani-query.sh yani_financial_advice --query "Comment optimiser ma fiscalite a La Reunion?" # Get wallet balances ./yani-query.sh yani_get_balance --email user@example.com # Search knowledge base ./yani-query.sh yani_search_knowledge --query "fiscalite DOM"
Use Cases
The Y.A.N.I. MCP Server enables innovative AI-powered fintech experiences:
AI Financial Advisor
An LLM that analyzes a user's wallets, transactions, and crypto portfolio to provide personalized financial recommendations based on French DOM regulation.
Automated KYC Assistant
Guide users through identity verification by checking their KYC status, identifying missing documents, and providing step-by-step instructions for compliance.
Loyalty Optimization Bot
Analyze a user's loyalty cards, points balances, and cashback rates across merchants to recommend the best spending strategies.
Multi-Wallet Portfolio Tracker
Combine EUR wallets, crypto wallets, and external DeFi positions into a unified portfolio view with real-time valuation and risk scoring.
Next Steps
Tools Reference
Complete documentation for all 14 tools with schemas and examples
Resources & Prompts
MCP resources for config, data models, and pre-built analysis prompts
Integration Guide
Step-by-step guide for Claude Code, HTTP, REST, and custom clients
Security & Auth
API key authentication, rate limiting, data sanitization, and logging