Skip to content

TripQi/DeepProbeTS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepProbeTS

一个基于 TypeScript 的 MCP Server,提供 deep_probe 工具:让模型在用户浏览器中发起结构化访谈(多步问答、回顾、提交),并把答案回传给调用方。

功能概览

  • 提供 MCP 工具:deep_probe
  • 自动拉起本地临时网页问卷(127.0.0.1 随机端口)
  • 支持单选 / 多选 / 可选自定义输入
  • 支持超时返回(默认 300 秒)
  • 对提交数据做基础校验(含请求体大小限制)

环境要求

  • Node.js 18+
  • npm 9+

快速开始

npm install
npm run build
npm test

构建后入口为:dist/index.js

作为 MCP Server 使用

本项目通过 stdio 方式接入 MCP 客户端。

1) JSON 配置示例(Claude Desktop / Cline 风格)

生产模式(推荐,使用构建产物)

{
  "mcpServers": {
    "deep-probe": {
      "command": "node",
      "args": ["D:\\mcp\\DeepProbeTS\\dist\\index.js"],
      "cwd": "D:\\mcp\\DeepProbeTS"
    }
  }
}

开发模式(便于调试,直接跑 TS)

{
  "mcpServers": {
    "deep-probe": {
      "command": "npx",
      "args": ["tsx", "D:\\mcp\\DeepProbeTS\\src\\index.ts"],
      "cwd": "D:\\mcp\\DeepProbeTS"
    }
  }
}

2) TOML 配置示例(Codex CLI 风格)

将以下内容加入 ~/.codex/config.toml

生产模式(推荐)

[mcp_servers.deep-probe]
type = "stdio"
command = "node"
args = ["D:\\mcp\\DeepProbeTS\\dist\\index.js"]
cwd = "D:\\mcp\\DeepProbeTS"

开发模式

[mcp_servers.deep-probe]
type = "stdio"
command = "npx"
args = ["tsx", "D:\\mcp\\DeepProbeTS\\src\\index.ts"]
cwd = "D:\\mcp\\DeepProbeTS"

deep_probe 工具说明

  • 工具名:deep_probe
  • 入参:
    • title:访谈标题
    • description:访谈说明
    • questions:问题列表(至少 1 个)
    • timeout_seconds:超时时间(秒,默认 300)

每个 questions[] 项支持:

  • id:问题唯一标识
  • question:题干
  • context:补充说明(可选)
  • options:选项数组,每项支持 label / value / description / recommended
  • allow_custom:是否允许用户额外填写文本(可选)
  • multi_select:是否多选(可选)

调用示例

{
  "name": "deep_probe",
  "arguments": {
    "title": "技术方案确认",
    "description": "请完成以下关键决策,以便生成实施方案。",
    "timeout_seconds": 300,
    "questions": [
      {
        "id": "framework",
        "question": "你希望使用哪个后端框架?",
        "options": [
          { "label": "Express", "value": "express", "recommended": true },
          { "label": "Fastify", "value": "fastify" }
        ]
      },
      {
        "id": "constraints",
        "question": "还有什么约束条件?",
        "allow_custom": true,
        "options": []
      }
    ]
  }
}

成功返回(示例):

{
  "status": "completed",
  "answers": [
    {
      "question_id": "framework",
      "question": "你希望使用哪个后端框架?",
      "selected_options": ["express"],
      "custom_input": null,
      "is_custom": false
    }
  ]
}

常见问题

  • 浏览器未自动打开:手动访问日志输出的 http://127.0.0.1:<port>
  • 超时返回:会得到 status = "timeout"answers = []
  • 参数错误:会得到 status = "error",并附带错误信息

开发命令

npm run start   # 直接运行 src/index.ts
npm run build   # 编译到 dist/
npm test        # 运行测试

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors