KYC文档提取平台

MexKYC是一个专为墨西哥商业文档设计的AI驱动的KYC文档提取平台,支持从多种文档中提取结构化数据、构建统一客户档案、验证合规要求并生成全面的KYC报告。

  • by albertpikkop
  • HTML
  • 本地部署
  • 更新于
在 GitHub 查看 albertpikkop/kyc-docx-mcp-191125

使用说明

MexKYC-基于人工智能的墨西哥KYC

了解你的客户。了解墨西哥。

网站 • 文档 • api参考


🇲🇽 什么是MexKYC?

MexKYC 公司 是一个生产就绪的人工智能KYC(了解你的客户)文档提取平台,专为墨西哥商业文档设计。作为MCP(模型上下文协议)服务器构建,它与AI助手和自动化工作流程无缝集成。

从墨西哥监管文件中提取结构化数据,构建统一的客户档案,验证合规要求,并生成全面的KYC报告——所有这些都具有人工智能的精度。

✨ 特性

  • 🔍 多文档支持 -从7+种墨西哥商业文档中提取数据
  • 🤖 人工智能驱动的提取 -使用先进的视觉模型进行精确的OCR和数据提取
  • 📊 智能聚合 -从多个文档来源构建统一的KYC档案
  • 🏠 智能地址解析 -智能地址优先级逻辑(财政、运营和历史)
  • ✅ 验证引擎 -通过评分和风险标记进行全面验证
  • 🔌 MCP协议 -标准化的模型上下文协议,便于人工智能集成
  • 📝 类型安全 -带有Zod模式验证的完整TypeScript
  • 🔐 企业就绪 -多租户、审计日志记录和合规性功能

📄 支持的文档类型

文档 类型代码 它提取什么
宪法法案 acta 公司身份、股东、法定代表人、公司宗旨、公证信息
SAT康斯坦察 sat_constancia 税务概况、RFC、财政地址、经济活动、纳税义务
FM 2/居民卡 fm2 代表身份、国籍、移民身份、文件有效性
INE(选民ID) ine 个人身份、CURP、地址、照片验证
墨西哥电信法案 telmex 地址证明、账单信息、服务详情
CFE法案 cfe 地址证明、电费账户、用电数据
银行对账单 bank_statement 账户资料、交易记录、余额、银行地址

🏗️ 建筑

┌─────────────────────┐
│   AI Assistant      │  (ChatGPT, Claude, Custom)
│   or MCP Client     │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   MexKYC MCP        │  ← @mexkyc/mcp
│   Server            │
└──────────┬──────────┘
           │
    ┌──────┴──────┬──────────┬──────────┬──────────┐
    ▼             ▼          ▼          ▼          ▼
┌────────┐  ┌──────────┐ ┌────────┐ ┌────────┐ ┌────────┐
│Extract │  │Build     │ │Validate│ │Report  │ │Storage │
│Docs    │  │Profile   │ │        │ │        │ │        │
└────────┘  └──────────┘ └────────┘ └────────┘ └────────┘
    │
    ▼
┌─────────────────────┐
│  Document           │
│  Extractors         │  ← AI Vision Models
└─────────────────────┘

🚀 快速开始

先决条件

  • Node.js 20+
  • TypeScript 5.5+
  • API密钥(OpenAI或Google Gemini)

安装

# Install from npm
npm install @mexkyc/mcp

# Or clone the repository
git clone https://github.com/mexkyc/mexkyc-mcp.git
cd mexkyc-mcp
npm install

配置

创建一个 .env 文件:

# AI Model (choose one)
OPENAI_API_KEY=your_openai_api_key
# OR
GOOGLE_API_KEY=your_gemini_api_key

# Optional: Server configuration
PORT=3000
MCP_TRANSPORT=sse  # 'sse' for HTTP, omit for stdio

运行服务器

# Development mode
npm run dev

# Production build
npm run build
npm run start

# Run MCP server directly
npx mexkyc

📡 MCP工具API

MexKYC公开了5个用于文档处理的MCP工具:

1. list_supported_doc_types

列出所有支持的墨西哥文档类型。

// No parameters required
const result = await mcpClient.callTool("list_supported_doc_types", {});

2. import_kyc_document

从KYC文档中导入和提取数据。

await mcpClient.callTool("import_kyc_document", {
  customer_id: "empresa-xyz",
  doc_type: "sat_constancia",
  file_url: "https://storage.example.com/constancia.pdf",
  source_name: "SAT_2024.pdf"  // optional
});

3. build_kyc_profile

将所有导入的文件聚合到一个统一的KYC配置文件中。

await mcpClient.callTool("build_kyc_profile", {
  customer_id: "empresa-xyz"
});

4. validate_kyc_profile

验证KYC档案并生成合规评分。

await mcpClient.callTool("validate_kyc_profile", {
  customer_id: "empresa-xyz"
});

5. get_kyc_report

生成一份综合的KYC报告,结合个人资料和验证。

await mcpClient.callTool("get_kyc_report", {
  customer_id: "empresa-xyz",
  include_trace: true  // optional: include extraction details
});

💡 用法示例

// Complete KYC workflow
const customerId = "mi-empresa-sa";

// 1. Import SAT Constancia (tax certificate)
await import_kyc_document({
  customer_id: customerId,
  doc_type: "sat_constancia",
  file_url: "https://example.com/constancia.pdf"
});

// 2. Import Acta Constitutiva (incorporation deed)
await import_kyc_document({
  customer_id: customerId,
  doc_type: "acta",
  file_url: "https://example.com/acta.pdf"
});

// 3. Import proof of address
await import_kyc_document({
  customer_id: customerId,
  doc_type: "cfe",
  file_url: "https://example.com/cfe_bill.pdf"
});

// 4. Build unified profile
await build_kyc_profile({ customer_id: customerId });

// 5. Validate for compliance
await validate_kyc_profile({ customer_id: customerId });

// 6. Generate KYC report
const report = await get_kyc_report({ customer_id: customerId });

🏠 地址解析逻辑

MexKYC实现智能地址解析:

地址类型 源优先级
财政地址 SAT康斯坦察(规范)
运营地址 银行对账单>CFE/Telmex>SAT(备用)
历史地址 通过源跟踪保留所有地址
创始地址 宪法法案(仅供历史参考)

🔒 安全与合规

  • 多租户隔离 -组织级数据分离
  • 审核日志记录 -完整的合规审计跟踪
  • API密钥验证 -安全的API访问
  • 速率限制 -防止虐待
  • 需要HTTPS -加密数据传输

📁 项目结构

src/
├── extractors/          # Document-specific AI extractors
│   ├── actaCompanyIdentity.ts
│   ├── companyTaxProfileExtractor.ts
│   ├── ineIdentity.ts
│   ├── fm2Immigration.ts
│   ├── telmexProofOfAddress.ts
│   ├── cfeProofOfAddress.ts
│   └── bankStatementProfile.ts
├── kyc/                 # Core KYC logic
│   ├── types.ts         # Domain types
│   ├── profileBuilder.ts
│   ├── validation.ts
│   └── reportBuilder.ts
├── mcp/                 # MCP server implementation
│   ├── server.ts        # Main server with tool handlers
│   └── cli.ts           # CLI entry point
├── schemas/             # Zod schemas
│   └── mx/              # Mexican document schemas
└── utils/               # Utilities

🧪 测试

# Run all tests
npm test

# Test specific extractors
npm run test:constancia   # SAT Constancia
npm run test:acta         # Acta Constitutiva
npm run test:cfe          # CFE bills
npm run test:bank         # Bank statements

# End-to-end KYC tests
npm run test:kyc-pfds
npm run test:kyc-report-pfds

🤝 贡献

  1. 复刻仓库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

📄 许可证

ISC许可证-请参阅 许可证 了解详情。

🔗 链接

💬 支持


内置于❤️ 墨西哥金融科技生态系统

MexKYC-了解你的客户。了解墨西哥。