openai/codex · error · anyhow::Error
tool '{tool}' is disabled for MCP server '{server}'
Error message
tool '{tool}' is disabled for MCP server '{server}' What it means
Error "tool '{tool}' is disabled for MCP server '{server}'" thrown in openai/codex.
Source
Thrown at codex-rs/codex-mcp/src/connection_manager.rs:891
arguments: Option<serde_json::Value>,
meta: Option<serde_json::Value>,
requested_timeout: Option<Duration>,
wait_for_server: bool,
) -> Result<CallToolResult> {
let view = self
.servers
.get(server)
.ok_or_else(|| anyhow!("unknown MCP server '{server}'"))?;
if let Some(environment_id) = environment_id
&& view.metadata.environment_id != environment_id
{
bail!(
"MCP server `{server}` is running in environment `{}`, expected `{environment_id}`",
view.metadata.environment_id
);
}
if !view.tool_filter.allows(tool) {
return Err(anyhow!(
"tool '{tool}' is disabled for MCP server '{server}'"
));
}
let client = if wait_for_server {
view.connection
.client()
.await
.context("failed to get client")?
} else {
let client = view
.connection
.client
.ready_client()
.ok_or_else(|| anyhow!("MCP server '{server}' is not connected"))?;
if client.client.is_closed().await {
bail!("MCP server '{server}' is not connected");
}
clientView on GitHub (pinned to 339751715c)
Solutions
- Enable tool '{tool}' in the configuration for MCP server '{server}' (remove it from the disabled list or add it to the enabled tools).
When it happens
Trigger: Thrown at codex-rs/codex-mcp/src/connection_manager.rs:891 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/c99def3651ecf028.
Report an issue: GitHub.