Skip to content

fix: correct anyio stream creation syntax #1188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

S-Naved
Copy link

@S-Naved S-Naved commented Jul 23, 2025

Fixes TypeError during session initialization by correcting the syntax for anyio.create_memory_object_stream call. The invalid subscript syntax ([...]) was causing server startup failures.

Changes

  1. Removed [...] from anyio.create_memory_object_stream[...](0) call

Verification

  • All tests pass
  • Linting checks complete
  • Manual testing confirms server starts successfully
  • Type checking passes

@S-Naved S-Naved requested a review from a team as a code owner July 24, 2025 07:34
@S-Naved S-Naved requested a review from Kludex July 24, 2025 07:34
S-Naved added 2 commits July 24, 2025 13:10
- Remove invalid subscript syntax from anyio.create_memory_object_stream call
@Kludex
Copy link
Member

Kludex commented Jul 24, 2025

What is the issue? What version of anyio and mcp?

@S-Naved
Copy link
Author

S-Naved commented Jul 24, 2025

When I build the local MCP it's showing me an error:
| C:\Users\MI\AppData\Local\uv\cache\ |
| archive-v0-9mRABDhgJyBu2txUuRpO\Li |
| b\site-packages\mcp\server\session. |
| py:96 in init |
| |
| 93 ) |
| 94 |
| 95 self._init_options = |
| > 96 self._incoming_messag |
| anyio.create_memory_object_st |
| 97 ServerRequestResp |
| 98 ](0) |
| 99 self._exit_stack.push |
| self._incoming_message_stream |
+-------------------------------------+
TypeError: 'function' object is not
subscriptable .
anyio 3.6.1 and mcp version is 1.12.1

@Kludex
Copy link
Member

Kludex commented Jul 24, 2025

The minimum anyio version is 4.5.0. Bump that package, please.

@Kludex Kludex closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants