io.github.Jacob-J-Thomas/user-prompt

AI 与智能体

by jacob-j-thomas

一个 MCP server,让 AI agent 可通过弹出式终端窗口向用户提出澄清性问题。

什么是 io.github.Jacob-J-Thomas/user-prompt

一个 MCP server,让 AI agent 可通过弹出式终端窗口向用户提出澄清性问题。

README

User Prompt MCP Server

.NET License

mcp-name: io.github.Jacob-J-Thomas/user-prompt

A Model Context Protocol (MCP) server that gives AI agents the ability to ask users clarifying questions mid-task via a pop-up terminal window. Built with .NET 8 and C#.

The Problem

Long-running AI agents (like Claude Code, IDE copilots, or custom agentic workflows) often encounter situations where they need human input — ambiguous requirements, unexpected errors, or design decisions that could go multiple ways. Without a mechanism to ask, the agent either guesses (often incorrectly) or stops entirely and waits for the user to notice.

The Solution

This MCP server exposes a single tool, user_prompt, that an AI agent can call at any point during execution. When invoked, a new terminal window opens on the user's machine displaying the agent's questions. The user types their answers and the responses are returned directly to the agent, allowing it to continue working with the additional context.

Terminal prompt demo

Features

  • Pop-up terminal prompt — questions appear in a dedicated window, separate from the agent's own I/O
  • Multi-question support — the agent can ask multiple questions in a single call; all are displayed upfront as a numbered list
  • Structured responses — answers are returned as clearly formatted Q&A pairs the agent can parse
  • Timeout handling — 10-minute response window with graceful fallback messaging
  • Window-closed detection — if the user closes the prompt without answering, the agent receives a clear notification
  • Stdio transport — communicates over stdin/stdout per the MCP specification, compatible with any MCP client

Prerequisites

  • Windows: PowerShell 5.1+ (included with Windows 10/11)
  • macOS/Linux (untested): PowerShell Core (pwsh) must be installed

Note: Pre-built releases have no other dependencies. The .NET Global Tool and Build from Source options require the .NET 8.0 SDK or later.

Quick Start

Pick one of the three install options below. Each option walks you through installation, client configuration, and updates end-to-end.


Option A: GitHub Releases

Self-contained executables — no .NET SDK required.

1. Download

Grab the zip for your platform from the latest release:

PlatformAsset
Windows (x64)UserPromptMcpServer-win-x64.zip
macOS (Intel)UserPromptMcpServer-osx-x64.zip
macOS (Apple Silicon)UserPromptMcpServer-osx-arm64.zip
Linux (x64)UserPromptMcpServer-linux-x64.zip

2. Extract

Unzip to a permanent location, for example:

  • Windows: C:\Tools\UserPromptMcpServer\
  • macOS / Linux: ~/tools/UserPromptMcpServer/

3. Configure your MCP client

Claude Code (CLI):

bash
claude mcp add user-prompt -- "C:\Tools\UserPromptMcpServer\UserPromptMcpServer.exe"

Other clients — point the command at the executable (see Client Configuration Reference for full examples):

json
{
  "command": "C:\\Tools\\UserPromptMcpServer\\UserPromptMcpServer.exe"
}

Updating: download the new release and replace the files in the same folder.


Option B: .NET Global Tool

Requires the .NET 8.0 SDK or later. The tool is added to your PATH automatically.

1. Install

bash
dotnet tool install -g UserPrompt

2. Configure your MCP client

Claude Code (CLI):

bash
claude mcp add user-prompt -- user-prompt

Other clients — the command name is user-prompt (see Client Configuration Reference for full examples):

json
{
  "command": "user-prompt"
}

Updating:

bash
dotnet tool update -g UserPrompt

Option C: Build from Source

Requires the .NET 8.0 SDK or later.

bash
git clone https://github.com/Jacob-J-Thomas/user-context-retrieval-mcp-server.git
cd user-context-retrieval-mcp-server
dotnet publish UserPromptMcpServer -c Release -r win-x64 -o ./publish

Replace win-x64 with your platform's runtime identifier (e.g. osx-arm64, linux-x64).

Then configure your client the same way as Option A, pointing at the executable inside ./publish/.


Client Configuration Reference

This server uses the stdio transport — it does not listen on a port. The MCP client launches the server process and communicates with it over stdin/stdout. Replace the command/path below with the value from whichever install option you chose.

Claude Desktop

Add the following to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "user-prompt": {
      "command": "/path/to/UserPromptMcpServer.exe"
    }
  }
}

Config file location:

PlatformPath
Windows%APPDATA%\Claude\claude_desktop_config.json
macOS~/Library/Application Support/Claude/claude_desktop_config.json

Cursor

Add the following to .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):

json
{
  "mcpServers": {
    "user-prompt": {
      "command": "/path/to/UserPromptMcpServer.exe"
    }
  }
}

OpenAI Codex CLI

Add the following to ~/.codex/config.toml (global) or .codex/config.toml (project-level):

toml
[mcp_servers.user-prompt]
command = "/path/to/UserPromptMcpServer.exe"

Or via the CLI:

bash
codex mcp add user-prompt -- /path/to/UserPromptMcpServer.exe

Other MCP Clients

Any MCP client that supports the stdio transport can launch this server. Point it at the executable (or the user-prompt command name if using the .NET Global Tool).

Usage

Once configured, the user_prompt tool is available to the AI agent automatically. The agent decides when to invoke it based on its own judgment — no manual triggering is required.

Tool Reference

Tool name: user_prompt

ParameterTypeRequiredDescription
reasonstringYesA clear explanation of why the agent needs user input. Displayed prominently in the terminal window.
questionsstring[]YesA list of specific questions. Displayed as a numbered list; the user answers each in sequence.

Example Tool Call

json
{
  "name": "user_prompt",
  "arguments": {
    "reason": "The project has no database configuration and I need to set one up.",
    "questions": [
      "Which database engine should I use (PostgreSQL, SQLite, SQL Server)?",
      "Should I include Entity Framework Core as the ORM?"
    ]
  }
}

Example Response

code
User responded to 2 question(s):

1. Q: Which database engine should I use (PostgreSQL, SQLite, SQL Server)?
   A: PostgreSQL

2. Q: Should I include Entity Framework Core as the ORM?
   A: Yes, use EF Core with code-first migrations

Terminal Window Behavior

When the tool is invoked, a new PowerShell window opens displaying:

  1. A header indicating an AI agent needs input
  2. The agent's stated reason for asking
  3. All questions as a numbered list
  4. Numbered input prompts (1>, 2>, etc.) — one Enter per answer
  5. A confirmation message before the window auto-closes

If the user does not respond within 10 minutes, or closes the window without answering, the agent receives a descriptive fallback message and can decide how to proceed.

Architecture

code
UserPromptMcpServer/
├── UserPromptMcpServer.csproj   # Project file (.NET 8)
├── Program.cs                   # MCP server entry point (stdio transport)
└── Tools/
    └── UserPromptTool.cs        # Tool implementation

How It Works Internally

  1. The MCP client sends a tools/call JSON-RPC request over stdin
  2. The server writes the questions to a temporary JSON file
  3. A PowerShell script is generated and launched in a new terminal window
  4. The user sees the questions and types answers sequentially
  5. Answers are written to a response JSON file; the terminal closes
  6. The server reads the response file, formats it, cleans up temp files, and returns the result over stdout

All temporary files are created under %TEMP%/UserPromptMcpServer/<session-guid>/ and are cleaned up after each invocation regardless of outcome.

Contributing

Contributions are welcome! To make sure your change gets merged, please open an issue first to discuss the proposed change and get approval before starting work.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes and ensure the project builds cleanly (dotnet build)
  4. Commit with a clear, descriptive message
  5. Open a pull request against develop

Development Setup

bash
git clone https://github.com/Jacob-J-Thomas/user-context-retrieval-mcp-server.git
cd user-context-retrieval-mcp-server
dotnet restore UserPromptMcpServer/UserPromptMcpServer.csproj
dotnet build UserPromptMcpServer/UserPromptMcpServer.csproj

Areas for Contribution

  • Cross-platform support — the macOS and Linux terminal launching is currently stubbed out and untested
  • Test coverage — no test project exists yet
  • Additional MCP tools — if the project scope expands beyond a single tool

License

This project is licensed under the Apache License 2.0. See LICENSE for details.

Author

Jacob Thomas@Jacob-J-Thomas

常见问题

io.github.Jacob-J-Thomas/user-prompt 是什么?

一个 MCP server,让 AI agent 可通过弹出式终端窗口向用户提出澄清性问题。

相关 Skills

Claude接口

by anthropics

Universal
热门

面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。

想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心

AI 与智能体
未扫描123.0k

智能体流程设计

by alirezarezvani

Universal
热门

面向生产级多 Agent 编排,梳理顺序、并行、分层、事件驱动、共识五种工作流设计,覆盖 handoff、状态管理、容错重试、上下文预算与成本优化,适合搭建复杂 AI 协作系统。

帮你把多智能体流程设计、编排和自动化统一起来,复杂工作流也能更稳地落地,适合追求强控制力的团队。

AI 与智能体
未扫描12.5k

提示工程专家

by alirezarezvani

Universal
热门

覆盖Prompt优化、Few-shot设计、结构化输出、RAG评测与Agent工作流编排,适合分析token成本、评估LLM输出质量,并搭建可落地的AI智能体系统。

把提示优化、LLM评测到RAG与智能体设计串成一套方法,适合想系统提升AI开发效率的人。

AI 与智能体
未扫描12.5k

相关 MCP Server

知识图谱记忆

编辑精选

by Anthropic

热门

Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。

帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。

AI 与智能体
84.2k

顺序思维

编辑精选

by Anthropic

热门

Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。

这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。

AI 与智能体
84.2k

PraisonAI

编辑精选

by mervinpraison

热门

PraisonAI 是一个支持自反思和多 LLM 的低代码 AI 智能体框架。

如果你需要快速搭建一个能 24/7 运行的 AI 智能体团队来处理复杂任务(比如自动研究或代码生成),PraisonAI 的低代码设计和多平台集成(如 Telegram)让它上手极快。但作为非官方项目,它的生态成熟度可能不如 LangChain 等主流框架,适合愿意尝鲜的开发者。

AI 与智能体
7.0k

评论