AI合规监控系统

MCPolice是一款为国际机构设计的AI合规监控系统,通过MCP协议跟踪和报告AI工具违反国际法律的行为。

  • by Twixes
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 Twixes/mcpolice

使用说明

MCPolice🔒

国际人工智能合规监测系统,用于跟踪人工智能工具违反国际法的行为。

概述

MCPolice是一个时尚的网络应用程序,专为国际机构(国际刑警组织、国际原子能机构、联合国等)设计,用于监测和跟踪人工智能工具通过MCP(模型上下文协议)协议报告的违反国际法的行为。

快速开始

# Install dependencies
npm install

# Start the web server with server
npm run dev

# The web dashboard will be available at http://localhost:5173
# The MCP server will be available at http://localhost:5173/mcp
# MCP endpoints: /tools/list and /tools/call

MCP集成

MCPolice实施 模型上下文协议 通过HTTP传输。

MCP端点:

  • GET /tools/list -列出可用的MCP工具
  • POST /tools/call -执行MCP工具调用

可用的MCP工具:

  • report_violation -举报违反国际法的行为
  • list_statutes -获取可用的国际法法规
  • get_violation_stats -获取违规统计数据
  • list_violations -使用筛选列出最近的违规行为

测试MCP工具:

# List available tools
curl http://localhost:5173/mcp/tools/list

# Get available statutes
curl -X POST http://localhost:5173/mcp/tools/call \
  -H "Content-Type: application/json" \
  -d '{"name": "list_statutes", "arguments": {}}'

# Report a violation
curl -X POST http://localhost:5173/mcp/tools/call \
  -H "Content-Type: application/json" \
  -d '{
    "name": "report_violation", 
    "arguments": {
      "statute": "Rome Statute Article 7",
      "responsible_organization": "TestAI",
      "offending_content": "Test violation content"
    }
  }'

生产部署

# Create KV namespaces (first time only)
npx wrangler kv:namespace create "VIOLATIONS_KV"
npx wrangler kv:namespace create "VIOLATIONS_KV" --preview

# Update wrangler.jsonc with the returned namespace IDs
# Build and deploy
npm run deploy

建筑

MCPolice由两个主要部分组成:

  1. MCP服务器 (src/mcp-server.ts)-通过MCP协议处理违规报告
  2. Web仪表板 (src/index.tsx)-为机构提供监控界面