[DOCS] Undefined McpServer Type in TypeScript SDK McpSdkServerConfigWithInstance Definition
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:
CallToolResultis documented as "MCP tool result type (from@modelcontextprotocol/sdk/types.js)"APIAssistantMessagehas comment "// From Anthropic SDK"RawMessageStreamEventhas comment "// From Anthropic SDK"
However, McpServer has no such annotation, leaving developers unsure:
- Which package provides this type
- How to import it correctly
- 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/sdkgiven the MCP context - The
createSdkMcpServer()function that returns this type is documented at line 68, but also doesn't clarify theMcpServerorigin - Related: The MCP documentation at
code.claude.com/docs/en/mcp.mdmight benefit from cross-referencing
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗