Summary
The generation agent's MCP tools were not discoverable because the configured MCP server command uses system python3, but fastmcp is installed only in the repo virtual environment. As a result, python3 ./mcp/server.py exits immediately before exposing memory_init, memory_append, memory_search, branch_update, search_arxiv_theorems, or verify_proof_service.
This is the real culprit behind the in-session message:
Session-exposed MCP tools were not discoverable; using the in-workspace mcp.server implementations directly.
Severity
High. The generation workflow depends on these MCP tools for memory and verification. With the current interpreter configuration, the MCP server cannot start, so the workflow silently loses its intended tool surface and falls back to direct Python imports.
Impact
- Required memory tools are not exposed through MCP.
verify_proof_service is not exposed through MCP.
tool_timeout_sec = 3600 is not applied through the MCP tool-call layer.
- The agent falls back to direct imports from
mcp.server, which is behaviorally different from a blocking MCP tool call.
- Verification can then be launched as an ordinary shell process and killed by the caller before the intended timeout.
Relevant Configuration
agents/generation/.codex/config.toml configures the MCP server with system Python:
[mcp_servers.reasoning_agent]
command = "python3"
args = ["./mcp/server.py"]
cwd = "./"
tool_timeout_sec = 3600
The MCP server requires fastmcp:
agents/generation/mcp/requirements.txt
1: fastmcp>=2.0.0
2: requests>=2.31.0
agents/generation/mcp/server.py exits if fastmcp cannot be imported:
try:
from fastmcp import FastMCP
except ImportError:
FastMCP = None
...
def main() -> None:
if APP is None:
raise SystemExit(
"fastmcp is not installed. Install requirements from mcp/requirements.txt first."
)
APP.run()
Evidence
System python3 cannot import fastmcp:
$ python3 -c "import importlib.util; s=importlib.util.find_spec('fastmcp'); print(s.origin if s else 'missing')"
missing
The repo virtual environment can import fastmcp:
$ ./.venv/bin/python -c "import importlib.util; s=importlib.util.find_spec('fastmcp'); print(s.origin if s else 'missing')"
/home/april/CrossDistrio/april/Softwares/Rethlas/agents/generation/.venv/lib/python3.13/site-packages/fastmcp/__init__.py
The configured command fails:
$ python3 ./mcp/server.py --help
fastmcp is not installed. Install requirements from mcp/requirements.txt first.
Starting the same server with the venv interpreter reaches FastMCP startup:
$ ./.venv/bin/python ./mcp/server.py --help
FastMCP 3.3.1
Server: reasoning-agent, 3.3.1
Starting MCP server 'reasoning-agent' with transport 'stdio'
The saved Codex session shows MCP tool discovery returning no Rethlas tools:
{
"type": "tool_search_call",
"arguments": {
"query": "memory_init memory_append memory_search branch_update verify_proof_service search_arxiv_theorems",
"limit": 20
}
}
{
"type": "tool_search_output",
"tools": []
}
The generation memory then recorded the fallback:
{
"event_type": "run_started",
"notes": [
"Problem asks for the graded ring of symmetric tensors on the del Pezzo surface of degree 5.",
"The local reference_dir declared by the user does not exist.",
"Session-exposed MCP tools were not discoverable; using the in-workspace mcp.server implementations directly."
]
}
Expected Behavior
The configured MCP server should start successfully and expose the required tools:
reasoning_agent.memory_init
reasoning_agent.memory_append
reasoning_agent.memory_search
reasoning_agent.branch_update
reasoning_agent.search_arxiv_theorems
reasoning_agent.verify_proof_service
If the MCP server cannot start, the generation run should fail loudly with a configuration error instead of falling back to direct Python imports.
Actual Behavior
The MCP server command resolves to system python3, where fastmcp is not installed. The server exits before registering tools. The generation agent then cannot discover the required MCP tools and falls back to importing mcp.server directly.
Root Cause
agents/generation/.codex/config.toml points the MCP server at the wrong Python interpreter:
Dependencies were installed into:
but the MCP server is launched outside that virtual environment.
Suggested Fix
Use the repo virtual environment interpreter in the MCP config:
[mcp_servers.reasoning_agent]
command = "./.venv/bin/python"
args = ["./mcp/server.py"]
cwd = "./"
tool_timeout_sec = 3600
Also add a startup validation step to the generation runner:
1. Start the configured MCP server command.
2. Assert that all required tools are discoverable.
3. Fail immediately if any required tool is missing.
4. Do not fall back to direct imports for required MCP tools.
Regression Test
A minimal regression test should run the exact configured command in a clean checkout after dependency installation:
cd agents/generation
./.venv/bin/python -c "import fastmcp"
codex mcp list
Then launch a Codex session and assert that tool_search can discover:
memory_init
memory_append
memory_search
branch_update
search_arxiv_theorems
verify_proof_service
The test should fail if command = "python3" points to an interpreter that cannot import fastmcp.
Summary
The generation agent's MCP tools were not discoverable because the configured MCP server command uses system
python3, butfastmcpis installed only in the repo virtual environment. As a result,python3 ./mcp/server.pyexits immediately before exposingmemory_init,memory_append,memory_search,branch_update,search_arxiv_theorems, orverify_proof_service.This is the real culprit behind the in-session message:
Severity
High. The generation workflow depends on these MCP tools for memory and verification. With the current interpreter configuration, the MCP server cannot start, so the workflow silently loses its intended tool surface and falls back to direct Python imports.
Impact
verify_proof_serviceis not exposed through MCP.tool_timeout_sec = 3600is not applied through the MCP tool-call layer.mcp.server, which is behaviorally different from a blocking MCP tool call.Relevant Configuration
agents/generation/.codex/config.tomlconfigures the MCP server with system Python:The MCP server requires
fastmcp:agents/generation/mcp/server.pyexits iffastmcpcannot be imported:Evidence
System
python3cannot importfastmcp:The repo virtual environment can import
fastmcp:The configured command fails:
Starting the same server with the venv interpreter reaches FastMCP startup:
The saved Codex session shows MCP tool discovery returning no Rethlas tools:
{ "type": "tool_search_call", "arguments": { "query": "memory_init memory_append memory_search branch_update verify_proof_service search_arxiv_theorems", "limit": 20 } }{ "type": "tool_search_output", "tools": [] }The generation memory then recorded the fallback:
{ "event_type": "run_started", "notes": [ "Problem asks for the graded ring of symmetric tensors on the del Pezzo surface of degree 5.", "The local reference_dir declared by the user does not exist.", "Session-exposed MCP tools were not discoverable; using the in-workspace mcp.server implementations directly." ] }Expected Behavior
The configured MCP server should start successfully and expose the required tools:
If the MCP server cannot start, the generation run should fail loudly with a configuration error instead of falling back to direct Python imports.
Actual Behavior
The MCP server command resolves to system
python3, wherefastmcpis not installed. The server exits before registering tools. The generation agent then cannot discover the required MCP tools and falls back to importingmcp.serverdirectly.Root Cause
agents/generation/.codex/config.tomlpoints the MCP server at the wrong Python interpreter:Dependencies were installed into:
but the MCP server is launched outside that virtual environment.
Suggested Fix
Use the repo virtual environment interpreter in the MCP config:
Also add a startup validation step to the generation runner:
Regression Test
A minimal regression test should run the exact configured command in a clean checkout after dependency installation:
Then launch a Codex session and assert that
tool_searchcan discover:The test should fail if
command = "python3"points to an interpreter that cannot importfastmcp.