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

Set longer request times for Inspector client #142

Open
luiztauffer opened this issue Feb 6, 2025 · 8 comments
Open

Set longer request times for Inspector client #142

luiztauffer opened this issue Feb 6, 2025 · 8 comments
Labels
enhancement New feature or request

Comments

@luiztauffer
Copy link

luiztauffer commented Feb 6, 2025

Describe the bug
I get Error: Request timed out whenever I send requests to tools that take a little bit longer to process.

Image

To Reproduce
Just use any MCP tool that takes a longer time to finish, e.g.

from time import sleep
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("myserver", version="0.1.0", request_timeout=300)

@mcp.tool()
def return_string(query: str) -> str:
    sleep(10)
    return f"Query: {query}"

then run it with:

mcp dev main.py

Expected behavior
I would expect the client to wait for the response up to a limit, but I don't know how to set that limit in the Inspector.

@luiztauffer luiztauffer added the bug Something isn't working label Feb 6, 2025
@kwnath
Copy link

kwnath commented Feb 6, 2025

Not sure if this is a bug but the default request timeout is 10s (https://github.com/modelcontextprotocol/inspector/blob/master/client/src/lib/hooks/useConnection.ts#L23) which is why you're running into the error you've attached.

You've got a few options here:

  1. If you're running this locally I'd suggest just increasing the timeout to whatever you feel makes sense.
  2. The alternative is open a PR to increase the timeout but I think 10s is pretty sensible.

The former probably makes more sense for you 😄

@luiztauffer
Copy link
Author

hi @kwnath yeah I agree this is not a bug, the tag came automatically I don't know why
thank you for the suggestions! Yes I know I could just change that constant and run it from source, but I think it would be useful to have it as a configuration option directly in the UI, since many MCPs that do a bit heavier processing will certainly require a longer time.
If you think this is an useful feature I can leave this Issue open, if there's no interest in doing that modification I can close it

@jspahrsummers jspahrsummers added enhancement New feature or request and removed bug Something isn't working labels Feb 13, 2025
@jspahrsummers
Copy link
Member

Seems like a valid enhancement request, thanks! Will leave it open.

@Lakphy
Copy link

Lakphy commented Feb 15, 2025

I have the same problem, in my tool I may also make some llm calls, making the whole process take longer, which will make it difficult to debug if Inspector client limits the timeout to 10 seconds.

@liuzhuang-bud
Copy link

I have the same problem too, in my tool I may also make some llm calls,

@hp1998318
Copy link

我更改了超长时间后 本地调试 一直显示端口被占用了!

node:events:495 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE: address already in use :::3000 �[90m at Server.setupListenHandle [as _listen2] (node:net:1817:16)�[39m �[90m at listenInCluster (node:net:1865:12)�[39m �[90m at Server.listen (node:net:1953:7)�[39m at Function.listen (/Users/bytedance/code/inspector/node_modules/�[4mexpress�[24m/lib/application.js:635:24) at �[90mfile:///Users/bytedance/code/inspector/server/�[39mbuild/index.js:149:24 Emitted 'error' event on Server instance at: �[90m at emitErrorNT (node:net:1844:8)�[39m �[90m at process.processTicksAndRejections (node:internal/process/task_queues:82:21)�[39m { code: �[32m'EADDRINUSE'�[39m, errno: �[33m-48�[39m, syscall: �[32m'listen'�[39m, address: �[32m'::'�[39m, port: �[33m3000�[39m } Node.js v18.20.3

@Lurrobert
Copy link

Lurrobert commented Mar 6, 2025

10 seconds is definitely a bug. Please fix. it is literally 1 prompt away

@olaservo
Copy link
Collaborator

olaservo commented Mar 6, 2025

This PR from @TornjV restored a way to override the timeout using a query string parameter: #164

I'm going to keep this issue open since I think we should still have a UI option for usability's sake, but hopefully this option will be easier than having to change the app code to override the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants