게시 2026-11-28Published 2026-11-28AIML읽는 시간 15분15 min read직접 테스트: 서울 리전의 Amazon EC2 한 대, Claude Code 2.1.332와 Codex 0.172.0, 서버 6개 조건은 질문마다 2회 실행Tested first-hand: One Amazon EC2 instance in the Seoul Region, Claude Code 2.1.332 and Codex 0.172.0, 2 runs per question with six servers

Claude Code와 Codex의 MCP Tool SearchMCP Tool Search in Claude Code and Codex

MCP Tool Search는 MCP 서버의 도구 정의를 첫 요청에 미리 넣지 않고 모델이 검색한 도구의 정의만 전달하는 기능입니다. Claude Code는 2.1.7에서, Codex는 0.142.2에서 기본 동작으로 적용했습니다. Claude Code에 Opus 5.5, Codex에 GPT-6.2 Astra를 사용하고 두 모델 모두 추론 강도를 xhigh로 지정해 직접 테스트했습니다. 같은 서버 6개(도구 187개)로 “OK”만 답하도록 했을 때, Opus의 첫 요청 입력은 미리 로드 137,806토큰, 검색 46,435토큰이었습니다. Astra는 각각 39,395토큰과 12,268토큰이었습니다. 서울 시각을 묻는 질문에서는 검색에 요청을 한 번 더 썼지만 두 모델 모두 답변까지 읽은 총입력은 줄었습니다.MCP Tool Search keeps the tool definitions of MCP servers out of the first request and passes the model only the definitions of the tools it searches for. Claude Code made it the default in 2.1.7 and Codex in 0.142.2. I tested it with Claude Code on Opus 5.5 and Codex on GPT-6.2 Astra, both at xhigh. With the same six servers (187 tools), the first OK request on Opus used 137,806 input tokens with schemas up front and 46,435 with search. Astra used 39,395 and 12,268 respectively. For a Seoul time lookup, both models made one extra request to search but read fewer input tokens across the full turn.

#Claude Code#Codex#MCP#Tool Search#Context Window#Token Economics

도구 정의를 필요할 때 불러오는 MCP Tool Search

MCP Tool Search는 Claude Code와 Codex가 MCP 서버의 도구 정의를 처음부터 컨텍스트에 넣지 않고 모델이 필요한 도구를 검색했을 때 그 정의만 불러오는 기능입니다. MCP 서버를 연결하면 두 도구는 서버에서 도구 이름, 설명, 입력 스키마를 가져옵니다.

이 정의를 첫 요청에 모두 넣는 구성에서는 질문이 짧아도 서버를 연결한 만큼 입력이 길어집니다. Claude Code는 세션을 시작할 때 도구 이름과 서버 지침(server instructions)만 컨텍스트에 두고 모델이 ToolSearch를 호출하면 그 도구의 정의를 불러옵니다. Codex는 첫 요청에 tool_search와 네임스페이스 목록을 넣고 모델이 검색한 도구의 정의를 다음 요청에 전달합니다. 이 동작이 기본값이 된 버전은 Claude Code 2.1.7(2026-01-14)과 Codex 0.142.2(2026-06-25)입니다.

컨텍스트를 공구 작업대로 보면 도구 정의는 공구마다 딸린 설명서입니다. 예전에는 공구 187개의 설명서를 작업대에 모두 펼쳐 놓고 일을 시작했습니다. Tool Search는 설명서를 서랍에 넣고 이름표만 붙여 두었다가 필요한 설명서만 꺼내 옵니다. Claude Code는 공구마다, Codex는 서랍(서버)마다 이름표를 붙입니다. Codex의 지연 시작은 설명서가 아니라 전원에 해당합니다. Claude Code는 일을 시작할 때 모든 공구의 전원을 꽂고 Codex는 목록을 기억해 둔 공구라면 처음 쓸 때 꽂습니다. Tool Search를 사용하면 정의를 검색하는 데 모델 요청이 한 번 더 들어갑니다.

표 1에 두 도구에서 바뀐 내용을 이전과 이후로 정리했습니다.

항목Claude CodeCodex
이전 동작연결한 서버의 모든 도구 정의를 첫 요청에 포함0.142.1에서는 검색을 지원하는 구성에서 예전 플래그를 활성화했거나 사용 가능한 MCP 도구가 100개 이상일 때만 정의를 지연
바뀐 버전2.1.7 (2026-01-14). 정의가 컨텍스트의 10% 이상이면 지연하는 auto 모드를 기본 적용0.142.2 (2026-06-25). 검색을 지원하는 구성에서는 도구 수와 관계없이 지연이 기본
지금의 기본 동작모든 MCP 도구 정의를 지연. 세션을 시작할 때는 도구 이름과 서버 지침만 포함첫 요청에 tool_search와 검색 가능한 네임스페이스 안내를 포함. 기본 설정에서는 개별 MCP 도구 스키마를 검색 뒤에 전달
서버 프로세스세션을 시작할 때 연결. 원격 서버만 discovery cache를 활성화하면 첫 호출 때 연결유효한 목록이 캐시된 stdio 서버는 첫 사용 때 시작 가능. 즉시 연결이 필요한 서버는 예외. 0.169.0(2026-11-13)에서 선택 기능, 0.172.0(2026-11-24)에서 기본 적용

표 1. MCP 도구 정의와 서버 프로세스를 다루는 방식의 이전과 이후(2026-11-28 문서 기준). Claude Code의 기본값이 전체 지연으로 바뀐 버전은 Changelog에서 찾지 못했습니다

01

바뀐 이유: 74.3k 토큰이던 도구 187개의 정의

Claude API 문서는 GitHub, Slack, Sentry, Grafana, Splunk 서버를 함께 연결한 구성에서 정의만 약 55k 토큰을 차지한다고 설명합니다. 같은 문서에는 Tool Search가 이 토큰을 보통 85% 넘게 줄인다고 적혀 있습니다.

제 환경에서 확인하려고 공개된 MCP 서버 6개를 Claude Code와 Codex에 똑같이 연결했습니다(그림 1). 서버마다 tools/list를 호출해 보니 도구는 187개였고 이름, 설명, 입력 스키마를 JSON으로 만든 크기는 191,832바이트였습니다(표 2). Claude Code의 /context는 이 정의를 74.3k 토큰으로 계산했습니다. 컨텍스트가 200k 토큰인 모델이라면 질문을 하기 전에 37%를 사용하는 크기입니다.

Claude Code 2.1.332는 Opus 5.5 xhigh, Codex 0.172.0은 Bedrock Mantle의 GPT-6.2 Astra xhigh로 같은 stdio 서버 6개를 사용한다. 서버별 도구 수는 25, 16, 14, 3, 5, 124로 합계 187개다. 프로세스 시작은 별도 래퍼로 기록한다.
그림 1. 토큰 측정에는 같은 stdio 서버 6개를 사용했습니다. 서버 시작 시점은 별도 실험에서 기록했습니다.
서버패키지와 버전도구 수정의 크기(바이트)
playwright@playwright/mcp 0.0.862519,365
filesystem@modelcontextprotocol/server-filesystem 2.4.11614,211
gitmcp-server-git 2026.11.27147,008
timemcp-server-time 2026.11.2732,196
aws-documentationawslabs.aws-documentation-mcp-server 1.2.7516,563
bedrock-agentcoreawslabs.amazon-bedrock-agentcore-mcp-server 0.2.2124132,489
합계187191,832

표 2. 테스트에 사용한 MCP 서버 6개와 도구 정의의 크기(2026-11-28)

프로세스 시작을 확인하는 별도 실험에서는 각 stdio 서버를 아래 래퍼로 실행했습니다.

bash
#!/usr/bin/env bash
# 사용법: logged.sh <클라이언트> <서버 이름> <명령> [인자...]
tag="$1"; name="$2"; shift 2
log_dir="$(cd "$(dirname "$0")/../logs" && pwd)"
echo "$(date +%s.%3N) start ${name}" >> "$log_dir/start-${tag}.log"
exec "$@"

02

Claude Code: 이름만 싣고 정의는 ToolSearch가 불러오는 방식

구조

필요한 도구가 생기면 모델이 ToolSearch를 호출하고 결과로 돌아온 tool_reference가 가리키는 도구의 정의만 그때 로드됩니다(그림 2).

Opus 5.5 xhigh는 서울 시각 질문의 첫 요청에서 ToolSearch를 호출하고 둘째 요청에서 찾은 도구 하나를 호출한 뒤 셋째 요청에서 답했다. 첫 반복의 입력은 46,473, 46,794, 46,920토큰이다. 오른쪽은 같은 모델의 /context 결과다.
그림 2. Opus 5.5 xhigh의 서울 시각 질문(첫 번째 반복)과 설정별 /context 추정값(2026-11-28).

측정 결과

Claude Code에 --model claude-opus-5-5 --effort xhigh를 명시하고 응답의 모델 ID도 확인했습니다. 먼저 /context에서 서버가 없을 때와 검색 설정별 추정값을 비교했습니다.

bash
# 실험용 서버 6개가 든 mcp.json에서 실행
args=(--model claude-opus-5-5 --effort xhigh --strict-mcp-config --mcp-config ./mcp.json)
claude -p /context "${args[@]}"
ENABLE_TOOL_SEARCH=auto   claude -p /context "${args[@]}"
ENABLE_TOOL_SEARCH=auto:5 claude -p /context "${args[@]}"
ENABLE_TOOL_SEARCH=false  claude -p /context "${args[@]}"
text
# 기본값
**Tokens:** 26.7k / 1m (3%)
| System tools | 1.6k | 0.2% |
| MCP server instructions | 1.3k | 0.1% |
| MCP tools (deferred) | 74.4k | 7.4% |
| System tools (deferred) | 17.7k | 1.8% |

# ENABLE_TOOL_SEARCH=false
**Tokens:** 122.2k / 1m (12%)
| System tools | 22.7k | 2.3% |
| MCP tools | 74.3k | 7.4% |
| MCP server instructions | 1.3k | 0.1% |
설정컨텍스트 사용량MCP 도구 정의
MCP 서버 없음25.4k해당 없음
ENABLE_TOOL_SEARCH 미설정(기본값)26.7k지연 74.4k
ENABLE_TOOL_SEARCH=auto122.7k미리 로드 74.3k
ENABLE_TOOL_SEARCH=auto:526.7k지연 74.4k
ENABLE_TOOL_SEARCH=false122.2k미리 로드 74.3k
time 서버에 alwaysLoad: true27.5k미리 로드 833, 지연 73.5k

표 3. Opus 5.5 xhigh, 컨텍스트 1M. /context가 표시한 추정값으로 설정마다 한 번씩 조회했습니다(2026-11-28).

기본값에서 /context 사용량은 서버가 없을 때의 25.4k에서 26.7k로 늘었습니다. 서버 지침은 1.3k였고 도구 정의 74.4k는 지연 항목에 따로 표시됐습니다. auto에서는 정의가 컨텍스트의 7.4%라 10% 임계값에 미치지 않았습니다. auto:5에서는 정의가 지연됐습니다. 검색을 비활성화하면 기본 도구 항목도 1.6k에서 22.7k로 늘었습니다. 시작 기록 래퍼를 끼워 같은 모델과 설정으로 따로 실행했을 때는 서버를 연결한 다섯 조건 모두에서 서버 6개의 프로세스가 세션을 시작할 때 시작됐습니다.

실제 모델 입력은 /context 추정값과 달랐습니다. “OK”만 답하는 첫 요청은 서버 없이 41,303토큰, 서버 6개와 검색을 사용하면 46,435토큰, 정의를 미리 보내면 137,806토큰이었습니다. 서울 시각 질문은 두 번 모두 검색, 시간 도구 호출, 답변의 세 요청을 거쳤습니다. 검색 조건의 총입력은 140,187토큰과 140,209토큰이었습니다. 미리 로드 조건은 두 요청으로 끝났지만 총입력은 275,897토큰과 275,814토큰이었습니다.

text
# 기본값, 첫 번째 반복
input  46473  ToolSearch {"query":"select:mcp__time__get_current_time"}
input  46794  mcp__time__get_current_time {"timezone":"Asia/Seoul"}
input  46920  답변

# ENABLE_TOOL_SEARCH=false
input 137844  mcp__time__get_current_time {"timezone":"Asia/Seoul"}
input 138053  답변

Amazon Bedrock을 거치는 구성(3P)도 확인했습니다. us-east-1의 Runtime과 Mantle에 기본값으로 같은 시각 질문을 한 번씩 보냈습니다. 두 엔드포인트 모두 정의가 지연됐고 모델이 ToolSearch를 호출했습니다. 첫 요청 입력은 51,951토큰과 51,949토큰이었습니다. Codex와 달리 엔드포인트에 따라 기본값이 달라지지 않았습니다.

bash
# Bedrock Runtime(Invoke API)
CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=us-east-1 \
  claude -p "$q" --model us.anthropic.claude-opus-5-5 --effort xhigh --allowedTools "mcp__time"

# Bedrock Mantle
CLAUDE_CODE_USE_MANTLE=1 AWS_REGION=us-east-1 \
  claude -p "$q" --model anthropic.claude-opus-5-5 --effort xhigh --allowedTools "mcp__time"

내 Claude Code에서 Tool Search 설정 확인하기

최신 버전에서는 설정 없이 지연 로드가 적용됩니다. 사용자 쪽에서는 세 가지를 확인합니다. 첫째, /context의 사용량 표를 봅니다. MCP tools (deferred) 줄이 있으면 정의가 지연된 상태이고 MCP tools 줄만 있으면 미리 로드된 상태입니다. 두 줄이 함께 있으면 일부 서버만 미리 로드된 것입니다. 둘째, 이 동작을 바꾸는 값이 지정된 곳을 찾습니다. ENABLE_TOOL_SEARCH는 셸 환경 변수나 설정 파일의 env에 두고 ToolSearch 거부는 permissions.deny에, alwaysLoad는 서버 설정(.mcp.json)에 둡니다. 설정 파일은 사용자, 프로젝트, 프로젝트 로컬 세 곳이고 조직의 관리 설정도 적용됩니다. 셋째, 실제 요청에서 검색이 일어났는지는 stream-json 출력의 ToolSearch 호출로 확인합니다. 바꿀 수 있는 값은 표 4에 있습니다.

bash
# 1) 정의가 지연되는지 확인. 세션 안에서는 /context 입력
claude -p "/context" | grep -E "MCP tools|MCP server instructions"

# 2) 동작을 바꾸는 값이 지정된 곳 찾기
echo "ENABLE_TOOL_SEARCH=${ENABLE_TOOL_SEARCH:-unset}"
grep -n -E "ENABLE_TOOL_SEARCH|ToolSearch" ~/.claude/settings.json \
  .claude/settings.json .claude/settings.local.json 2>/dev/null
grep -n "alwaysLoad" .mcp.json 2>/dev/null

# 3) 실제 요청에서 검색 호출이 있었는지 확인. 출력이 있으면 검색을 사용한 것
q='time 서버의 도구로 Asia/Seoul의 현재 시각을 조회해서 시각만 한 줄로 답하세요.'
claude -p "$q" --allowedTools "mcp__time" --output-format stream-json --verbose \
  | grep -o '"name":"ToolSearch"'
text
# 기본값: 정의가 지연됨
| MCP server instructions | 1.3k | 0.1% |
| MCP tools (deferred) | 74.4k | 7.4% |

# time 서버에 alwaysLoad: true: 그 서버의 정의만 미리 로드
| MCP tools | 833 | 0.1% |
| MCP server instructions | 1.3k | 0.1% |
| MCP tools (deferred) | 73.5k | 7.4% |

# ENABLE_TOOL_SEARCH=false: 정의를 모두 미리 로드
| MCP tools | 74.3k | 7.4% |
| MCP server instructions | 1.3k | 0.1% |
설정동작사용하는 경우
ENABLE_TOOL_SEARCH 미설정 또는 true모든 MCP 도구 정의를 지연기본값. 대부분 그대로 둠
ENABLE_TOOL_SEARCH=auto, auto:N정의가 컨텍스트의 10%(또는 N%) 미만이면 미리 로드도구가 적을 때 검색 요청을 생략하려는 경우. 컨텍스트가 1M이면 10%는 100k 토큰
ENABLE_TOOL_SEARCH=false모든 정의를 미리 로드이전 동작으로 되돌릴 때
서버 설정의 alwaysLoad: true그 서버의 도구만 미리 로드매 턴 호출하는 작은 서버
서버 설정의 alwaysLoad: false서버 제작자가 미리 로드로 표시한 도구까지 지연2.1.287 이상에서 서버 전체를 지연하려는 경우
permissions.deny의 ToolSearch검색 도구가 없어져 정의를 미리 로드의도한 설정이 아니면 제거

표 4. Claude Code의 Tool Search 설정(Claude Code 문서, 2026-11-28 확인)

json
{
  "mcpServers": {
    "time": {
      "command": "uvx",
      "args": ["mcp-server-time@2026.11.27", "--local-timezone", "Asia/Seoul"],
      "alwaysLoad": true
    }
  }
}

03

Codex: 서로 별개인 도구 검색과 stdio 서버 시작

구조

Codex는 0.142.2에 포함된 변경에서 도구 수 기준을 없앴습니다(표 1). 0.172.0의 일반 도구 모드에서는 모델 카탈로그가 검색을 지원하면 허용된 MCP 도구를 기본적으로 검색 대상으로 둡니다. 검색 미지원으로 표시된 모델에는 허용된 정의를 직접 보냅니다.

첫 요청에 개별 MCP 도구의 입력 스키마가 없어도 모델은 검색 도구와 네임스페이스 목록을 봅니다. 네임스페이스는 mcp__time처럼 도구를 묶은 이름이고 설명이 있으면 함께 표시됩니다. tool_search는 도구 메타데이터를 BM25로 검색해 기본 최대 8개의 도구 정의를 다음 모델 요청에 제공합니다. 검색만으로 해당 MCP 도구가 실행되지는 않습니다.

Astra xhigh 서울 시각 질문 첫 반복. 입력 12,289토큰인 요청에서 네임스페이스 6개를 안내하고 두 번째 요청은 time 도구 정의 3개를 받아 하나를 호출했다(12,777토큰). 마지막 요청은 12,866토큰이다. 아래 그림은 별도의 app-server 프로세스 시작 실험이다.
그림 3. 위는 GPT-6.2 Astra xhigh의 첫 번째 반복, 아래는 같은 Codex 버전에서 별도로 측정한 서버 시작 시점입니다(0.172.0, 2026-11-28).

측정 결과

Codex는 Amazon Bedrock Mantle(us-east-1)의 openai.gpt-6.2-astra를 사용했고 세션 기록에서 모델 ID와 effort = "xhigh"를 확인했습니다. 표 5의 두 조건은 모델과 Mantle 엔드포인트가 같습니다. 대조군에서만 카탈로그 사본의 supports_search_tool을 false로 바꿨습니다. 아래는 실험 설정을 둔 제 작업 폴더(lab/)에서 이 측정을 실행하는 명령입니다.

bash
# 각 조건을 두 번 측정. 새 출력 폴더를 지정합니다.
python3 benchmarks/xhigh-20261128/run.py codex --repeats 2 --output ./astra-xhigh-retest
python3 benchmarks/xhigh-20261128/run.py claude --repeats 2 --context --output ./opus-xhigh-retest
text
# 검색, 첫 번째 “OK” 실행
{"type":"turn.completed","usage":{"input_tokens":12268,"cached_input_tokens":0,"cache_write_input_tokens":12226,"output_tokens":5,"reasoning_output_tokens":0}}

# 미지원으로 표시, 같은 모델
{"type":"turn.completed","usage":{"input_tokens":39395,"cached_input_tokens":0,"cache_write_input_tokens":39353,"output_tokens":5,"reasoning_output_tokens":0}}
조건“OK” 첫 요청의 입력 토큰서울 시각 질문의 요청 수와 입력 합계
MCP 서버 없음11,978측정하지 않음
서버 6개, Tool Search 지원(기본값)12,268 (두 번 모두)3건, 37,932 / 37,940토큰
서버 6개, Tool Search 미지원으로 표시39,395 (두 번 모두)2건, 78,984 / 78,936토큰

표 5. Astra xhigh의 실제 입력. “OK”는 첫 요청, 시각 질문은 캐시 읽기를 포함한 요청별 입력의 합입니다. 두 값은 첫 번째와 두 번째 반복입니다(2026-11-28).

검색 여부를 비교할 때 여섯 서버가 모두 준비되도록 mcp_optional_startup_grace_ms = 0을 지정했습니다. 이 값은 대기를 없애는 대신 각 서버의 시작 제한 시간까지 기다리도록 합니다. 검색 조건의 첫 요청에는 두 번 모두 네임스페이스 6개가 표시됐고 직접 노출한 개별 MCP 스키마는 없었습니다.

서버 6개와 검색을 사용한 “OK” 첫 요청은 서버가 없을 때보다 290토큰 늘었습니다. 같은 모델에 검색 미지원으로 표시하면 첫 요청에 187개 정의가 직접 실렸습니다. 이때 입력은 검색 조건보다 27,127토큰 많았습니다.

서울 시각 질문의 두 반복 모두 mcp__time에서 도구 정의 3개를 찾고 get_current_time 하나를 호출했습니다. 첫 반복에서 검색 뒤 입력은 12,289에서 12,777토큰으로 늘었습니다. 증가분 488토큰에는 검색 호출과 결과가 포함되므로 스키마 크기만 따로 측정한 값은 아닙니다.

Bedrock Runtime과 Mantle의 서로 다른 Tool Search 기본값

같은 Astra에서 Mantle은 기본값으로 검색했고 Runtime은 도구 정의 187개를 첫 요청에 보냈습니다. us-east-1에서 두 엔드포인트에 서울 시각을 묻고 도구가 실제로 호출됐는지 확인했습니다. AWS 모델 카드에 나온 같은 GPT-6.2 Astra를 사용했습니다. Mantle에서는 openai.gpt-6.2-astra를 지정했습니다. Runtime에서는 미국 리전 간 추론 프로필 us.openai.gpt-6.2-astra를 선택했습니다. 세 조건 모두 xhigh였고 웹 검색은 비활성화했습니다.

조건첫 요청의 개별 MCP 정의검색 횟수실제 MCP 호출모델 요청 수
Mantle 기본01time.get_current_time 성공3
Runtime 기본1870time.get_current_time 성공2
Runtime, Astra의 검색 지원값만 true01time.get_current_time 성공3

표 6. Codex 0.172.0, GPT-6.2 Astra xhigh, 같은 서버 6개와 도구 187개, 조건당 1회(2026-11-28).

Runtime 내장 카탈로그는 이 모델의 supports_search_tool을 false로 표시합니다. 그래서 기본값에서는 검색 없이 시간 도구를 직접 호출했습니다. 같은 Runtime 프로필에서 카탈로그 사본의 이 값만 true로 바꾸자 검색 결과에 time 도구 3개가 돌아왔고 그중 get_current_time을 호출해 답했습니다. 이 결과는 시험한 버전과 프로필에 한정됩니다.

다음은 Runtime의 기본 config.toml입니다. 공급자와 모델 ID를 함께 바꿉니다. 내장 공급자가 리전에 맞는 Runtime 주소를 선택하므로 Mantle URL이나 Mantle 카탈로그를 가져올 필요가 없습니다.

toml
model_provider = "amazon-bedrock-runtime"
model = "us.openai.gpt-6.2-astra"
model_reasoning_effort = "xhigh"

[model_providers.amazon-bedrock-runtime.aws]
region = "us-east-1"

같은 모델에서 검색도 시험하려면 Runtime 프로필을 선택한 상태에서 codex debug models로 해당 공급자의 카탈로그를 내보냅니다. 아래 명령은 Astra 항목 하나만 바꾸고 그 사본을 한 번의 실행에만 적용합니다. model_catalog_json을 TOML에 직접 둔다면 파일 맨 위의 최상위 키에 절대 경로를 지정합니다. 사본을 적용하지 않으면 다시 내장값을 사용합니다.

bash
# 위 Runtime TOML과 아래 time 서버 설정이 적용된 새 세션에서 실행
runtime_catalog=$(mktemp)
trap 'rm -f -- "$runtime_catalog"' EXIT
codex debug models | jq -e --arg m 'us.openai.gpt-6.2-astra' '
  if ([.models[] | select(.slug == $m)] | length) == 1
  then (.models[] | select(.slug == $m) | .supports_search_tool) = true
  else error("Runtime model not found") end' > "$runtime_catalog"
codex exec -c "model_catalog_json=\"$runtime_catalog\"" --json --skip-git-repo-check \
  --sandbox read-only 'time 서버의 도구로 Asia/Seoul의 현재 시각을 조회해서 시각만 한 줄로 답하세요.'

지연 시작(Lazy Startup): stdio 서버가 시작되는 조건

서버를 시작하는 조건은 Codex MCP 문서에 따로 나옵니다. 일반 스레드는 유효한 도구 목록이 없으면 stdio 서버를 시작해 도구를 조회합니다. 목록이 캐시된 선택 서버는 첫 사용까지 기다릴 수 있습니다. required = true이면 기본값 startup_readiness = "connection"이 실제 연결을 요구합니다. "catalog"를 지정하면 유효한 도구 목록으로도 시작 조건을 충족하지만 도구를 호출하려면 연결해야 합니다.

0.172.0의 일반 MCP 도구 목록 캐시는 프로세스 메모리에 있고 유효 시간은 최대 30분입니다. 독립된 codex exec 두 번은 각각 서버 6개를 시작했습니다. 같은 codex app-server의 첫 스레드는 6개, 다음 스레드는 0개를 시작했고 그 스레드에서 시각을 물었을 때는 time 서버만 시작됐습니다. 지연 시작을 비활성화했을 때는 다음 스레드에서도 6개가 시작됐습니다.

text
# codex app-server 프로세스 하나, 기본값 (측정 스크립트의 결과에서 추림)
"thread": "A", "servers_started_at_thread_start": ["time", "playwright", "git", "aws-documentation", "filesystem", "bedrock-agentcore"]
"thread": "B", "servers_started_at_thread_start": []
"thread": "B", "turn_time": {"servers_started_during_turn": ["time"]}

# codex app-server --disable mcp_lazy_stdio_startup
"thread": "B", "servers_started_at_thread_start": ["playwright", "git", "aws-documentation", "bedrock-agentcore", "time", "filesystem"]

내 Codex에서 Tool Search와 지연 시작 설정하기

사용자 설정은 보통 ~/.codex/config.toml입니다. 별도 CODEX_HOME을 사용하면 그 폴더의 config.toml을 수정하고 새 세션에서 확인합니다. 먼저 codex --version으로 버전을, codex mcp list로 대상 서버 등록 여부를 확인합니다.

bash
codex --version
codex mcp list
codex features list | grep -E '^(mcp_lazy_stdio_startup|tool_search|tool_search_always_defer_mcp_tools)[[:space:]]'
codex debug models | jq '.models[] | select(.slug == "us.openai.gpt-6.2-astra") | {slug, supports_search_tool}'

0.172.0에서 mcp_lazy_stdio_startup은 stable이며 기본값은 true입니다. 옛 tool_search와 tool_search_always_defer_mcp_tools의 상태는 removed입니다. 검색 가능한 구성에서는 서버별 설정을 생략하면 도구 정의를 지연합니다. 아래 예제는 time 도구를 검색 대상으로 남겨 둡니다. 주석 처리한 omit_tools_from을 활성화하면 그 서버의 허용된 도구만 처음부터 보냅니다.

설정동작사용하는 경우
enabled_tools, disabled_tools허용 목록을 적용한 뒤 차단 목록에 있는 도구를 제외검색과 직접 호출 모두에서 도구를 제한할 때
enabled = false설정을 지우지 않고 서버를 비활성화한동안 사용하지 않는 서버
omit_tools_from = ["deferred"]이 서버를 검색에서 제외. 일반 도구 모드에서 direct가 허용되면 해당 정의를 첫 요청에 포함자주 호출하는 작은 서버의 검색 단계를 생략할 때. 도구를 차단하려면 disabled_tools 사용
required = true필수 서버가 준비되지 않으면 시작 실패. 기본값 connection은 실제 연결을 요구. startup_readiness = "catalog"는 유효한 목록도 인정실제 연결이 필요한지, 캐시된 목록으로 시작해도 되는지 선택
features.mcp_lazy_stdio_startup = false스레드를 시작할 때 stdio 서버도 시작첫 도구 호출에 서버 시작 시간이 더해지는 것을 피하려는 경우

표 7. Codex의 MCP 도구와 서버 시작 설정. features 항목을 뺀 나머지는 [mcp_servers.<이름>] 아래에 둡니다(Codex 문서, 2026-11-28 확인)

toml
# 선택 서버: 유효한 카탈로그가 있으면 첫 사용까지 프로세스 시작을 미룸
[features]
mcp_lazy_stdio_startup = true

[mcp_servers.time]
command = "uvx"
args = ["mcp-server-time@2026.11.27", "--local-timezone", "Asia/Seoul"]
enabled_tools = ["get_current_time"]
required = false
# omit_tools_from = ["deferred"]

[features]의 mcp_lazy_stdio_startup = false는 서버를 일찍 시작하게 할 뿐 Tool Search를 비활성화하지 않습니다.

로그에서 검색 호출과 서버 시작 시점 확인하기

Codex MCP 검증 파일 내려받기. ZIP을 풀고 lab/ 폴더에서 아래 명령을 실행합니다.

검색을 지원하는 Mantle 설정이나 위 Runtime 카탈로그 사본으로 시각 질문을 보냅니다. codex exec --json의 thread.started에서 그 실행의 thread_id를 얻은 뒤 실험 폴더(lab/)의 확인 도구로 원본 세션을 읽습니다. --ephemeral은 세션을 저장하지 않으므로 이 확인에는 사용하지 않습니다.

bash
# lab/에서 실행. Runtime 카탈로그 사본을 이 실행에만 적용하는 예
trace=$(mktemp)
bash benchmarks/bedrock-runtime-20261128/with-tool-search.sh --json \
  --skip-git-repo-check --sandbox read-only \
  'time 서버의 도구로 Asia/Seoul의 현재 시각을 조회해서 시각만 한 줄로 답하세요.' > "$trace"
thread_id=$(jq -r 'select(.type == "thread.started") | .thread_id' "$trace")
python3 inspect_codex_session.py "$thread_id"
rm -f -- "$trace"

initial_tool_search는 모델이 검색할 수 있었는지만 보여 줍니다. 이번 실행에서는 tool_search_calls와 tool_search_outputs가 각각 1이었습니다. matching_tools에는 찾은 도구가, mcp_function_calls에는 실제로 호출한 도구가 남았습니다. Runtime 기본 조건은 두 검색 횟수 모두 0이었지만 MCP 호출은 성공했습니다. verify_codex_requests.py는 별도 로컬 응답기에서 이 차이를 검사합니다.

bash
# lab/에서 실행. 두 검사 모두 외부 모델 호출 없음
python3 verify_codex_requests.py
python3 verify_codex_startup.py

지연 시작은 두 번째 스크립트의 프로세스 시작 기록으로 판정합니다. 이 스크립트는 stdio 서버 3개를 선택 서버(optional), 필수 연결 서버(live), 캐시를 허용한 필수 서버(catalog)로 나눠 실행합니다. 같은 app-server의 cold_thread에서는 3개 모두 시작됩니다. default.warm_thread는 live 하나, lazy_disabled.warm_thread는 3개입니다. 기본값의 new_processes_on_ping에는 optional과 catalog가 각각 첫 호출 때만 나타납니다.

04

영향을 받는 구성과 받지 않는 구성

기본값이 바뀌었어도 모든 구성에서 정의가 지연되지는 않습니다. 표 8은 문서와 이번 측정에서 확인한 예외입니다.

구성Claude CodeCodex
모델Opus 4, Sonnet 4, Haiku 4.5보다 이전 모델은 정의를 미리 로드. ENABLE_TOOL_SEARCH=true로도 바뀌지 않음0.172.0 일반 모드의 기본 설정은 모델 카탈로그의 supports_search_tool을 따름. 미지원으로 표시하면 허용된 정의를 직접 전달
클라우드 제공자Google Cloud의 Agent Platform은 4.5 세대 모델부터 적용. Azure에서 호스팅하는 Microsoft Foundry 배포는 지원하지 않음. Amazon Bedrock은 Runtime과 Mantle 모두 기본값에서 지연(측정)같은 Astra xhigh에서 Mantle 기본과 Runtime 카탈로그 재정의 모두 검색 성공. Runtime 기본은 도구 정의 187개를 직접 전송(표 6).
게이트웨이ANTHROPIC_BASE_URL 뒤에서도 2.1.304부터 기본 적용. 게이트웨이가 400이나 422로 거부하면 2.1.305부터 Tool Search 없이 다시 요청검색 요청을 거부하는 게이트웨이의 자동 재시도는 이번 실험에서 확인하지 않음
조직 설정CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS를 설정했거나 HIPAA 구성이면 비활성화관리 정책에서 제외한 서버는 검색으로 다시 활성화되지 않음

표 8. Tool Search와 지연 시작이 적용되지 않거나 다르게 동작하는 구성(문서와 2026-11-28의 측정 결과)

도구 정의를 언제 보내는지와 서버 프로세스를 언제 시작하는지는 따로 확인해야 합니다.

Claude Code에서 연결을 미루는 기능은 원격 서버(HTTP와 SSE)의 discovery cache(MCP_DISCOVERY_CACHE=1)뿐이고 stdio 서버에는 해당하지 않습니다. 그래서 사용하지 않는 서버를 /mcp에서 비활성화할 이유로는 프로세스 수와 시작 시간이 남습니다.

05

지금 바꿀 설정과 그대로 둘 설정

대부분의 사용자는 설정을 바꿀 필요가 없습니다. 최신 버전에서 기본값이 적용되는지 확인하면 됩니다. 확인 방법은 2장(Claude Code)과 3장(Codex)에 있습니다.

자주 사용하는 서버가 표 3의 time 서버처럼 정의가 작다면 검색을 생략하는 선택도 있습니다. Claude Code는 그 서버에 alwaysLoad: true를, Codex 일반 모드는 omit_tools_from = ["deferred"]를 지정하면 허용된 정의를 처음부터 보냅니다. 반대로 도구가 124개인 서버를 미리 로드하면 사용하지 않는 요청에도 정의가 들어갑니다.

06

토큰 절약에서 두 기능이 갖는 의미

표 9는 이 글의 측정값으로 Tool Search의 의미를 도구별로 정리한 것입니다.

항목Claude Code (Opus 5.5 xhigh)Codex (GPT-6.2 Astra xhigh)
서버 6개가 첫 요청에 더한 입력미리 로드 96,503토큰, 검색 5,132토큰(94.7% 감소)미리 로드 27,417토큰, 검색 290토큰(98.9% 감소)
첫 요청의 전체 입력66.3% 감소68.9% 감소
도구 하나를 호출한 질문의 총입력약 49% 감소약 52% 감소
대신 늘어나는 것검색 요청 1건, 검색 뒤 입력 321토큰 증가검색 요청 1건, 검색 뒤 입력 488토큰 증가
비용캐시를 새로 쓴 별도 실행에서 1.19에서 0.36 USD, 캐시에서 읽은 반복에서 0.06에서 0.04 USD계산하지 않음
토큰과 무관한 것서버 프로세스는 세션을 시작할 때 모두 시작지연 시작은 서버 프로세스의 시작만 미룸
절감이 사라지는 조건ENABLE_TOOL_SEARCH=false, 정의가 임계값 미만인 auto, alwaysLoad: true, ToolSearch 거부, 지원하지 않는 모델과 배포모델 카탈로그의 supports_search_tool이 false(Bedrock Runtime 기본값), omit_tools_from = ["deferred"]

표 9. Tool Search가 토큰 절약에서 갖는 의미. 시각 질문의 감소율과 검색 뒤 증가분은 1회차 값으로 계산했고 비용은 Claude Code가 출력한 목록가 환산값입니다(2026-11-28)

의미는 세 가지입니다. 첫째, 설명서가 작업대를 차지하지 않게 되어 MCP 서버를 연결하는 고정 비용이 거의 사라졌습니다. 서버 6개가 첫 요청에 더한 입력이 Claude Code에서 94.7%, Codex에서 98.9% 줄었습니다. 둘째, 절감은 요청마다 누적됩니다. 정의는 요청마다 다시 읽히던 입력이어서 검색 요청이 한 번 늘어도 총입력은 절반가량으로 줄었습니다. 셋째, 절감은 기본값이 적용될 때만 생깁니다. 모델, 제공자, 설정에 따라 정의가 미리 로드되므로 자신의 환경을 확인해야 합니다.

두 제품의 xhigh는 각 제품의 설정 이름입니다. 같은 연산량이나 모델 성능을 뜻하지 않으며 토큰 절감률은 같은 모델 안에서만 계산했습니다.

MCP Tool Search: tool definitions loaded when needed

MCP Tool Search is the feature that lets Claude Code and Codex keep the tool definitions of MCP servers out of the context at the start and load a definition only when the model searches for that tool. When either client connects to an MCP server, it fetches tool names, descriptions and input schemas.

If the client sends all those definitions in the first request, even a short question carries the overhead of every connected server. Claude Code keeps only tool names and server instructions in the context at session start and loads the definition of a tool when the model calls ToolSearch. Codex puts tool_search and a list of namespaces in the first request and passes the definitions of the tools the model searched for in the next request. This became the default in Claude Code 2.1.7 (2026-01-14) and Codex 0.142.2 (2026-06-25).

If the context is a tool bench, the tool definitions are the manuals that come with each tool. The old way laid out the manuals of all 187 tools on the bench before any work started. Tool Search keeps the manuals in drawers with only labels on show and takes out the manual that is needed. Claude Code puts a label on every tool, and Codex puts one on every drawer, which is a server. Lazy startup in Codex is about power, not manuals. Claude Code plugs in every tool when work starts, and Codex plugs in a tool that is already on its list the first time the tool is used. With Tool Search, searching for a definition costs one more model request.

Table 1 sets out what changed in each client, before and after.

ItemClaude CodeCodex
Earlier behaviorEvery tool definition of the connected servers went into the first requestIn 0.142.1, deferral required search support and either the old flag or at least 100 eligible MCP tools
Version that changed it2.1.7 (2026-01-14). The auto mode, which defers definitions once they reach 10% of the context, became the default0.142.2 (2026-06-25). Deferral became the default regardless of tool count on supported setups
Current defaultAll MCP tool definitions are deferred. Only tool names and server instructions are included at session startThe first request includes tool_search and guidance listing searchable namespaces. With default settings, individual MCP schemas arrive after a search
Server processesConnected at session start. Only a remote server connects at its first call, and only with the discovery cache enabledA stdio server with a usable cached catalog can start on first use unless a live connection is required at startup. Opt-in in 0.169.0 (2026-11-13); default in 0.172.0 (2026-11-24)

Table 1. How MCP tool definitions and server processes were handled before and after (documentation of 2026-11-28). I did not find in the Changelog the version in which the Claude Code default moved to deferring everything

01

Why it changed: 74.3k tokens for the definitions of 187 tools

The Claude API documentation says that a setup with GitHub, Slack, Sentry, Grafana and Splunk servers can take about 55k tokens in definitions alone. The same page states that Tool Search typically cuts those tokens by more than 85%.

To check this in my own environment I connected the same six public MCP servers to Claude Code and to Codex (Figure 1). Calling tools/list on each server returned 187 tools, and the names, descriptions and input schemas came to 191,832 bytes of JSON (Table 2). The /context command of Claude Code counted these definitions as 74.3k tokens. On a model with a 200k-token context, that is 37% used before the first question.

Claude Code 2.1.332 ran Opus 5.5 xhigh; Codex 0.172.0 ran GPT-6.2 Astra xhigh on Bedrock Mantle. The same six stdio servers exposed 25, 16, 14, 3, 5 and 124 tools, or 187 overall. A separate wrapper records process starts.
Figure 1. Token measurements used the same six stdio servers. Process starts were recorded in a separate experiment.
ServerPackage and versionToolsDefinition size (bytes)
playwright@playwright/mcp 0.0.862519,365
filesystem@modelcontextprotocol/server-filesystem 2.4.11614,211
gitmcp-server-git 2026.11.27147,008
timemcp-server-time 2026.11.2732,196
aws-documentationawslabs.aws-documentation-mcp-server 1.2.7516,563
bedrock-agentcoreawslabs.amazon-bedrock-agentcore-mcp-server 0.2.2124132,489
Total187191,832

Table 2. The six MCP servers used in the test and the size of their tool definitions (2026-11-28)

For the separate process-start test, I launched each stdio server through the wrapper below.

bash
#!/usr/bin/env bash
# usage: logged.sh <client> <server name> <command> [args...]
tag="$1"; name="$2"; shift 2
log_dir="$(cd "$(dirname "$0")/../logs" && pwd)"
echo "$(date +%s.%3N) start ${name}" >> "$log_dir/start-${tag}.log"
exec "$@"

02

Claude Code: names first, definitions loaded by ToolSearch

How it works

When the model needs a tool it calls ToolSearch, and only the definition of the tool named by the returned tool_reference is loaded at that point (Figure 2).

For the time question, Opus 5.5 xhigh searched in request 1, called the one matching tool in request 2 and answered in request 3. The first repetition used 46,473, 46,794 and 46,920 input tokens. The table shows /context on the same model.
Figure 2. Opus 5.5 xhigh: first repetition of the Seoul time question and the /context estimates by setting (2026-11-28).

What I measured

I passed --model claude-opus-5-5 --effort xhigh to Claude Code and checked the model ID in its responses. First I used /context to compare the no-server baseline with each search setting.

bash
# Use the MCP configuration containing the six test servers
args=(--model claude-opus-5-5 --effort xhigh --strict-mcp-config --mcp-config ./mcp.json)
claude -p /context "${args[@]}"
ENABLE_TOOL_SEARCH=auto   claude -p /context "${args[@]}"
ENABLE_TOOL_SEARCH=auto:5 claude -p /context "${args[@]}"
ENABLE_TOOL_SEARCH=false  claude -p /context "${args[@]}"
text
# Default
**Tokens:** 26.7k / 1m (3%)
| System tools | 1.6k | 0.2% |
| MCP server instructions | 1.3k | 0.1% |
| MCP tools (deferred) | 74.4k | 7.4% |
| System tools (deferred) | 17.7k | 1.8% |

# ENABLE_TOOL_SEARCH=false
**Tokens:** 122.2k / 1m (12%)
| System tools | 22.7k | 2.3% |
| MCP tools | 74.3k | 7.4% |
| MCP server instructions | 1.3k | 0.1% |
SettingContext usedMCP tool definitions
No MCP servers25.4kNone
ENABLE_TOOL_SEARCH unset (default)26.7kDeferred 74.4k
ENABLE_TOOL_SEARCH=auto122.7kUp front 74.3k
ENABLE_TOOL_SEARCH=auto:526.7kDeferred 74.4k
ENABLE_TOOL_SEARCH=false122.2kUp front 74.3k
alwaysLoad: true on the time server27.5k833 up front, 73.5k deferred

Table 3. Opus 5.5 xhigh, 1M context. Values are CLI estimates, with one /context reading per setting (2026-11-28).

Default /context usage rose from 25.4k without servers to 26.7k. It listed 1.3k of server instructions and a further 74.4k in deferred tool definitions. In auto, the definitions occupied 7.4% of the context, below the 10% threshold. auto:5 deferred them. Turning search off also raised the system tools entry from 1.6k to 22.7k. In a separate run with the start-logging wrapper, on the same model and settings, all six server processes started at session start in each of the five conditions with servers.

Actual model input differed from the /context estimates. The OK prompt used 41,303 tokens without servers, 46,435 with six servers and search, and 137,806 with schemas up front. In both time-question runs the model searched, called the time tool, then answered. Total input was 140,187 and 140,209 tokens. Loading up front took two requests but used 275,897 and 275,814 tokens in total.

text
# Default, first repetition
input  46473  ToolSearch {"query":"select:mcp__time__get_current_time"}
input  46794  mcp__time__get_current_time {"timezone":"Asia/Seoul"}
input  46920  answer

# ENABLE_TOOL_SEARCH=false
input 137844  mcp__time__get_current_time {"timezone":"Asia/Seoul"}
input 138053  answer

I checked a third-party setup too. On Amazon Bedrock in us-east-1, I sent the same time question once to the Runtime and once to Mantle with the default settings. Both endpoints deferred the definitions and the model called ToolSearch. The first request used 51,951 and 51,949 input tokens. Unlike Codex, the default did not change with the endpoint.

bash
# Bedrock Runtime (Invoke API)
CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=us-east-1 \
  claude -p "$q" --model us.anthropic.claude-opus-5-5 --effort xhigh --allowedTools "mcp__time"

# Bedrock Mantle
CLAUDE_CODE_USE_MANTLE=1 AWS_REGION=us-east-1 \
  claude -p "$q" --model anthropic.claude-opus-5-5 --effort xhigh --allowedTools "mcp__time"

Checking the Tool Search settings in your Claude Code

On a current version, deferred loading applies with no setting at all. There are three things to check on your side. First, look at the usage table of /context. A line reading MCP tools (deferred) means the definitions are deferred, and a line reading only MCP tools means they loaded up front. Both lines together mean that only some servers load up front. Second, find where a value that changes this behavior is set. ENABLE_TOOL_SEARCH goes in a shell environment variable or the env field of a settings file, a denied ToolSearch in permissions.deny, and alwaysLoad in the server configuration (.mcp.json). There are three settings files (user, project and project local), and managed settings from your organization apply as well. Third, check a real request for a ToolSearch call in the stream-json output. Table 4 lists the values you can change.

bash
# 1) Check whether definitions are deferred. Inside a session, type /context
claude -p "/context" | grep -E "MCP tools|MCP server instructions"

# 2) Find where a value that changes the behavior is set
echo "ENABLE_TOOL_SEARCH=${ENABLE_TOOL_SEARCH:-unset}"
grep -n -E "ENABLE_TOOL_SEARCH|ToolSearch" ~/.claude/settings.json \
  .claude/settings.json .claude/settings.local.json 2>/dev/null
grep -n "alwaysLoad" .mcp.json 2>/dev/null

# 3) Check a real request for a search call; any output means search was used.
# The prompt is Korean for "Look up the current time in Asia/Seoul with a tool of the time server."
q='time 서버의 도구로 Asia/Seoul의 현재 시각을 조회해서 시각만 한 줄로 답하세요.'
claude -p "$q" --allowedTools "mcp__time" --output-format stream-json --verbose \
  | grep -o '"name":"ToolSearch"'
text
# Default: definitions are deferred
| MCP server instructions | 1.3k | 0.1% |
| MCP tools (deferred) | 74.4k | 7.4% |

# alwaysLoad: true on the time server: only that server loads up front
| MCP tools | 833 | 0.1% |
| MCP server instructions | 1.3k | 0.1% |
| MCP tools (deferred) | 73.5k | 7.4% |

# ENABLE_TOOL_SEARCH=false: every definition loads up front
| MCP tools | 74.3k | 7.4% |
| MCP server instructions | 1.3k | 0.1% |
SettingBehaviorWhen to use it
ENABLE_TOOL_SEARCH unset or trueAll MCP tool definitions are deferredThe default. Leave it as it is in most cases
ENABLE_TOOL_SEARCH=auto, auto:NDefinitions load up front while they total under 10% (or N%) of the contextTo skip the search request when there are few tools. With a 1M context, 10% is 100k tokens
ENABLE_TOOL_SEARCH=falseAll definitions load up frontTo go back to the earlier behavior
alwaysLoad: true in a server entryOnly the tools of that server load up frontA small server called on every turn
alwaysLoad: false in a server entryDefers even the tools the server author marked to load up frontTo defer a whole server, on 2.1.287 or later
ToolSearch in permissions.denyThe search tool is gone, so definitions load up frontRemove it unless you meant it

Table 4. Settings related to Tool Search in Claude Code (Claude Code documentation, checked 2026-11-28)

json
{
  "mcpServers": {
    "time": {
      "command": "uvx",
      "args": ["mcp-server-time@2026.11.27", "--local-timezone", "Asia/Seoul"],
      "alwaysLoad": true
    }
  }
}

03

Codex: tool search and stdio server start as separate decisions

How it works

The change shipped in Codex 0.142.2 removed the tool-count threshold (Table 1). In the regular tool mode in 0.172.0, eligible MCP tools are searchable by default when the model catalog advertises support. When the catalog marks the model as unsupported, Codex sends the allowed definitions directly.

Even without individual MCP input schemas, the model sees the search tool and a list of namespaces in its first request. A namespace such as mcp__time identifies a group of tools; the list can include a short description. tool_search ranks tool metadata using BM25 and returns up to eight matching tool definitions by default for the next model request. The search itself does not execute the MCP tool.

Astra xhigh, first time-question run. Request 1 listed six namespaces (12,289 input tokens), request 2 received three time tool definitions and used one (12,777), and the final request used 12,866. The lower panel is a separate process-start experiment.
Figure 3. Top: first repetition on GPT-6.2 Astra xhigh. Bottom: the separate startup experiment on the same CLI (0.172.0, 2026-11-28).

What I measured

Codex used openai.gpt-6.2-astra on Amazon Bedrock Mantle (us-east-1). The session records confirm the model ID and effort = "xhigh". Both conditions in Table 5 used the same model and Mantle endpoint; only the control used a catalog copy with supports_search_tool set to false. These commands run the measurement from my working directory (lab/), which holds the test configuration.

bash
# Two runs per condition; choose a new output directory.
python3 benchmarks/xhigh-20261128/run.py codex --repeats 2 --output ./astra-xhigh-retest
python3 benchmarks/xhigh-20261128/run.py claude --repeats 2 --context --output ./opus-xhigh-retest
text
# Search, first OK run
{"type":"turn.completed","usage":{"input_tokens":12268,"cached_input_tokens":0,"cache_write_input_tokens":12226,"output_tokens":5,"reasoning_output_tokens":0}}

# Catalog marked unsupported, same model
{"type":"turn.completed","usage":{"input_tokens":39395,"cached_input_tokens":0,"cache_write_input_tokens":39353,"output_tokens":5,"reasoning_output_tokens":0}}
ConditionFirst-request input for the OK promptRequests and total input for the time question
No MCP servers11,978Not measured
6 servers, Tool Search supported (default)12,268 (both runs)3 requests, 37,932 / 37,940 tokens
6 servers, marked as not supporting Tool Search39,395 (both runs)2 requests, 78,984 / 78,936 tokens

Table 5. Astra xhigh model input. OK shows the first request; the time question sums all input, including cache reads. Paired values are runs 1 and 2 (2026-11-28).

I set mcp_optional_startup_grace_ms = 0 so a slow optional server would not drop out of the comparison. Zero waits up to each server’s startup timeout. Both search runs listed six namespaces in the first request and sent no individual MCP schemas directly.

With six servers and search, the first OK request used 290 tokens more than it did without servers. With the same model marked as not supporting search, the first request contained all 187 schemas and used 27,127 tokens more than the search condition.

Both time-question runs returned three tools in mcp__time and called only get_current_time. In the first run input rose from 12,289 to 12,777 after search. That increase of 488 includes the search call and its results; it does not isolate schema size.

Different Tool Search defaults on Bedrock Runtime and Mantle

On the same Astra model, Mantle searched by default and the Runtime sent all 187 tool definitions in the first request. I asked the same Seoul time question on both endpoints in us-east-1 and checked which tools ran. Both used the same GPT-6.2 Astra model: openai.gpt-6.2-astra on Mantle and the US cross-region inference profile us.openai.gpt-6.2-astra on Runtime. All three runs used xhigh with web search disabled.

ConditionIndividual MCP schemas up frontSearch callsMCP callModel requests
Mantle default01time.get_current_time succeeded3
Runtime default1870time.get_current_time succeeded2
Runtime, only Astra’s search capability set to true01time.get_current_time succeeded3

Table 6. Codex 0.172.0, GPT-6.2 Astra xhigh, the same six servers and 187 tools; one run per condition on 2026-11-28.

The bundled Runtime catalog marks supports_search_tool as false for this model, so the default run called the time tool directly. On the same Runtime profile, changing only that field to true in a catalog copy returned three time tools from search. The model then called get_current_time and answered. This verifies the tested version and profile.

This is the baseline Runtime config.toml. Change the provider and model ID together. The built-in provider selects the Runtime endpoint for its region; leave out any Mantle URL or Mantle catalog.

toml
model_provider = "amazon-bedrock-runtime"
model = "us.openai.gpt-6.2-astra"
model_reasoning_effort = "xhigh"

[model_providers.amazon-bedrock-runtime.aws]
region = "us-east-1"

To test search as well, first select the Runtime profile and export its provider catalog with codex debug models. The example changes only the Astra entry and uses the copy for one run. To keep it in TOML, set the top-level model_catalog_json to its absolute path before any table headers. Without the override, Codex uses its built-in default again.

bash
# Start with the Runtime TOML above and the time server configuration below
runtime_catalog=$(mktemp)
trap 'rm -f -- "$runtime_catalog"' EXIT
codex debug models | jq -e --arg m 'us.openai.gpt-6.2-astra' '
  if ([.models[] | select(.slug == $m)] | length) == 1
  then (.models[] | select(.slug == $m) | .supports_search_tool) = true
  else error("Runtime model not found") end' > "$runtime_catalog"
codex exec -c "model_catalog_json=\"$runtime_catalog\"" --json --skip-git-repo-check \
  --sandbox read-only 'time 서버의 도구로 Asia/Seoul의 현재 시각을 조회해서 시각만 한 줄로 답하세요.'

Lazy Startup: when stdio servers start

The Codex MCP guide describes a separate decision about starting servers. Without a usable catalog, a regular thread starts the stdio server to discover its tools. An optional server with a cached catalog can wait until first use. With required = true, the default startup_readiness = "connection" requires a live connection at startup. With "catalog", a usable cached tool list can satisfy startup readiness; calling the tool still requires a connection.

In 0.172.0 the regular MCP tool catalog cache lives in process memory for up to 30 minutes. Two independent codex exec runs each started six servers. In one codex app-server process, the first thread started six and the next started none. Asking the time in that thread started only the time server. With lazy startup disabled, the second thread started all six too.

text
# One codex app-server process, default (from the result of the test script)
"thread": "A", "servers_started_at_thread_start": ["time", "playwright", "git", "aws-documentation", "filesystem", "bedrock-agentcore"]
"thread": "B", "servers_started_at_thread_start": []
"thread": "B", "turn_time": {"servers_started_during_turn": ["time"]}

# codex app-server --disable mcp_lazy_stdio_startup
"thread": "B", "servers_started_at_thread_start": ["playwright", "git", "aws-documentation", "bedrock-agentcore", "time", "filesystem"]

Configure Tool Search and Lazy Startup in your Codex client

User settings normally live in ~/.codex/config.toml. With a separate CODEX_HOME, edit its config.toml, then open a fresh session. Check the version with codex --version and the server registration with codex mcp list.

bash
codex --version
codex mcp list
codex features list | grep -E '^(mcp_lazy_stdio_startup|tool_search|tool_search_always_defer_mcp_tools)[[:space:]]'
codex debug models | jq '.models[] | select(.slug == "us.openai.gpt-6.2-astra") | {slug, supports_search_tool}'

In 0.172.0, mcp_lazy_stdio_startup is stable and defaults to true. The former tool_search and tool_search_always_defer_mcp_tools feature switches are marked removed. On a search-capable setup, the default defers eligible MCP definitions. The example keeps the time tool searchable. Uncomment omit_tools_from to send that server’s allowed tools up front instead.

SettingBehaviorWhen to use it
enabled_tools, disabled_toolsApply the allow list, then remove tools on the deny listRestrict which tools can be searched or called directly
enabled = falseDisables a server without deleting its configurationA server you will not use for a while
omit_tools_from = ["deferred"]Exclude the server from search. In regular tool mode, its definitions go in the first request if direct is allowedSkip the search for a frequently used small server. Use disabled_tools to block a tool
required = trueStartup fails unless the server is ready. The default, connection, requires a live connection. With startup_readiness = "catalog", a valid cached list can also count as readyChoose whether startup needs a live connection or only a usable catalog
features.mcp_lazy_stdio_startup = falsestdio servers start at thread startTo keep the server start time out of the first tool call

Table 7. Codex settings related to MCP tools and server startup. All but the features entry go under [mcp_servers.<name>] (Codex documentation, checked 2026-11-28)

toml
# Optional server: with a usable catalog, the process can wait until first use
[features]
mcp_lazy_stdio_startup = true

[mcp_servers.time]
command = "uvx"
args = ["mcp-server-time@2026.11.27", "--local-timezone", "Asia/Seoul"]
enabled_tools = ["get_current_time"]
required = false
# omit_tools_from = ["deferred"]

Under [features], mcp_lazy_stdio_startup = false only makes servers start early; it does not disable Tool Search.

Verifying search calls and process starts separately

Download the Codex MCP checks. Extract the ZIP and run the commands below from its lab/ directory.

Send the time question using the search-capable Mantle setup or the Runtime catalog copy above. Take the thread_id from that run’s thread.started event and inspect the saved session with the helper in lab/. Leave out --ephemeral so there is a session to inspect.

bash
# Run from lab/. This helper applies the Runtime catalog copy to just this request.
trace=$(mktemp)
bash benchmarks/bedrock-runtime-20261128/with-tool-search.sh --json \
  --skip-git-repo-check --sandbox read-only \
  'time 서버의 도구로 Asia/Seoul의 현재 시각을 조회해서 시각만 한 줄로 답하세요.' > "$trace"
thread_id=$(jq -r 'select(.type == "thread.started") | .thread_id' "$trace")
python3 inspect_codex_session.py "$thread_id"
rm -f -- "$trace"

initial_tool_search shows that search was offered. In the live search run, tool_search_calls and tool_search_outputs were both 1, matching_tools contained the target, and mcp_function_calls recorded the call. The default Runtime condition had zero search calls and outputs but still called MCP successfully. verify_codex_requests.py checks the initial exposure separately using a local endpoint.

bash
# Run from lab/. Neither check calls an external model.
python3 verify_codex_requests.py
python3 verify_codex_startup.py

Use the second script’s process-start records to verify Lazy Startup. It runs three stdio servers: an optional one (optional), one required with a live connection (live), and one required with cached catalog readiness (catalog). The cold_thread starts all three servers. In the same app-server, default.warm_thread contains only live, whereas lazy_disabled.warm_thread contains all three. With the default, new_processes_on_ping shows that optional and catalog start on first use.

04

Setups that are affected and setups that are not

The defaults changed, but definitions are not deferred in every setup. Table 8 lists the exceptions I found in the documentation and in these measurements.

SetupClaude CodeCodex
ModelModels earlier than Opus 4, Sonnet 4 and Haiku 4.5 load definitions up front. ENABLE_TOOL_SEARCH=true does not change thatRegular tool mode in 0.172.0 follows the model catalog's supports_search_tool by default. When false, allowed schemas are sent directly
Cloud providerOn Google Cloud's Agent Platform it applies from the 4.5 generation on. Microsoft Foundry deployments hosted on Azure are not supported. On Amazon Bedrock, both the Runtime and Mantle defer by default (measured)On the same Astra xhigh, search succeeded with the Mantle default and the Runtime catalog override. The Runtime default sent 187 schemas directly (Table 6).
GatewayOn by default behind ANTHROPIC_BASE_URL since 2.1.304. Since 2.1.305, a 400 or 422 from the gateway is retried without Tool SearchThis test did not establish automatic retry after a gateway rejects tool search
Organization settingsOff when CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS is set or in the HIPAA configurationSearch cannot re-enable a server excluded by managed policy

Table 8. Setups where Tool Search or lazy startup does not apply or behaves differently (documentation and the measurements of 2026-11-28)

Check separately when definitions reach the model and when the server process starts.

In Claude Code, the only way to put off a connection is the discovery cache of remote servers (HTTP or SSE, MCP_DISCOVERY_CACHE=1), which does not cover stdio servers. So the reason to disable an unused server in /mcp now lies in the number of processes and the startup time.

05

Settings to change now and settings to leave alone

Most users do not need to change anything. It is enough to confirm that the default applies on a current version. The checks are in chapter 2 (Claude Code) and chapter 3 (Codex).

For a server you call frequently whose definitions are as small as those of the time server in Table 3, skipping the search may make sense. Set alwaysLoad: true in Claude Code, or omit_tools_from = ["deferred"] in regular Codex tool mode, to send that server's eligible definitions up front. Doing the same for a server with 124 tools adds definitions even to requests that never use it.

06

What the two features mean for token savings

Table 9 sums up what Tool Search means for each tool, using the measurements in this post.

ItemClaude Code (Opus 5.5 xhigh)Codex (GPT-6.2 Astra xhigh)
Input that six servers add to the first request96,503 tokens up front, 5,132 with search (94.7% less)27,417 tokens up front, 290 with search (98.9% less)
Whole input of the first request66.3% less68.9% less
Total input of a question that calls one toolAbout 49% lessAbout 52% less
What goes up insteadOne search request; input grows by 321 tokens after the searchOne search request; input grows by 488 tokens after the search
Cost1.19 to 0.36 USD in a separate run that wrote the cache, 0.06 to 0.04 USD in the pass that read from itNot computed
What tokens do not coverEvery server process still starts at session startLazy startup only puts off the start of server processes
When the saving disappearsENABLE_TOOL_SEARCH=false, auto with definitions under the threshold, alwaysLoad: true, a denied ToolSearch, models and deployments without supportsupports_search_tool set to false in the model catalog (the Bedrock Runtime default), omit_tools_from = ["deferred"]

Table 9. What Tool Search means for token savings. The time-question reduction and the growth after the search are calculated from the first pass, and cost is the list-price figure that Claude Code printed (2026-11-28)

It comes down to three things. First, with the manuals off the bench, the fixed cost of connecting MCP servers has almost gone: the input that six servers added to the first request fell by 94.7% in Claude Code and 98.9% in Codex. Second, the saving adds up with every request. Definitions were input that each request read again, so total input fell by about half even with one more request for the search. Third, the saving exists only when the default applies. Definitions still load up front depending on the model, the provider and the settings, so check your own setup.

The two products use xhigh as the name of their own effort setting. It does not establish equal compute or model capability, and savings are calculated within each model.

참고 자료References

No.출처Source종류Kind확인한 날Checked
1Claude Code CHANGELOG.mdChangelogChangelog2026-11-28
2Connect Claude Code to tools via MCP: Scale with MCP tool searchClaude Code 문서Claude Code docs2026-11-28
3Manage costs effectively: Reduce MCP server overheadClaude Code 문서Claude Code docs2026-11-28
4Environment variablesClaude Code 문서Claude Code docs2026-11-28
5Tool search toolClaude API 문서Claude API docs2026-11-28
6Codex 0.142.2 release notesGitHub 릴리스GitHub release2026-11-28
7Use tool search for MCP tools by default (#29486)GitHub PRGitHub pull request2026-11-28
8Add opt-in lazy startup for cached stdio MCP servers (#60039)GitHub PRGitHub pull request2026-11-28
9Enable lazy startup for stdio MCP servers by default (#62366)GitHub PRGitHub pull request2026-11-28
10Codex 0.172.0 release notesGitHub 릴리스GitHub release2026-11-28
11Model Context ProtocolCodex 문서Codex docs2026-11-28
12Configuration ReferenceCodex 문서Codex docs2026-11-28
13codex-rs/codex-mcp/src/tool_catalog_cache.rsCodex 소스Codex source2026-11-28
14Codex 0.169.0 release notesGitHub 릴리스GitHub release2026-11-28
15Codex 0.172.0: MCP tool exposure and per-server overridesCodex 소스Codex source2026-11-28
16Codex 0.172.0: Bedrock Runtime model catalogCodex 소스Codex source2026-11-28
17Codex 0.172.0: stdio startup eligibilityCodex 소스Codex source2026-11-28
18Codex 0.172.0: BM25 tool searchCodex 소스Codex source2026-11-28
19Claude Code model configurationClaude Code 문서Claude Code docs2026-11-28
20Settings files and precedenceClaude Code 문서Claude Code docs2026-11-28
21Claude Code on Amazon BedrockClaude Code 문서Claude Code docs2026-11-28
22EffortClaude API 문서Claude API docs2026-11-28
23Codex modelsCodex 문서Codex docs2026-11-28
24GPT-6.2 Astra - Amazon Bedrock model cardAWS 모델 카드AWS model card2026-11-28
25Codex 0.172.0: regional Bedrock Runtime endpoint and signing serviceCodex 소스Codex source2026-11-28