Skip to content

Conversation

@zjrwtx
Copy link
Collaborator

@zjrwtx zjrwtx commented Jul 18, 2025

Description

Describe your changes in detail (optional if the linked issue already contains a detailed description of the changes).

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch minfix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zjrwtx zjrwtx requested a review from Wendong-Fan July 18, 2025 12:14
@Wendong-Fan
Copy link
Member

got error

(.venv) enrei@MacBook-Pro camel % git pull 
Already up to date.
(.venv) enrei@MacBook-Pro camel % python /Users/enrei/Desktop/repos/camel0717/camel/examples/toolkits/mcp/mcp_origene_toolkit/client.py
2025-07-18 23:49:47,061 - asyncio - ERROR - an error occurred during closing of asynchronous generator <async_generator object MCPClient._create_transport at 0x102a14430>
asyncgen: <async_generator object MCPClient._create_transport at 0x102a14430>
  + Exception Group Traceback (most recent call last):
  |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  | BaseExceptionGroup: unhandled errors in a TaskGroup (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    |     yield
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
    |     resp = await self._pool.handle_async_request(req)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
    |     raise exc from None
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
    |     response = await connection.handle_async_request(
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
    |     raise exc
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request
    |     stream = await self._connect(request)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 124, in _connect
    |     stream = await self._network_backend.connect_tcp(**kwargs)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_backends/auto.py", line 31, in connect_tcp
    |     return await self._backend.connect_tcp(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 113, in connect_tcp
    |     with map_exceptions(exc_map):
    |   File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    |     raise to_exc(exc) from exc
    | httpcore.ConnectError: All connection attempts failed
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/client/streamable_http.py", line 405, in handle_request_async
    |     await self._handle_post_request(ctx)
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/client/streamable_http.py", line 259, in _handle_post_request
    |     async with ctx.client.stream(
    |   File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1583, in stream
    |     response = await self.send(
    |                ^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1629, in send
    |     response = await self._send_handling_auth(
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
    |     response = await self._send_handling_redirects(
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
    |     response = await self._send_single_request(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1730, in _send_single_request
    |     response = await transport.handle_async_request(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
    |     with map_httpcore_exceptions():
    |   File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
    |     raise mapped_exc(message) from exc
    | httpx.ConnectError: All connection attempts failed
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/client/streamable_http.py", line 498, in streamablehttp_client
    |     yield (
    |   File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/mcp_client.py", line 513, in _create_transport
    |     yield read_stream, write_stream, get_session_id
    | GeneratorExit
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/mcp_client.py", line 503, in _create_transport
    async with streamablehttp_client(
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/contextlib.py", line 231, in __aexit__
    await self.gen.athrow(typ, value, traceback)
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/client/streamable_http.py", line 474, in streamablehttp_client
    async with anyio.create_task_group() as tg:
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 778, in __aexit__
    if self.cancel_scope.__exit__(type(exc), exc, exc.__traceback__):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/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
2025-07-18 23:49:47,068 - asyncio - ERROR - an error occurred during closing of asynchronous generator <async_generator object streamablehttp_client at 0x119803dc0>
asyncgen: <async_generator object streamablehttp_client at 0x119803dc0>
Traceback (most recent call last):
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 111, in receive
    return self.receive_nowait()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 106, in receive_nowait
    raise WouldBlock
anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/examples/toolkits/mcp/mcp_origene_toolkit/client.py", line 41, in main
    async with OrigeneToolkit(config_dict=config_dict) as origene_toolkit:
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/toolkits/origene_mcp_toolkit.py", line 80, in __aenter__
    await self.connect()
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/commons.py", line 994, in async_wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/toolkits/origene_mcp_toolkit.py", line 64, in connect
    await self._mcp_toolkit.connect()
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/commons.py", line 994, in async_wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/toolkits/mcp_toolkit.py", line 221, in connect
    await self._exit_stack.enter_async_context(client)
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/contextlib.py", line 650, in enter_async_context
    result = await _enter(cm)
             ^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/mcp_client.py", line 288, in __aenter__
    await self._establish_connection()
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/mcp_client.py", line 318, in _establish_connection
    await self._session.initialize()
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/client/session.py", line 151, in initialize
    result = await self.send_request(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 272, in send_request
    response_or_error = await response_stream_reader.receive()
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 119, in receive
    await receive_event.wait()
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 119c97710

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
Traceback (most recent call last):
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 111, in receive
    return self.receive_nowait()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 106, in receive_nowait
    raise WouldBlock
anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/enrei/Desktop/repos/camel0717/camel/examples/toolkits/mcp/mcp_origene_toolkit/client.py", line 88, in <module>
    asyncio.run(main())
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/examples/toolkits/mcp/mcp_origene_toolkit/client.py", line 41, in main
    async with OrigeneToolkit(config_dict=config_dict) as origene_toolkit:
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/toolkits/origene_mcp_toolkit.py", line 80, in __aenter__
    await self.connect()
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/commons.py", line 994, in async_wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/toolkits/origene_mcp_toolkit.py", line 64, in connect
    await self._mcp_toolkit.connect()
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/commons.py", line 994, in async_wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/toolkits/mcp_toolkit.py", line 221, in connect
    await self._exit_stack.enter_async_context(client)
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/contextlib.py", line 650, in enter_async_context
    result = await _enter(cm)
             ^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/mcp_client.py", line 288, in __aenter__
    await self._establish_connection()
  File "/Users/enrei/Desktop/repos/camel0717/camel/camel/utils/mcp_client.py", line 318, in _establish_connection
    await self._session.initialize()
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/client/session.py", line 151, in initialize
    result = await self.send_request(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 272, in send_request
    response_or_error = await response_stream_reader.receive()
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/enrei/Desktop/repos/camel0717/camel/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 119, in receive
    await receive_event.wait()
  File "/Users/enrei/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 119c97710
(.venv) enrei@MacBook-Pro camel % 

@zjrwtx
Copy link
Collaborator Author

zjrwtx commented Jul 19, 2025

thanks @Wendong-Fan ,to run this script,we should setup the mcp server,refer https://github.com/GENTEL-lab/OrigeneMCP
image

@Wendong-Fan Wendong-Fan added the Waiting for Update PR has been reviewed, need to be updated based on review comment label Jul 20, 2025
@waleedalzarooni
Copy link
Collaborator

Hey @zjrwtx

Any updates on this Yifeng, let me know if you have any bottle necks!

@waleedalzarooni waleedalzarooni self-requested a review November 4, 2025 05:44
@waleedalzarooni waleedalzarooni added Review Required PR need to be reviewed and removed Waiting for Update PR has been reviewed, need to be updated based on review comment labels Dec 16, 2025
@JINO-ROHIT
Copy link
Collaborator

is there an usage example for this? im unable to find how to use this?

@JINO-ROHIT
Copy link
Collaborator

found it, im assuming we need to change this as well right? https://github.com/camel-ai/camel/blob/master/examples/toolkits/mcp/mcp_origene_toolkit/client.py

@fengju0213
Copy link
Collaborator

found it, im assuming we need to change this as well right? https://github.com/camel-ai/camel/blob/master/examples/toolkits/mcp/mcp_origene_toolkit/client.py

yes, you're right

Copy link
Collaborator

@fengju0213 fengju0213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it just a name correction,approve
image

@JINO-ROHIT JINO-ROHIT merged commit dab202a into master Dec 17, 2025
14 checks passed
@JINO-ROHIT JINO-ROHIT deleted the minfix branch December 17, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review Required PR need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants