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 · 2 comments
Open

Set longer request times for Inspector client #142

luiztauffer opened this issue Feb 6, 2025 · 2 comments
Labels
bug Something isn't working

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

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

2 participants