Skip to content
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

Requested timeout #719

Open
Skywalker-Harrison opened this issue Mar 3, 2025 · 2 comments
Open

Requested timeout #719

Skywalker-Harrison opened this issue Mar 3, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Skywalker-Harrison
Copy link

Describe the bug
Hi, I encountered some error when running my own mcp server.
I tried to install my own image inference structure to my computer (using macos, and mps for inference), after I installed the dependencies as required, the log of my server just warned me 32001 Error.

Logs

2025-03-03T02:11:56.989Z [screenparser] [info] Initializing server...
2025-03-03T02:11:56.993Z [screenparser] [info] Server started and connected successfully
2025-03-03T02:11:57.036Z [screenparser] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
Downloading scipy (21.3MiB)
Downloading easyocr (2.7MiB)
Downloading scikit-learn (10.6MiB)
Downloading opencv-python-headless (35.6MiB)
Downloading numpy (13.3MiB)
Downloading opencv-contrib-python (44.1MiB)
Downloading torchvision (1.7MiB)
Downloading shapely (1.3MiB)
Downloading cython (1.1MiB)
Downloading scikit-image (12.6MiB)
Downloading lxml (7.8MiB)
Downloading rapidfuzz (1.4MiB)
Downloading rapidfuzz (1.4MiB)
 Downloaded cython
 Downloaded shapely
 Downloaded rapidfuzz
 Downloaded torchvision
 Downloaded cython
 Downloaded shapely
 Downloaded easyocr
 Downloaded rapidfuzz
 Downloaded torchvision
 Downloaded easyocr
 Downloaded lxml
 Downloaded scikit-learn
 Downloaded lxml
 Downloaded scikit-image
 Downloaded numpy
2025-03-03T02:12:55.939Z [screenparser] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-03T02:12:55.940Z [screenparser] [info] Client transport closed
2025-03-03T02:12:55.941Z [screenparser] [info] Server transport closed
2025-03-03T02:12:55.941Z [screenparser] [info] Client transport closed
2025-03-03T02:12:55.941Z [screenparser] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', file=sys.stderr)` in python) and it will appear in this log.
2025-03-03T02:12:55.941Z [screenparser] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-03-03T02:12:55.950Z [screenparser] [info] Server transport closed
2025-03-03T02:12:55.950Z [screenparser] [info] Client transport closed
2025-03-03T02:12:57.034Z [screenparser] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-03-03T02:12:57.035Z [screenparser] [info] Client transport closed
2025-03-03T02:12:57.036Z [screenparser] [info] Server transport closed
2025-03-03T02:12:57.036Z [screenparser] [info] Client transport closed
2025-03-03T02:12:57.036Z [screenparser] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', file=sys.stderr)` in python) and it will appear in this log.
2025-03-03T02:12:57.036Z [screenparser] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-03-03T02:12:57.043Z [screenparser] [info] Server transport closed
2025-03-03T02:12:57.044Z [screenparser] [info] Client transport closed

Additional context
I am thinking this is due to the dependencies, but the error information from the log is not sufficient.

@Skywalker-Harrison Skywalker-Harrison added the bug Something isn't working label Mar 3, 2025
@Skywalker-Harrison
Copy link
Author

recent log:


{"type":"text","text":"屏幕解析成功,耗时: 0.75秒\n\n识别到 1 个UI元素:\n\n- ID: 0, 内容: 模拟解析结果 - 未检测到明显UI元素\n  位置: [0, 0, 100, 100]\n"}],"isError":false}}
2025-03-03T02:21:25.352Z [screenparser] [info] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":29}
Processing request of type ListResourcesRequest
2025-03-03T02:21:25.357Z [screenparser] [info] Message from server: {"jsonrpc":"2.0","id":29,"result":{"resources":[]}}
2025-03-03T02:21:25.358Z [screenparser] [info] Message from client: {"method":"prompts/list","params":{},"jsonrpc":"2.0","id":30}
Processing request of type ListPromptsRequest
2025-03-03T02:21:25.361Z [screenparser] [info] Message from server: {"jsonrpc":"2.0","id":30,"result":{"prompts":[]}}
2025-03-03T02:21:30.347Z [screenparser] [info] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":31}
Processing request of type ListResourcesRequest
2025-03-03T02:21:30.352Z [screenparser] [info] Message from server: {"jsonrpc":"2.0","id":31,"result":{"resources":[]}}
2025-03-03T02:21:30.353Z [screenparser] [info] Message from client: {"method":"prompts/list","params":{},"jsonrpc":"2.0","id":32}
Processing request of type ListPromptsRequest
2025-03-03T02:21:30.359Z [screenparser] [info] Message from server: {"jsonrpc":"2.0","id":32,"result":{"prompts":[]}}
2025-03-03T02:21:35.347Z [screenparser] [info] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":33}
Processing request of type ListResourcesRequest
2025-03-03T02:21:35.352Z [screenparser] [info] Message from server: {"jsonrpc":"2.0","id":33,"result":{"resources":[]}}
2025-03-03T02:21:35.354Z [screenparser] [info] Message from client: {"method":"prompts/list","params":{},"jsonrpc":"2.0","id":34}
Processing request of type ListPromptsRequest
2025-03-03T02:21:35.361Z [screenparser] [info] Message from server: {"jsonrpc":"2.0","id":34,"result":{"prompts":[]}}
2025-03-03T02:21:38.089Z [screenparser] [info] Message from client: {"method":"tools/call","params":{"name":"capture-screen","arguments":{}},"jsonrpc":"2.0","id":35}
Processing request of type CallToolRequest
调用工具: capture-screen, 参数: {}
执行截屏操作
开始截屏,操作系统: darwin
使用macOS截屏方法
创建临时文件: /tmp/tmp0qmjldiw.png
执行命令: screencapture -x /tmp/tmp0qmjldiw.png
截图文件大小: 1757251 字节
截图成功
截图成功,耗时: 0.18秒,数据大小: 2343004 字符

the screenshot is successful, but if I want to analyze the image using torchvision, then it produced 32001 error

@Skywalker-Harrison
Copy link
Author

2025-03-03T15:51:11.722Z [screenparser] [error] Unexpected end of JSON input {"context":"connection","stack":"SyntaxError: Unexpected end of JSON input\n    at JSON.parse (<anonymous>)\n    at mPe (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:82:189)\n    at pPe.readMessage (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:82:115)\n    at yPe.processReadBuffer (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:83:1842)\n    at Socket.<anonymous> (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:83:1523)\n    at Socket.emit (node:events:518:28)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)"}
2025-03-03T15:51:12.444Z [screenparser] [error] Unexpected non-whitespace character after JSON at position 1 (line 1 column 2) {"context":"connection","stack":"SyntaxError: Unexpected non-whitespace character after JSON at position 1 (line 1 column 2)\n    at JSON.parse (<anonymous>)\n    at mPe (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:82:189)\n    at pPe.readMessage (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:82:115)\n    at yPe.processReadBuffer (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:83:1842)\n    at Socket.<anonymous> (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:83:1523)\n    at Socket.emit (node:events:518:28)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)"}
2025-03-03T15:51:12.444Z [screenparser] [error] Unexpected token 'S', "Speed: 9.0"... is not valid JSON {"context":"connection","stack":"SyntaxError: Unexpected token 'S', \"Speed: 9.0\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at mPe (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:82:189)\n    at pPe.readMessage (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:82:115)\n    at yPe.processReadBuffer (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:83:1842)\n    at Socket.<anonymous> (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:83:1523)\n    at Socket.emit (node:events:518:28)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)"}```
A more recent log, it seems that there's something wrong with the json format, but I didn't find the cause. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant