fix: allow SSE server router to be nested (#240)
* fix: allow SSE server router to be nested
This commit is contained in:
parent
97bb4796dd
commit
47518b3906
1 changed files with 77 additions and 27 deletions
|
|
@ -1,10 +1,10 @@
|
|||
from mcp import ClientSession, StdioServerParameters, types
|
||||
from mcp.client.sse import sse_client
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
async def run():
|
||||
async with sse_client("http://localhost:8000/sse") as (read, write):
|
||||
url = sys.argv[1]
|
||||
async with sse_client(url) as (read, write):
|
||||
async with ClientSession(
|
||||
read, write
|
||||
) as session:
|
||||
|
|
@ -25,4 +25,4 @@ async def run():
|
|||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
|
||||
asyncio.run(run())
|
||||
asyncio.run(run())
|
||||
|
|
|
|||
Loading…
Reference in a new issue