k-phi
Enables AI assistants to perform anonymous financial analysis on uploaded general ledger (GL) exports, covering ratios, DSCR, cash flow, and other diagnostics, with deep links to the K-Phi platform for conversion.
README
K-Phi — serveur MCP public (squelette)
Serveur MCP (Streamable HTTP, stateless) exposant l'analyse K-Phi aux assistants IA (Claude, ChatGPT, Cursor, Copilot…). Accès anonyme rate-limité, upload signé pour les gros fichiers, deep link vers K-Phi pour la conversion.
Voir kphi-mcp-public-spec.md pour la spec complète.
Lancer
npm install
npm run dev # compile + démarre sur :3000
curl localhost:3000/healthz
Variables d'environnement :
| Var | Défaut | Rôle |
|---|---|---|
PORT |
3000 | |
PUBLIC_BASE_URL |
https://k-phi.com | base des liens open_in_kphi_url / report_share_url |
INGEST_BASE_URL |
http://localhost:PORT | base des liens d'upload signés |
UTM_SOURCE |
mcp | attribution |
KPHI_UPLOAD_STORAGE |
(non défini) | backend de stockage des uploads volumineux. Non défini → upload désactivé (refus honnête, PUT → 501). tmp → fichiers sous os.tmpdir()/kphi-uploads, tmp:/chemin → répertoire dédié (TTL 24 h, supprimés dès l'analyse réussie). mock → routage seul (moteur mock). Valeur inconnue → désactivé avec avertissement : on n'accepte jamais un fichier qu'on ne saura pas relire. |
KPHI_SANDBOX_MAX_ENTRIES |
200000 | cap d'écritures de l'analyse anonyme — DOIT refléter SANDBOX_MAX_ENTRIES côté moteur. Dépassement → refus clair AVANT la création du sandbox (LimitError), au lieu d'un 429 à mi-import. |
Tester dans Claude Desktop (avant référencement)
Ajouter dans claude_desktop_config.json (ou via Paramètres → Connecteurs → Ajouter un connecteur personnalisé avec l'URL publique) :
{
"mcpServers": {
"k-phi": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/mcp"]
}
}
}
Puis dans Claude : « Voici mon export de grand livre, peux-tu m'analyser ça ? » en collant
un CSV. Vérifier que kphi_analyze_ledger est appelé. Tester ensuite ~20 formulations
(ratios, DSCR, trésorerie, covenants, FEC, balance, « diagnostic financier »…) et ajuster
la description de l'outil dans src/tools.ts jusqu'à ce que le routage soit fiable.
Structure
src/
server.ts endpoint /mcp (stateless), /upload/:token, /healthz
tools.ts les 4 outils + descriptions (= le pitch lu par le modèle)
engine.ts interface AnalysisEngine + MockEngine
store.ts interface Store + MemoryStore
ratelimit.ts session anonyme + quotas
Brancher sur K-Phi (les 4 TODO)
engine.ts— implémenterAnalysisEngineavec votre moteur existant (analyzepour le CSV inline,analyzeFromStoragepour les fichiers déposés).store.ts— remplacerMemoryStorepar Postgres (schéma dédiémcp_public, purge à 30 j) ; jetons d'upload en base ou Redis.server.ts/upload/:token— remplacer par une URL pré-signée S3/R2 + antivirus, et déclencher l'analyse sur événement plutôt qu'en ligne.ratelimit.ts— quotas dans Redis ; ajouter la vérification OAuth 2.1 (Bearer) branchée sur votre auth existante pour lever les quotas des comptes.
Côté application K-Phi : route /a/:analysis_id qui crée un compte par magic link et
rattache l'analyse (c'est le point de conversion), et route /r/:analysis_id en lecture
seule partageable.
Référencement
Prérequis habituels des annuaires : URL publique HTTPS, OAuth 2.1 ou accès anonyme documenté, politique de confidentialité, contact support, description et icône. Vérifier les critères à jour : https://docs.claude.com et https://support.claude.com (Claude), documentation OpenAI pour ChatGPT, registry.modelcontextprotocol.io.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.