codex icon indicating copy to clipboard operation
codex copied to clipboard

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

Open warpdev opened this issue 1 year ago • 1 comments

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
Image Image

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

warpdev avatar Aug 23 '25 04:08 warpdev

thanks for flagging!

ae-openai avatar Aug 24 '25 21:08 ae-openai