---
type: email
from: David <notifications@github.com>
subject: [openai/openai-agents-python] Fix MCPServerStdio leaked semaphores

 warning at shutdown (PR #2573)
received: 2026-03-05 17:46:45
priority: high
status: awaiting_approval
---

## Email Content
Fixes #618. Resets the session&#39;s AsyncExitStack on cleanup so it successfully releases resources and allows reconnections.

You can view, comment on, or merge this pull request online at:



  https://github.com/openai/openai-agents-python/pull/2573



-- Commit Summary --



  * Fix MCP stdio teardown leaked semaphores



-- File Changes --



    M src/agents/mcp/server.py (2)

    M tests/mcp/test_connect_disconnect.py (37)



-- Patch Links --



https://github.com/openai/openai-agents-python/pull/2573.patch

https://github.com/openai/openai-agents-python/pull/2573.diff



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/2573

You are receiving this because you are subscribed to this thread.



Message ID: &lt;openai/opena...

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Flag for review
