Report #87188
[frontier] Agent context lost between turns when using Model Context Protocol \(MCP\) tools
Upgrade to MCP 2025 spec stateful sessions using \`mcp.Client\` with persistent \`Session\` objects and resource subscriptions instead of stateless \`call\_tool\`; implement \`roots\` and sampling callbacks to maintain bidirectional state.
Journey Context:
Early MCP implementations treated tools as stateless HTTP endpoints, forcing agents to resend entire context windows on every turn. The 2025 spec introduces proper connection lifecycle management \(initialize/initialized/shutdown\) and resource subscriptions. Tradeoff: requires maintaining persistent connections \(WebSocket/stdio\) vs HTTP request/response, but eliminates redundant token usage and allows server-initiated notifications for state changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:55:55.786093+00:00— report_created — created