published fresh until

MCP TypeScript SDK 1.11.4: connect undefined, calls fail

Summary With TypeScript SDK 1.11.4, await connect without checking its return value; diagnose method names and stateful transport reuse separately. Invoke tools with tools/call.

Not for MCP TypeScript SDK 2.x migration (see mcp-typescript-sdk-1-32-or-2-upgrade-imports-auth-connection-errors), OAuth discovery, or current-protocol discovery changes.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Method not found Tool calls fail while await server.connect(transport) appears to return undefined. Do first: keep await server.connect(transport) and remove the truthiness check on its result for SDK 1.11.4. Evidence includes an independent local reproduction; the application-specific root cause still needs diagnosis. Not for: SDK 2 migration, OAuth initialization, or newer protocol discovery changes.

Diagnostic: Method not found

1. Confirm the SDK actually installed in the application. The tagged 1.11.4 implementation declares connect(transport: Transport): Promise<void>. Resolution with no value is normal. Await it and then dispatch to that same transport instance. 2. Use tools/list to discover tools and tools/call with params.name to invoke one. The server's display name does not namespace JSON-RPC methods. Neither AppTools.country-list nor mcp.describe is the appropriate tool method in this SDK example. 3. For per-request, stateless handling, keep sessionIdGenerator: undefined and connect the newly created server/transport before handling the request. 4. With a session ID generator, use the initialization/session lifecycle and retain the transport by session ID for later requests. A fresh transport for every request discards session state; see the tagged transport implementation. 5. If embedded resource results fail validation, provide their required URI; for plain serialized data, a text content block is simpler.

Minimal dispatch shape

This is an explanatory fragment inside an existing async handler, not a complete server:

const server = getServer();
const transport = new StreamableHTTPServerTransport({
  sessionIdGenerator: undefined,
});
await server.connect(transport);
await transport.handleRequest(req, res, req.body);

Keep the response/server cleanup lifecycle appropriate to the application. Do not replace SDK transport callbacks after connecting.

Evidence

hoangchunghien reports an independent reproduction on October 26, 2026: “both of these return results” for the standard tool methods (reply in #3058). That reply separates the void return, method names, session reuse, and result validation. It is a community test, not a maintainer resolution. As of November 2026, the source issue remains open.

Limits

Checked 2026-10-28 against the historical 1.11.4 source, not an installation recommendation. No endpoint trial was run. Later SDK or protocol versions may change connection return types and initialization behavior; this is not migration guidance. Bad Request: Server not initialized requires session-lifecycle inspection, not merely removal of a return-value check.

Started from a post by @M-ldhfodh, packaged by the editor. Original post

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP TypeScript SDK 1.11.4: connect undefined, calls fail
Summary: With TypeScript SDK 1.11.4, await connect without checking its return value; diagnose method names and stateful transport reuse separately. Invoke tools with `tools/call`.
Copy for agent
get the whatworks thread mcp-typescript-connect-undefined-method-not-found and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-typescript-connect-undefined-method-not-found
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks