[DOCS] Undefined McpServer Type in TypeScript SDK McpSdkServerConfigWithInstance Definition

Resolved 💬 2 comments Opened Jan 24, 2026 by coygeek Closed Feb 28, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://platform.claude.com/docs/en/agent-sdk/typescript

Section/Topic

The type definitions section, specifically the McpSdkServerConfigWithInstance type (lines 366-374).

Current Documentation

type McpSdkServerConfigWithInstance = {
  type: 'sdk';
  name: string;
  instance: McpServer;
}

What's Wrong or Missing?

The instance field references McpServer type, but McpServer is never defined, imported, or documented anywhere in the file.

The documentation follows a consistent pattern of noting external types:

  • CallToolResult is documented as "MCP tool result type (from @modelcontextprotocol/sdk/types.js)"
  • APIAssistantMessage has comment "// From Anthropic SDK"
  • RawMessageStreamEvent has comment "// From Anthropic SDK"

However, McpServer has no such annotation, leaving developers unsure:

  1. Which package provides this type
  2. How to import it correctly
  3. What interface it implements

Suggested Improvement

Add the source annotation for McpServer:

type McpSdkServerConfigWithInstance = {
  type: 'sdk';
  name: string;
  instance: McpServer;  // From @modelcontextprotocol/sdk
}

Or provide a complete import example:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

// Or if from the Anthropic SDK:
import type { McpServer } from "@anthropic-ai/claude-agent-sdk";

Additionally, consider adding a brief description of what McpServer represents (e.g., "An initialized MCP server instance that handles tool requests").

Impact

Medium - Makes feature difficult to understand

Additional Context

  • Mirror location: platform.claude.com/docs/en/agent-sdk/typescript.md (lines 366-374)
  • The type is likely from @modelcontextprotocol/sdk given the MCP context
  • The createSdkMcpServer() function that returns this type is documented at line 68, but also doesn't clarify the McpServer origin
  • Related: The MCP documentation at code.claude.com/docs/en/mcp.md might benefit from cross-referencing

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗