1) 安装依赖项(如果尚未安装)
npm install # or: pnpm install / yarn install2) 构建服务器(生产)
npx nx build askme-server3) 构建UI(生产)
npx nx build askme-uiMCP配置 您的示例配置对于在stdio模式下使用内置服务器是正确的:
"ask-me-mcp": {
"command": "node",
"args": [
"C:/Temp/_Work/ask-me-mcp/dist/askme-server/main.js"
],
"disabled": false,
"disabledTools": [
"choose-next",
"challenge-hypothesis",
"ask-multiple-choice"
]
}AskMeMCP-人在环MCP服务器
AskMeMCP是一个模型上下文协议(MCP)服务器,它使AI助手能够通过web界面请求人类输入。它实现了多种交互式工具(ask-one-question, ask-multiple-choice, challenge-hypothesis, choose-next),允许像Claude Code这样的MCP客户端暂停执行并等待人工响应。
特性
- stdio运输:与Claude Code和其他MCP客户端直接集成
- 独立服务器:静态提供Angular UI-不需要单独的UI服务器
- 动态端口分配:如果使用默认端口,则自动查找可用端口
- 自动打开浏览器:请求到达时自动打开UI
- 实时更新:服务器发送实时通信事件
- 多种工具类型:单项问题、多项选择题、假设挑战和决策工作流程
安装
选项1:使用npx(无需安装)
您可以直接使用npx运行Ask Me MCP,而无需全局安装:
npx ask-me-mcp注意:第一次运行此程序时,npx将要求确认临时安装该软件包。要跳过此确认,请使用:
npx --yes ask-me-mcp选项2:全局安装
npm install -g ask-me-mcp
ask-me-mcp不同客户端的配置
Claude桌面应用程序
添加到您的Claude配置文件中:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 视窗:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"ask-me": {
"command": "npx",
"args": ["--yes", "ask-me-mcp"]
}
}
}克劳德代码
使用CLI:
claude mcp add askme -- npx -y ask-me-mcp或者手动添加到您的Claude Code配置中:
- macOS:
~/Library/Application Support/Claude/claude_code_config.json - 视窗:
%APPDATA%\Claude\claude_code_config.json - Linux:
~/.config/Claude/claude_code_config.json
{
"mcpServers": {
"ask-me": {
"command": "npx",
"args": ["--yes", "ask-me-mcp"]
}
}
}光标
添加到光标设置(中 .cursor/mcp_settings.json 在项目根目录中):
{
"mcpServers": {
"ask-me": {
"command": "npx",
"args": ["--yes", "ask-me-mcp"]
}
}
}带有Continue或类似扩展名的VS代码
对于支持MCP的VS Code扩展,请添加到扩展的配置中:
{
"mcpServers": {
"ask-me": {
"command": "npx",
"args": ["--yes", "ask-me-mcp"]
}
}
}端口配置
服务器有两种端口行为:
- 自动发现(默认):查找从3000开始的可用端口
npx --yes ask-me-mcp- 固定端口:使用指定的精确端口
--port(如果端口正在使用中,则失败)
npx --yes ask-me-mcp --port 8080对于固定端口的Claude Code配置:
{
"mcpServers": {
"ask-me": {
"command": "npx",
"args": ["--yes", "ask-me-mcp", "--port", "8080"]
}
}
}选项3:从源代码构建
# Clone the repository
git clone https://github.com/yourusername/AskMeMCP.git
cd AskMeMCP
# Install dependencies
npm install
# Build all projects
npm run build
# Configure Claude Code with full path添加到您的Claude代码配置中:
{
"mcpServers": {
"ask-me": {
"command": "node",
"args": ["/full/path/to/AskMeMCP/dist/askme-server/main.js"]
}
}
}用法
配置后,您可以使用Claude Code中的可用工具:
提问工具
Please use the ask-one-question tool to ask me what my favorite color is问多项选择题工具
Please use the ask-multiple-choice tool with these questions:
{
"questions": [
{
"text": "Which deployment environments should we target?",
"options": ["Development", "Staging", "Production"]
},
{
"text": "Which features should be included in this release?",
"options": ["User Authentication", "Dashboard Updates", "API Improvements", "Mobile Support"]
}
]
}所有请求都将出现在web UI中,您可以在其中提供响应。对于多项选择题,您可以选择多个选项并为每个选项添加注释。
建筑
- askme服务器:stdio MCP服务器,带有用于浏览器通信的嵌入式HTTP桥
- askme ui:Angular 20+前端,使用信号进行反应式UI
- askme分享:用于前端后端通信的共享TypeScript类型
发展
# Run the UI in development mode
npx nx serve askme-ui
# Run the server in development mode
npx nx serve askme-server
# Run tests
npx nx test askme-ui
npx nx test askme-server
# Lint code
npx nx lint askme-ui
npx nx lint askme-server故障排除
Claude代码的连接问题
如果您看到“连接失败”错误:
- 启用调试模式:运行调试日志以查看发生了什么:
ASK_ME_MCP_DEBUG=1 claude --debug- 检查服务器:测试服务器是否正常运行:
npx --yes ask-me-mcp --help- 端口冲突:如果端口3000正在使用中,请指定其他端口:
claude mcp add ask-me npx --yes ask-me-mcp --port 8080- 手动测试:直接运行服务器以查看任何错误:
npx --yes ask-me-mcp常见问题
- 首次确认:第一轮
npx ask-me-mcp可能会要求确认。使用npx --yes跳过这个。 - 端口已在使用中:服务器会自动找到可用端口,但您可以使用以下命令指定一个端口
--port - 浏览器未打开:如果浏览器没有自动打开,请手动导航到调试日志中显示的端口
许可证
麻省理工学院
