I am getting this error when trying to use custom MCP Server tools and Runner in a Django Project. Help is appreciated! #919
Unanswered
Priyanshu-NorthAstra
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
You have 58 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, django_celery_beat, emailsync, quickbook, sessions, social_django, user_management.
Run 'python manage.py migrate' to apply them.
May 24, 2025 - 21:00:52
Django version 4.2.10, using settings 'core.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Request received
Initializing Agent
Creating Agent
Agent created
Agent initialized
Warning: there are non-text parts in the response: ['function_call'], returning concatenated text result from text parts. Check the full candidates.content.parts accessor to get the full model response.
an error occurred during closing of asynchronous generator <async_generator object sse_client at 0x11d4b46c0>
asyncgen: <async_generator object sse_client at 0x11d4b46c0>
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 772, in aexit
| raise BaseExceptionGroup(
| exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/httpx_sse/_api.py", line 70, in aconnect_sse
| yield EventSource(response)
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/mcp/client/sse.py", line 154, in sse_client
| yield read_stream, write_stream
| GeneratorExit
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/mcp/client/sse.py", line 57, in sse_client
| async with aconnect_sse(
| File "/usr/local/Cellar/python@3.10/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 217, in aexit
| await self.gen.athrow(typ, value, traceback)
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/httpx_sse/_api.py", line 69, in aconnect_sse
| async with client.stream(method, url, headers=headers, **kwargs) as response:
| File "/usr/local/Cellar/python@3.10/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 249, in aexit
| raise RuntimeError("generator didn't stop after athrow()")
| RuntimeError: generator didn't stop after athrow()
+------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/mcp/client/sse.py", line 53, in sse_client
async with anyio.create_task_group() as tg:
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 778, in aexit
if self.cancel_scope.exit(type(exc), exc, exc.traceback):
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 457, in exit
raise RuntimeError(
RuntimeError: Attempted to exit cancel scope in a different task than it was entered in
[24/May/2025 21:01:32] "POST /agents/api/agent/ HTTP/1.1" 200 140
Beta Was this translation helpful? Give feedback.
All reactions