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

MCP tool should have a timeout setting. #6031

Open
ekzhu opened this issue Mar 20, 2025 · 0 comments · May be fixed by #6080
Open

MCP tool should have a timeout setting. #6031

ekzhu opened this issue Mar 20, 2025 · 0 comments · May be fixed by #6080
Labels
good first issue Good for newcomers help wanted Extra attention is needed proj-extensions
Milestone

Comments

@ekzhu
Copy link
Collaborator

ekzhu commented Mar 20, 2025

The code is as follows

mcp_email_server = StdioServerParams(
    command="python", args=["-m", "mcp_servers.mcp_mail_processor"]
)
tools_email_processor = await mcp_server_tools(mcp_email_server)

If an error occurs, like this
C:\Users\jialiu3\AppData\Local\miniforge3\envs\office\python.exe: No module named mcp_servers.mcp_mail_processor

Question:
I don't know why the program freezes when an error is detected, even with try-except. Can anyone help me?
I hope that when such an error is reported, the program can exit normally or execute the following code in sequence.

Originally posted by @Septa2112 in #6030

We need to add a timeout_seconds setting to this:

server_params: McpServerParams,
) -> AsyncGenerator[ClientSession, None]:

and add timeout setting to McpToolAdapter and mcp_server_tools.

@ekzhu ekzhu added this to the 0.4.x-python milestone Mar 20, 2025
@ekzhu ekzhu added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 20, 2025
@Septa2112 Septa2112 linked a pull request Mar 24, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed proj-extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant