Token导航 LogoToken导航TokenDH.com
Render Question MCP logo
AI代理未说明官方级别未说明来源级核验

Render Question MCP

MCP Server

一个MCP服务器,通过原生UI表单收集结构化、经过验证的用户输入,适用于AI代理的数据收集场景。

工具数

1

提示词数

0

GitHub Stars

0

资源数

0
TypeScriptClaudeAI代理Claude DesktopClaudeCursorClineVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

vltansky

提供方

vltansky

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

呈现问题mcp

一种MCP(模型上下文协议)服务器,使人工智能代理能够使用启发通过原生UI表单收集结构化、经验证的用户输入。

特性

  • 6问题类型:文本、数字、布尔值、单选、下拉列表、复选框(具有真正的多选支持!)
  • 多选复选框:本机阵列支持选择多个选项
  • 全面验证:必填字段、最小/最大值、模式、电子邮件/URI格式
  • 类型安全:使用TypeScript和Zod构建,用于运行时验证
  • 原生UI:在MCP客户端的本机界面中呈现表单
  • 零歧义:消除了数据收集的来回对话

安装

先决条件

  • Node.js >= 20.0.0
  • MCP兼容客户端(Cursor、Claude Desktop、VS Code等)

入门指南

首先,在客户端安装render-question-mcp服务器。

标准配置 适用于大多数工具:

{
  "mcpServers": {
    "render-question": {
      "command": "npx",
      "args": [
        "render-question-mcp@latest"
      ]
    }
  }
}

Claude Code

使用Claude Code CLI添加服务器:

claude mcp add render-question npx render-question-mcp@latest

Claude Desktop

添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "render-question": {
      "command": "npx",
      "args": ["render-question-mcp@latest"]
    }
  }
}

Cursor

单击按钮安装:

![Install in Cursor](https://cursor.com/en-US/install-mcp?name=render-question&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJyZW5kZXItcXVlc3Rpb24tbWNwQGxhdGVzdCJdfQ==)

或手动安装:

首选 Cursor SettingsMCPAdd new MCP Server.按你的喜好命名,使用 command 使用命令键入 npx render-question-mcp@latest。您还可以通过单击来验证配置或添加命令参数 Edit.

项目特定配置

创建 .cursor/mcp.json 在项目根目录中:

{
  "mcpServers": {
    "render-question": {
      "command": "npx",
      "args": ["render-question-mcp@latest"]
    }
  }
}

VS Code

跟随 MCP安装指南,使用上面的标准配置。

或者,使用VS Code CLI进行安装:

code --add-mcp '{"name":"render-question","command":"npx","args":["render-question-mcp@latest"]}'

Cline

通过Cline VS Code扩展设置或更新您的 cline_mcp_settings.json 文件:

{
  "mcpServers": {
    "render-question": {
      "command": "npx",
      "args": [
        "render-question-mcp@latest"
      ]
    }
  }
}

Zed

跟随 MCP服务器文档.使用上面的标准配置。

______________________________________________________________________

地方发展

对于本地开发和测试:

{
  "mcpServers": {
    "render-question": {
      "command": "node",
      "args": ["/absolute/path/to/render-question-mcp/dist/index.js"],
      "env": {
        "LOG_LEVEL": "debug"
      }
    }
  }
}

______________________________________________________________________

验证安装

安装后,验证渲染问题mcp是否正常工作:

  1. 重新启动MCP客户端 完全
  2. 检查连接状态:

- 光标:在设置中查找绿点→ 工具和集成→ MCP工具 - 克劳德桌面:检查可用工具中的“render_question” - VS Code:在GitHub Copilot设置中验证

  1. 使用简单查询进行测试:
   Ask me for my name and email address

如果你看到AI代理使用 render_question 工具并显示本机表单,您就准备好了! 🎉

用法

服务器提供了一个工具: render_question

基本示例:单个文本字段

{
  "questions": [
    {
      "id": "email",
      "type": "text",
      "label": "What is your email address?",
      "validation": {
        "required": true,
        "format": "email"
      },
      "helpText": "We'll use this for project notifications",
      "placeholder": "developer@example.com"
    }
  ]
}

示例:多问题表单

{
  "title": "Developer Onboarding",
  "description": "Help us set up your development environment",
  "questions": [
    {
      "id": "name",
      "type": "text",
      "label": "Your full name",
      "validation": {
        "required": true,
        "minLength": 2
      },
      "placeholder": "Jane Doe"
    },
    {
      "id": "experience",
      "type": "number",
      "label": "Years of experience with TypeScript",
      "validation": {
        "required": true,
        "min": 0,
        "max": 50
      }
    },
    {
      "id": "role",
      "type": "dropdown",
      "label": "What's your primary role?",
      "options": [
        { "value": "frontend", "label": "Frontend Developer" },
        { "value": "backend", "label": "Backend Developer" },
        { "value": "fullstack", "label": "Full-Stack Developer" },
        { "value": "devops", "label": "DevOps Engineer" }
      ],
      "validation": { "required": true }
    },
    {
      "id": "remote",
      "type": "boolean",
      "label": "Are you working remotely?",
      "default": true
    }
  ]
}

问题类型

文本输入

{
  "id": "username",
  "type": "text",
  "label": "Username",
  "validation": {
    "required": true,
    "minLength": 3,
    "maxLength": 20,
    "pattern": "^[a-zA-Z0-9_]+$"
  },
  "placeholder": "john_doe"
}

数字输入

{
  "id": "port",
  "type": "number",
  "label": "Port Number",
  "validation": {
    "required": true,
    "min": 1,
    "max": 65535
  },
  "default": 3000
}

布尔值(单选框)

{
  "id": "agree",
  "type": "boolean",
  "label": "I agree to the terms and conditions",
  "validation": {
    "required": true
  }
}

单选按钮(单选)

{
  "id": "theme",
  "type": "radio",
  "label": "Select a theme",
  "options": [
    { "value": "light", "label": "Light Mode" },
    { "value": "dark", "label": "Dark Mode" },
    { "value": "auto", "label": "Auto (System)" }
  ],
  "validation": {
    "required": true
  }
}

下拉菜单(单选)

{
  "id": "framework",
  "type": "dropdown",
  "label": "Choose a framework",
  "options": [
    { "value": "react", "label": "React" },
    { "value": "vue", "label": "Vue.js" },
    { "value": "angular", "label": "Angular" },
    { "value": "svelte", "label": "Svelte" }
  ]
}

复选框(多选)✨ 新

{
  "id": "features",
  "type": "checkbox",
  "label": "Select features to enable",
  "options": [
    { "value": "auth", "label": "Authentication" },
    { "value": "db", "label": "Database Integration" },
    { "value": "api", "label": "REST API" },
    { "value": "websocket", "label": "WebSocket Support" }
  ],
  "validation": {
    "min": 1,  // Require at least 1 selection
    "max": 3   // Allow maximum 3 selections
  },
  "helpText": "Choose all features you want to include"
}

多选响应格式:

{
  "features": ["auth", "db", "api"]  // Array of selected values
}

验证选项

  • 必需的: boolean -必须填写字段
  • 分钟 / 最大: number -数字的最小值/最大值,或复选框数组的最小项/最大项
  • 最小长度 / 最大长度: number -字符串的最小/最大长度
  • 模式: string -正则表达式模式
  • 格式: "email" | "uri" | "url" | "date" | "date-time" -格式验证
  • 错误消息: string -自定义错误消息

响应格式

该工具返回结构化响应:

{
  "answers": {
    "name": "Jane Doe",
    "experience": 5,
    "role": "fullstack",
    "remote": true,
    "features": ["auth", "db", "api"]
  },
  "metadata": {
    "completedAt": "2025-11-13T10:30:00Z",
    "duration": 15000,
    "action": "submit"
  }
}

可能采取的行动:

  • submit -用户已提交表单
  • cancel -用户取消了对话框
  • decline -用户拒绝回答

发展

设置

pnpm install
pnpm build

测试

pnpm test
pnpm test:coverage

局部测试

  1. 构建项目:
   pnpm build
  1. 本地链接:
   npm link
  1. 配置您的MCP客户端以使用本地构建
  1. 与MCP检查员或客户进行测试

示例

请参阅 示例 真实世界用例目录:

建筑

src/
├── index.ts              # CLI entry point
├── server.ts             # MCP server setup
├── stdio.ts              # Stdio transport
├── types.ts              # TypeScript type definitions
├── elicitation/
│   ├── core.ts           # Core elicitation logic
│   └── schemas.ts        # Schema builders
└── tools/
    ├── index.ts          # Tool registry
    └── render_question.ts # Main tool implementation

对于AI代理

代理商.md 以获取在人工智能工作流程中有效使用此工具的详细指导。

许可证

麻省理工学院

贡献

欢迎投稿!请阅读投稿指南并提交PR。

相关项目

目录标签

目录标签

TypeScriptClaudeAI代理表单渲染本地部署数据收集UI表单输入验证

支持客户端

Claude DesktopClaudeCursorClineVS Code

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP