Skip to main content
Glama

codex-research-mcp

A small local MCP adapter that lets Claude Code delegate bounded research work to Codex plan credits without giving the worker ownership of the final report.

Why it exists

Claude Code only schedules MCP tools concurrently when they advertise readOnlyHint: true. The official generic Codex MCP tools can write to arbitrary workspaces, so they cannot safely make that promise. This adapter exposes a narrower contract:

  • research starts an independent Codex research thread;

  • research_reply continues a thread created during the current MCP server lifetime;

  • real source trees remain read-only;

  • every worker receives a private writable scratch directory under /tmp;

  • network reads are enabled, while approvals and durable external writes are not;

  • both tools advertise the read-only annotation so independent Claude Code tool calls can run concurrently.

The adapter forwards execution to one long-lived official codex mcp-server. Codex still owns model selection, authentication, sessions, and plan-credit use.

Related MCP server: peer-cli-mcp

Run from this checkout

./bin/codex-research-mcp

Example Claude Code MCP entry:

{
  "research-worker": {
    "type": "stdio",
    "command": "/Users/zhuhuibin/lab/codex-research-mcp/bin/codex-research-mcp",
    "args": [],
    "env": {
      "CODEX_RESEARCH_MAX_CONCURRENCY": "4"
    }
  }
}

Useful optional environment variables:

  • CODEX_RESEARCH_CODEX_BIN: Codex executable, default codex;

  • CODEX_RESEARCH_MAX_CONCURRENCY: simultaneous Codex calls, default 4;

  • CODEX_RESEARCH_TIMEOUT_SECONDS: per-call timeout, default 3600;

  • CODEX_RESEARCH_STATE_DIR: scratch and authorized-thread state, default <system temporary directory>/codex-research-mcp;

  • CODEX_RESEARCH_SOURCE_ROOT: default readable source root when a tool call does not provide source_cwd.

Tests

python3 -m unittest discover -s tests -v

Available Tools

2 tools
researchCodex ResearchA
Read-only

Delegate one read-only evidence assignment to Codex for discovery, retrieval, extraction, organization, comparison, calculation, or verification. The real source tree stays read-only; downloads, scripts, and intermediate files are confined to a private temporary scratch directory. Independent calls may run concurrently.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesThe complete bounded research assignment.
source_cwdNoAbsolute source root for local material. It is readable but is not the worker's writable workspace. Defaults to the MCP server's startup directory.

Output Schema

ParametersJSON Schema
NameRequiredDescription
contentYes
threadIdYes

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that the source tree stays read-only and that downloads, scripts, and intermediate files are confined to a private temporary scratch directory, adding detail beyond the readOnlyHint annotation. It also notes that independent calls may run concurrently. No contradiction with annotations is present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, each contributing essential information: purpose, safety/scratch behavior, and concurrency. It is front-loaded with the core purpose and contains no redundant or verbose phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose, safety, and concurrency, and an output schema exists so return values aren't needed in the description. However, it does not connect to the sibling tool 'research_reply', leaving the workflow incomplete for a user who needs to know how to retrieve the delegated result. This gap prevents a higher score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides detailed descriptions for both 'prompt' and 'source_cwd' (100% coverage). The tool description does not add extra parameter-level detail, but it supplements context about the assignment being read-only and bounded. Thus it meets the baseline without further enrichment.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool delegates a read-only evidence assignment to Codex for a specific set of operations (discovery, retrieval, etc.). It uses a specific verb ('delegate') and identifies the resource (evidence assignment to Codex). However, it does not explicitly differentiate from the sibling tool 'research_reply', so it misses the highest marks for sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for the intended use: delegating read-only evidence assignments involving discovery, retrieval, extraction, etc. It also explains the bounded nature of the assignment. However, it does not specify when to use 'research_reply' instead or mention any exclusions, so the guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

research_replyContinue Codex ResearchA
Read-only

Continue a research thread previously created during the current MCP server lifetime. The original scratch isolation and source boundary remain in force.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesThe follow-up research instruction.
threadIdYesA thread id returned by the research tool.

Output Schema

ParametersJSON Schema
NameRequiredDescription
contentYes
threadIdYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, and openWorldHint=true. The description adds meaningful behavior beyond annotations: 'original scratch isolation and source boundary remain in force' and the lifetime constraint. This provides context about state preservation but does not detail all edge cases (e.g., thread expiration behavior).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core action, and no filler. The second sentence adds important behavioral context without unnecessary wording. This is an excellent example of concise, information-dense description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool with a full output schema and rich annotations, the description covers purpose, usage constraints, and behavioral boundaries. The output schema handles return values, annotations handle safety profile, and the description ties them together. No significant gaps remain for an agent to invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with both 'prompt' and 'threadId' described, so the baseline is 3. The description adds no parameter-specific detail beyond what the schema already provides, so no extra points earned. The description does not complement the schema with parameter examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states exactly what the tool does: 'Continue a research thread previously created during the current MCP server lifetime.' The verb 'continue' plus the specific resource 'research thread' provides a specific action and scope. It distinguishes from the sibling tool 'research' by focusing on continuation rather than creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clear guidance is provided: this tool is for threads created during the current MCP server lifetime, with an implicit 'when-not' via the lifetime restriction. The statement 'previously created' implies that the sibling 'research' should be used for new threads, though the alternative is not explicitly named. This is clear context but lacks an explicit exclusion sentence.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.3
    • First observedresearch
    • First observedresearch_reply

TDQS

A4.1/5.0

Scored across 2 tools

Disambiguation5/5

Each tool has a clearly distinct role: research initiates a new read-only evidence assignment, while research_reply continues an existing thread. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tool names follow the same pattern, using a 'research' base with a clear suffix for the continuation tool. This is consistent and predictable.

Tool Count3/5

With only two tools, the server feels thin for a research-focused MCP, though the tools are broad in capability. This falls into the borderline range for tool count.

Completeness5/5

The two tools cover the complete lifecycle of a research thread: initiating a new assignment and continuing an existing one. The read-only and scratch-isolated boundaries are well-defined, and no obvious operations are missing for the stated purpose.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers