Codex Ask User
Enables Codex to clarify requirements via native MCP elicitation controls, supporting single/multiple-choice and free-text questions with recommended answers and a discuss-first option.
README
Codex Ask User
Codex Ask User is a local Model Context Protocol (MCP) server that gives Codex a native, structured way to clarify requirements before it commits to a plan or implementation.
It uses MCP elicitation so Codex CLI and Codex desktop can display native controls for:
- single-choice questions;
- multiple-choice questions;
- free-text and custom answers;
- recommended choices that are labeled and preselected;
- a Discuss with Codex first path that returns to chat before asking again;
- session-scoped automatic selection of recommended answers.
Requirements
- Node.js 20 or newer
- Codex CLI or Codex desktop with MCP elicitation enabled
Build and test
npm install
npm test
The build produces a self-contained MCP server at plugins/ask-user/dist/server.js.
Install as a Codex MCP server
Build the project, then register the generated server using its absolute path:
codex mcp add ask-user -- node /absolute/path/to/codex-ask-user/plugins/ask-user/dist/server.js
Start a new Codex CLI session or desktop task after registration. The server exposes these tools:
ask_userpresents one to three single-choice, multiple-choice, or free-text questions.set_question_preferencesenables, disables, or reports automatic use of recommended answers for the current MCP session.
The repository also contains an installable Codex plugin bundle in plugins/ask-user. Its .mcp.json uses ${PLUGIN_ROOT}, so the bundle remains relocatable.
Codex approval policy
MCP elicitation must be allowed by the active Codex approval policy. To keep other prompt categories non-interactive while allowing questions, use:
approval_policy = { granular = { sandbox_approval = false, rules = false, mcp_elicitations = true, request_permissions = false, skill_approval = false } }
In Codex desktop, the task's permission selector can override config.toml. Full access uses an approval policy that rejects MCP elicitations without displaying the question. Select the custom configuration and start a new task after changing the policy.
If ask_user immediately returns declined without visible UI, check the task's active approval policy before treating the result as a user decision.
Example
An agent can call ask_user with a recommended option and an open-ended alternative:
{
"questions": [
{
"id": "database",
"header": "Database",
"question": "Which database should back the first release?",
"kind": "single",
"options": [
{
"label": "PostgreSQL",
"description": "A strong default for production workloads.",
"recommended": true
},
{
"label": "SQLite",
"description": "Simpler deployment for a local-first application."
}
],
"allow_other": true,
"allow_discussion": true
}
]
}
Selecting Always use recommended choices automatically resolves later questions that have recommendations during the current MCP session. Questions without recommendations are still shown. Ask Codex to stop auto-selecting recommendations to restore the default behavior.
Development
npm run check
npm run build
npm test
src/server.tscontains the MCP server and tool implementation.tests/server.test.jstests elicitation flows through an in-memory MCP client.scripts/build.mjsbundles the server with esbuild.plugins/ask-usercontains the Codex plugin manifest and MCP configuration.
Author
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。