Token cache rate drops drastically when using more than one MCP tool

Resolved 💬 1 comment Opened Aug 23, 2025 by warpdev Closed Aug 25, 2025

What version of Codex is running?

0.23.0

Which model were you using?

gpt-5

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

When multiple MCP tools are connected, token caching barely works.

Here’s how to reproduce:

Add an MCP server with multiple tools to config.toml and run tests. As shown in the screenshot below, almost no caching occurs.
In contrast, if you remove all MCP servers from config.toml, or configure only a single MCP server that contains just one tool, caching works normally as shown below.
With MCP | Without MCP
:-------------------------:|:-------------------------:
<img width="906" height="1200" alt="Image" src="https://github.com/user-attachments/assets/3612aca0-d1a5-46b7-b8c1-dd678dc79480" /> | <img width="906" height="1200" alt="Image" src="https://github.com/user-attachments/assets/1a785e9c-1c4e-473a-b746-4fad282d3df7" />

What is the expected behavior?

Token caching should work properly even in sessions that include MCP servers.

What do you see instead?

When multiple MCP tools are configured, almost no tokens are cached, resulting in extremely low cache hit rates.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗