Skip to main content
Glama
K-phi-Entreprise

k-phi

Official

K-Phi — 公共 MCP 服务器(骨架)

公共 MCP 服务器(Streamable HTTP,无状态),向 AI 助手(Claude、ChatGPT、Cursor、Copilot 等)提供 K-Phi 分析能力。匿名访问限流,大文件使用签名上传,通过 deep link 跳转 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、现金流、covenants、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(4 个 TODO)

  1. engine.ts — 使用现有引擎实现 AnalysisEngine(内联 CSV 用 analyze,上传文件用 analyzeFromStorage)。

  2. store.ts — 将 MemoryStore 替换为 Postgres(专用 schema mcp_public,30 天清理);上传令牌存入数据库或 Redis。

  3. server.ts /upload/:token — 替换为 S3/R2 预签名 URL + 防病毒扫描,并改为事件触发分析而非在线执行。

  4. ratelimit.ts — 配额存入 Redis;增加 OAuth 2.1(Bearer)校验,接入现有认证体系,为已登录账户解除配额限制。

K-Phi 应用侧:/a/:analysis_id 路由通过 magic link 创建账户并关联分析(这是转化点),/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