Skip to content

[BUG] cursor内调用成功一次后工具变为不可用 #30

Description

@eroneko

Bug Description / Bug描述

cursor内使用,agent调用MCP Tool成功一次后,下一次调用codexmcp就不可用了

Environment / 运行环境

  • OS: Windows 11 / WSL2 ...
  • CodexMCP Version: "command": "uvx",
    "args": [
    "--from",
    "git+https://github.com/GuDaStudio/codexmcp.git",
    "codexmcp"
    ]
  • Claude Code Version: 未使用
  • Codex CLI Version: 0.65.0
  • Cursor Version: 2.1.50

Steps to Reproduce / 复现步骤

  1. cursor加入本MCP
  2. agent调用一次codexmcp并成功获得返回结果
  3. agent再次调用,调用失败(tool codex not found)

Logs / 错误日志

If the error field is returned, please paste it here.
如有error字段返回,请粘贴在这里。

2025-12-09 11:33:42.128 [info] Found 1 tools, 0 prompts, and 0 resources
2025-12-09 11:34:08.200 [info] Handling GetInstructions action
2025-12-09 11:34:34.842 [info] Handling CallTool action for tool 'codex'
2025-12-09 11:34:34.842 [info] Calling tool 'codex' with toolCallId: toolu_01847rL4k7zubLqrzgp9oM8W
2025-12-09 11:34:34.852 [error] [12/09/25 11:34:34] INFO     Processing request of type            server.py:709
                             CallToolRequest                                    

2025-12-09 11:34:34.852 [error] [12/09/25 11:34:34] INFO     Processing request of type            server.py:709
                             CallToolRequest                                    

2025-12-09 11:34:53.052 [info] Handling ListOfferings action, server stored: true
2025-12-09 11:34:53.053 [info] Connected to stdio server, fetching offerings
2025-12-09 11:35:53.054 [error] Error listing tools: MCP error -32001: Request timed out
2025-12-09 11:36:53.054 [error] Error listing prompts: MCP error -32001: Request timed out
2025-12-09 11:37:19.924 [error] [12/09/25 11:37:19] INFO     Processing request of type            server.py:709
                             ListToolsRequest                                   

2025-12-09 11:37:19.924 [error] [12/09/25 11:37:19] INFO     Processing request of type            server.py:709
                             ListToolsRequest                                   

2025-12-09 11:37:19.929 [info] Successfully called tool 'codex'
2025-12-09 11:37:19.930 [error]   + Exception Group Traceback (most recent call last):
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/bin/codexmcp", line 12, in <module>

2025-12-09 11:37:19.930 [error]   + Exception Group Traceback (most recent call last):
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/bin/codexmcp", line 12, in <module>

2025-12-09 11:37:19.931 [error]   |     sys.exit(main())

2025-12-09 11:37:19.931 [error]   |     sys.exit(main())

2025-12-09 11:37:19.931 [error]   |              ^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/codexmcp/cli.py", line 8, in main

2025-12-09 11:37:19.931 [error]   |              ^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/codexmcp/cli.py", line 8, in main

2025-12-09 11:37:19.931 [error]   |     run()

2025-12-09 11:37:19.931 [error]   |     run()

2025-12-09 11:37:19.931 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/codexmcp/server.py", line 288, in run

2025-12-09 11:37:19.931 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/codexmcp/server.py", line 288, in run

2025-12-09 11:37:19.931 [error]   |     mcp.run(transport="stdio")

2025-12-09 11:37:19.931 [error]   |     mcp.run(transport="stdio")

2025-12-09 11:37:19.931 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/fastmcp/server.py", line 296, in run

2025-12-09 11:37:19.931 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/fastmcp/server.py", line 296, in run

2025-12-09 11:37:19.932 [error]   |     anyio.run(self.run_stdio_async)

2025-12-09 11:37:19.932 [error]   |     anyio.run(self.run_stdio_async)

2025-12-09 11:37:19.932 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_core/_eventloop.py", line 75, in run
  |     return async_backend.run(func, args, {}, backend_options)

2025-12-09 11:37:19.932 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_core/_eventloop.py", line 75, in run
  |     return async_backend.run(func, args, {}, backend_options)

2025-12-09 11:37:19.932 [error]   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2365, in run

2025-12-09 11:37:19.932 [error]   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2365, in run

2025-12-09 11:37:19.932 [error]   |     return runner.run(wrapper())

2025-12-09 11:37:19.932 [error]   |     return runner.run(wrapper())

2025-12-09 11:37:19.932 [error]   |            ^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 118, in run

2025-12-09 11:37:19.932 [error]   |            ^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 118, in run

2025-12-09 11:37:19.932 [error]   |     return self._loop.run_until_complete(task)

2025-12-09 11:37:19.932 [error]   |     return self._loop.run_until_complete(task)

2025-12-09 11:37:19.932 [error]   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete

2025-12-09 11:37:19.932 [error]   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete

2025-12-09 11:37:19.933 [error]   |     return future.result()

2025-12-09 11:37:19.933 [error]   |     return future.result()

2025-12-09 11:37:19.933 [error]   |            ^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2348, in wrapper

2025-12-09 11:37:19.933 [error]   |            ^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2348, in wrapper

2025-12-09 11:37:19.934 [error]   |     return await func(*args)
  |            ^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/fastmcp/server.py", line 749, in run_stdio_async

2025-12-09 11:37:19.934 [error]   |     return await func(*args)
  |            ^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/fastmcp/server.py", line 749, in run_stdio_async

2025-12-09 11:37:19.934 [error]   |     async with stdio_server() as (read_stream, write_stream):
  |                ^^^^^^^^^^^^^^

2025-12-09 11:37:19.934 [error]   |     async with stdio_server() as (read_stream, write_stream):
  |                ^^^^^^^^^^^^^^

2025-12-09 11:37:19.934 [error]   |   File "/home/seedron/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 217, in __aexit__

2025-12-09 11:37:19.934 [error]   |   File "/home/seedron/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 217, in __aexit__

2025-12-09 11:37:19.935 [error]   |     await anext(self.gen)

2025-12-09 11:37:19.935 [error]   |     await anext(self.gen)

2025-12-09 11:37:19.935 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/stdio.py", line 85, in stdio_server
  |     async with anyio.create_task_group() as tg:
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 783, in __aexit__

2025-12-09 11:37:19.935 [error]   |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/stdio.py", line 85, in stdio_server
  |     async with anyio.create_task_group() as tg:
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 783, in __aexit__

2025-12-09 11:37:19.935 [error]   |     raise BaseExceptionGroup(

2025-12-09 11:37:19.935 [error]   |     raise BaseExceptionGroup(

2025-12-09 11:37:19.935 [error]   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/stdio.py", line 71, in stdin_reader

2025-12-09 11:37:19.935 [error]   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/mcp/server/stdio.py", line 71, in stdin_reader

2025-12-09 11:37:19.935 [error]     |     await read_stream_writer.send(session_message)

2025-12-09 11:37:19.935 [error]     |     await read_stream_writer.send(session_message)

2025-12-09 11:37:19.935 [error]     |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/streams/memory.py", line 262, in send

2025-12-09 11:37:19.935 [error]     |   File "/home/seedron/.cache/uv/archive-v0/x0KwZdmmoCJQVACLNHttj/lib/python3.12/site-packages/anyio/streams/memory.py", line 262, in send

2025-12-09 11:37:19.936 [error]     |     raise BrokenResourceError from None

2025-12-09 11:37:19.936 [error]     |     raise BrokenResourceError from None

2025-12-09 11:37:19.936 [error]     | anyio.BrokenResourceError
    +------------------------------------

2025-12-09 11:37:19.936 [error]     | anyio.BrokenResourceError
    +------------------------------------

2025-12-09 11:37:20.134 [info] Client closed for command

Tool Call Parameters / 工具调用参数

If the bug is related to calling the codex tool, please provide the parameters used.
若该故障与调用 codex 工具相关,请提供所用参数。
调用时tool not found,看不到所用参数

Additional Context / 其他信息

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions