Skip to main content
Glama
K-phi-Entreprise

k-phi

Official

K-Phi — 公開MCPサーバー(スケルトン)

K-Phi分析をAIアシスタント(Claude、ChatGPT、Cursor、Copilotなど)に公開するMCPサーバー(Streamable HTTP、ステートレス)。匿名アクセスはレート制限付き、大容量ファイルは署名付きアップロード、変換はK-Phiへのディープリンク。

完全な仕様は kphi-mcp-public-spec.md を参照。

起動

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

環境変数:

変数

デフォルト

役割

PORT

3000

PUBLIC_BASE_URL

https://k-phi.com

open_in_kphi_url / report_share_url リンクのベース

INGEST_BASE_URL

http://localhost:PORT

署名付きアップロードリンクのベース

UTM_SOURCE

mcp

アトリビューション

Related MCP server: HLedger MCP Server

Claude Desktopでのテスト(掲載前)

claude_desktop_config.json に追加(または 設定 → コネクタ → カスタムコネクタを追加 で公開URLを指定):

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

その後、ClaudeでCSVを貼り付けて 「これが私の総勘定元帳エクスポートです。分析してもらえますか?」 と入力。kphi_analyze_ledger が呼び出されることを確認。次に約20種類の表現(比率、DSCR、資金繰り、コベナンツ、FEC、残高、「財務診断」など)をテストし、src/tools.ts のツール説明をルーティングが確実になるまで調整する。

構造

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

K-Phiへの接続(TODO 4件)

  1. engine.ts — 既存エンジンで AnalysisEngine を実装(インラインCSV用 analyze、アップロードファイル用 analyzeFromStorage)。

  2. store.ts — MemoryStore をPostgresに置き換え(専用スキーマ mcp_public、30日でパージ)。アップロードトークンはDBまたはRedis。

  3. server.ts /upload/:token — S3/R2の事前署名付きURL + アンチウイルスに置き換え、分析はインラインではなくイベント駆動でトリガー。

  4. ratelimit.ts — クォータをRedisに。既存認証に接続したOAuth 2.1(Bearer)チェックを追加し、アカウントのクォータを引き上げ。

K-Phiアプリ側:/a/:analysis_id ルート(マジックリンクでアカウント作成し分析を紐付け、これがコンバージョンポイント)、および読み取り専用で共有可能な /r/:analysis_id ルート。

掲載

ディレクトリの通常の前提条件:公開HTTPS URL、OAuth 2.1または文書化された匿名アクセス、プライバシーポリシー、サポート窓口、説明とアイコン。最新の基準を確認:https://docs.claude.com と https://support.claude.com(Claude)、OpenAIのChatGPT向けドキュメント、registry.modelcontextprotocol.io。

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    B
    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
    60 npm
    38
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI assistants with direct access to HLedger accounting data and functionality, enabling natural language queries for balances, reports, journal entries, and financial analysis.
    22 npm
    65
    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
    63 npm
    1
    Business Source 1.1
  • A
    license
    B
    quality
    A
    maintenance
    Enables AI assistants to query and manage self-hosted accounting data—invoices, balances, and books—through natural language, with read-only tools by default and optional scoped write operations.
    30
    AGPL 3.0