Skip to main content
Glama
k-phi

k-phi

Official

K-Phi — public MCP server (skeleton)

MCP server (Streamable HTTP, stateless) exposing K-Phi analysis to AI assistants (Claude, ChatGPT, Cursor, Copilot…). Anonymous rate-limited access, signed upload for large files, deep link to K-Phi for conversion.

See kphi-mcp-public-spec.md for the full spec.

Run

npm install
npm run dev            # compile + démarre sur :3000
curl localhost:3000/healthz

Environment variables:

Var

Default

Role

PORT

3000

PUBLIC_BASE_URL

https://k-phi.com

base for open_in_kphi_url / report_share_url links

INGEST_BASE_URL

http://localhost:PORT

base for signed upload links

UTM_SOURCE

mcp

attribution

Related MCP server: dingdawg-finance-agent

Test in Claude Desktop (before listing)

Add to claude_desktop_config.json (or via Settings → Connectors → Add custom connector with the public URL):

{
  "mcpServers": {
    "k-phi": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:3000/mcp"]
    }
  }
}

Then in Claude: "Here is my general ledger export, can you analyze this for me?" while pasting a CSV. Verify that kphi_analyze_ledger is called. Then test ~20 phrasings (ratios, DSCR, cash flow, covenants, FEC, balance sheet, "financial diagnostic"…) and adjust the tool description in src/tools.ts until routing is reliable.

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

Connect to K-Phi (the 4 TODOs)

  1. engine.ts — implement AnalysisEngine with your existing engine (analyze for inline CSV, analyzeFromStorage for uploaded files).

  2. store.ts — replace MemoryStore with Postgres (dedicated mcp_public schema, 30-day purge); upload tokens in database or Redis.

  3. server.ts /upload/:token — replace with a pre-signed S3/R2 URL + antivirus, and trigger analysis on event rather than inline.

  4. ratelimit.ts — quotas in Redis; add OAuth 2.1 (Bearer) verification wired to your existing auth to lift quotas for accounts.

On the K-Phi application side: /a/:analysis_id route that creates an account via magic link and attaches the analysis (this is the conversion point), and /r/:analysis_id route in read-only shareable mode.

Listing

Usual directory prerequisites: public HTTPS URL, OAuth 2.1 or documented anonymous access, privacy policy, support contact, description and icon. Check current criteria: https://docs.claude.com and https://support.claude.com (Claude), OpenAI documentation for ChatGPT, registry.modelcontextprotocol.io.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Enables conversational data analysis of Excel/CSV files through natural language queries, powered by 395 Excel functions via HyperFormula and multi-provider AI. Supports advanced analytics, bulk operations, financial modeling, and large file processing with intelligent chunking.
      35
      37 npm
      38
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to perform financial analysis, budget forecasting, compliance checks, expense categorization, and risk assessment, returning structured JSON with audit-ready governance receipts.
      5
      100 npm
      1
      Business Source 1.1
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to read local Kitsas bookkeeping files and prepare draft vouchers for human review and posting.
      2
      GPL 3.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables small-business owners to turn bank CSVs and open invoices into spoken cash-position answers, 13-week forecasts, affordability checks, and ranked cash-shortfall plans, with human-confirmed sandbox actions.
      MIT