Skip to content

Client#listPrompts results in MCP error -32601: Method not found #929

Closed

Description

@LandonSchropp

Describe the bug

I've created an MCPServer instance connected to a Client via an InMemoryTransport. If the server has not has registerPrompt called on it, the client raises an error when calling listPrompts().

To Reproduce

Steps to reproduce the behavior:

  1. Make sure you're using the latest version of Bun. I don't know if this reproduces in other runtimes—I've only tested it in Bun.

  2. Install @modelcontextprotocol/sdk via bun add @modelcontextprotocol/sdk.

  3. Create a file named example.ts with the following content:

    import { Client } from "@modelcontextprotocol/sdk/client/index.js";
    import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    
    const server = new McpServer({
      name: "example",
      version: "0.0.0",
    });
    
    // Don't register any prompts
    
    const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
    
    const client = new Client({
      name: "example",
      version: "0.0.0",
    });
    
    await Promise.all([server.connect(serverTransport), client.connect(clientTransport)]);
    
    console.log(await client.listPrompts());
  4. Run the file using Bun: bun run example.ts.

Expected behavior

The script should output []

Actual behavior

The script produces this error:

1300 |     CallToolResultSchema,
1301 |     ListToolsResultSchema,
1302 | ]);
1303 | export class McpError extends Error {
1304 |     constructor(code, message, data) {
1305 |         super(`MCP error ${code}: ${message}`);
               ^
McpError: MCP error -32601: Method not found
 code: -32601,
 data: undefined,

      at new McpError (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js:1305:9)
      at _onresponse (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:223:27)
      at <anonymous> (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:84:22)
      at send (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js:42:34)
      at send (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js:37:16)
      at _onrequest (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:133:101)
      at <anonymous> (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:87:22)
      at send (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js:42:34)
      at send (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js:37:16)
      at <anonymous> (/Users/landon/Development/mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:308:29)

Bun v1.2.21 (macOS arm64)

Activity

  1. Rajesh-Narayanappa87 commented on Sep 9, 2025

    @Rajesh-Narayanappa87

    Also I have seen statuscode for such failures is 200. This is incorrect.

  2. added
    ready for workEnough information for someone to start working on
    P3Nice to haves, rare edge cases
    on Sep 29, 2025
  3. felixweinberger commented on Sep 29, 2025

    @felixweinberger
    Contributor

    Hi @LandonSchropp thanks for reporting this and providing a comprehensive repro

  4. alantriesagain commented on Sep 30, 2025

    @alantriesagain

    @LandonSchropp I opened a PR (#986) that fixes this issue, would be great if you could test!

  5. LandonSchropp commented on Oct 1, 2025

    @LandonSchropp
    Author

    @meiraleal Your change worked for me! Thank you. 🙏

  6. added
    good first issueGood for newcomers - can be tackled without deep knowledge of the codebase
    and removed on Nov 12, 2025
  7. removed
    good first issueGood for newcomers - can be tackled without deep knowledge of the codebase
    on Dec 18, 2025
  8. ghost added
    fix proposedBot has a verified fix diff in the comment
    on Apr 17, 2026
  9. ghost added
    potentially closeBot recommends closing — needs maintainer review
    on Apr 17, 2026
  10. felixweinberger commented on Oct 5, 2026

    @felixweinberger
    Contributor

    On v2 the client returns an empty list when the server has no prompts, resources or tools (#1386, in 2.0.0). On v1, declaring the capability in the McpServer options gives an empty list from the next patch release (#2958). Closing.

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

    P3Nice to haves, rare edge casesbugSomething isn't workingfix proposedBot has a verified fix diff in the commentpotentially closeBot recommends closing — needs maintainer reviewready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions