Skip to content

MCP timeout #2296

Closed
Closed

Description

@Zyles

What happened?

MCP timeout is not working.

I set it to 30 minutes and it times out in like 1 minute.

Config says:

"timeout": 1800

Image

Steps to reproduce

  1. Increase timeout to 30 mins
  2. Wait
  3. Timeout

Relevant API REQUEST output

Operating System

Windows

Cline Version

3.7.0

Additional context

No response

Activity

  1. canvrno commented on Mar 18, 2025

    @canvrno
    Contributor

    @Zyles what MCP server were you using when this occurred?

  2. Zyles commented on Mar 18, 2025

    @Zyles
    Author

    I made my own with the Typescript MCP SDK.

    Because I'm running indexing as the docker container starts it times out.

    It seems like if the client does not get an immediate connection it will timeout. So I assume the timeout value is only respected once it is connected?

  3. celestial-vault commented on Mar 18, 2025

    @celestial-vault
    Contributor

    @Zyles Maybe. On Cline's side the timeout value is passed per the MCP SDK's expectations. Anything beyond that is on the side of either the SDK or the individual MCP server to implement.

    I would suggest running this test with the sleep mcp available in the marketplace (or any other existing MCP server) and see if you get the same problem.

  4. celestial-vault commented on Mar 18, 2025

    @celestial-vault
    Contributor

    If you can come up with steps to reproduce on a publicly available MCP, not one that you've privately built, then we can take a look into it.

  5. Zyles commented on Mar 20, 2025

    @Zyles
    Author

    Here is an example:

    #!/usr/bin/env node
    
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
    import { z } from "zod";
    import { promises as fs } from 'fs';
    
    // Create an MCP server
    const server = new McpServer({
      name: "MCP Server",
      version: "1.0.0"
    });
    
    // Add an addition tool
    server.tool("add",
      { a: z.number(), b: z.number() },
      async ({ a, b }) => ({
        content: [{ type: "text", text: String(a + b) }]
      })
    );
    
    // Start server, doesn't work:
    async function runServer() {
      const transport = new StdioServerTransport();
      await new Promise(f => setTimeout(f, 30000));
      await server.connect(transport);
      console.log("MCP Server running on stdio");
    }
    
    // Start server, works but MCP is not ready
    async function runServer() {
      const transport = new StdioServerTransport();
      await server.connect(transport);
      await new Promise(f => setTimeout(f, 30000));
      console.log("MCP Server running on stdio");
    }
    
    runServer().catch((error) => {
      console.error("Fatal error running server:", error);
      process.exit(1);
    });
    
    
  6. celestial-vault commented on Mar 20, 2025

    @celestial-vault
    Contributor

    @Zyles Can you verify that this timeout setting does not work with existing MCP servers on the marketplace?

  7. Zyles commented on Mar 21, 2025

    @Zyles
    Author

    @Zyles Can you verify that this timeout setting does not work with existing MCP servers on the marketplace?

    Like which one?

  8. celestial-vault commented on Jun 23, 2025

    @celestial-vault
    Contributor

    Thanks for reporting this timeout issue! This has been consolidated into the comprehensive MCP system issues tracking issue #4391. The MCP timeout configuration problems you identified are now part of the broader MCP server startup and runtime improvements being tracked there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions