LSPD 询问 MCP 服务器
由 OpenAI 提供支持的基于模型上下文协议 (MCP) 的警察审讯模拟服务器。
📌 主要特点
- MCP集成:
- 使用模型上下文协议 SDK 构建
- HTTP 传输支持
- 动态资源管理(警官档案、行为审讯)
- OpenAI集成:
- 使用 GPT-3.5-turbo 模型
- 生成动态审讯策略
- 模拟嫌疑人的反应
- 创造真实的对话流程
- 核心组件:
- 警员档案管理
- 智能审讯机制
- 嫌疑人行为模拟
- 犯罪类型与证据整合
🚀 安装
pnpm install
# Required environment variables
cp .env.example .env
# Start server
pnpm start
⚙️ 配置
.env
文件:
OPENAI_API_KEY=your_api_key_here
config.ts
中可配置的参数:
🌐 API 端点
官员简介
GET /profile/:badgeNumber
curl http://localhost:3000/profile/1234
开始审讯
POST /interrogations/{suspectId}
{
"suspectName": "John Doe",
"pressureLevel": 75,
"crime": "Armed robbery",
"evidence": ["Fingerprint", "Security camera footage"]
}
嫌疑人回应
POST /interrogations/{suspectId}/respond
{
"suspectName": "John Doe",
"officerStatement": "Your fingerprints were found at the crime scene!",
"guilt": 85,
"personality": "cowardly",
"previousResponses": ["I'm innocent!"]
}
🔍 使用示例
# Get officer profile
curl http://localhost:3000/profile/1234
# Start interrogation
curl -X POST http://localhost:3000/interrogations/suspect_01 \
-H "Content-Type: application/json" \
-d '{
"suspectName": "John Doe",
"pressureLevel": 80,
"crime": "Drug trafficking",
"evidence": ["Search records", "Confidential witness statement"]
}'
✅ 数据验证
所有端点都包括使用 Zod 库的强类型检查和验证:
- 压力等级:0-100(必填)
- 嫌疑人姓名:字符串格式
- 证据:字符串数组(可选)
🔒 安全
- 通过环境变量管理的敏感数据(OpenAI API 密钥)
- 生产环境中的 HTTPS 强制执行
- 通过请求验证来确保输入处理的安全
🤝 贡献
- 分叉存储库
- 创建新分支(
feat/my-feature
或fix/issue-number
) - 提交你的更改
- 推送到分支
- 打开拉取请求
📜 许可证
根据 MIT 许可证分发。