MCPServerStdio
Public interface of an MCP server that provides tools. You can use this class to pass MCP server settings to your agent.
Extends
Section titled “Extends”BaseMCPServerStdio
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MCPServerStdio(options): MCPServerStdio;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”MCPServerStdio
Overrides
Section titled “Overrides”BaseMCPServerStdio.constructor
Properties
Section titled “Properties”cacheToolsList
Section titled “cacheToolsList”cacheToolsList: boolean;Implementation of
Section titled “Implementation of”MCPServerWithResources.cacheToolsList
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.cacheToolsList
customDataExtractor?
Section titled “customDataExtractor?”customDataExtractor?: MCPToolCustomDataExtractor;Implementation of
Section titled “Implementation of”MCPServerWithResources.customDataExtractor
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.customDataExtractor
errorFunction?
Section titled “errorFunction?”errorFunction?: | MCPToolErrorFunction | null;Optional function to convert MCP tool failures into model-visible messages. Set to null to rethrow errors instead of converting them.
Implementation of
Section titled “Implementation of”MCPServerWithResources.errorFunction
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.errorFunction
toolFilter?
Section titled “toolFilter?”toolFilter?: | MCPToolFilterStatic | MCPToolFilterCallable;Implementation of
Section titled “Implementation of”MCPServerWithResources.toolFilter
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.toolFilter
toolInputGuardrails?
Section titled “toolInputGuardrails?”toolInputGuardrails?: ToolInputGuardrailDefinition<any>[];Guardrails applied before every tool on this server is invoked.
Implementation of
Section titled “Implementation of”MCPServerWithResources.toolInputGuardrails
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.toolInputGuardrails
toolMetaResolver?
Section titled “toolMetaResolver?”toolMetaResolver?: MCPToolMetaResolver;Implementation of
Section titled “Implementation of”MCPServerWithResources.toolMetaResolver
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.toolMetaResolver
toolOutputGuardrails?
Section titled “toolOutputGuardrails?”toolOutputGuardrails?: ToolOutputGuardrailDefinition<any>[];Guardrails applied after every tool on this server returns.
Implementation of
Section titled “Implementation of”MCPServerWithResources.toolOutputGuardrails
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.toolOutputGuardrails
useStructuredContent?
Section titled “useStructuredContent?”useStructuredContent?: boolean;Whether to use MCP structuredContent as the model-visible tool output when available.
Defaults to false to preserve the existing content-based output behavior.
Implementation of
Section titled “Implementation of”MCPServerWithResources.useStructuredContent
Inherited from
Section titled “Inherited from”BaseMCPServerStdio.useStructuredContent
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get name(): string;Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”BaseMCPServerStdio.name
Methods
Section titled “Methods”callTool()
Section titled “callTool()”callTool( toolName, args, meta?, options?): Promise<CallToolResultContent>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<CallToolResultContent>
Implementation of
Section titled “Implementation of”MCPServerWithResources.callTool
Overrides
Section titled “Overrides”BaseMCPServerStdio.callTool
callToolResult()
Section titled “callToolResult()”callToolResult( toolName, args, meta?, options?): Promise<{ _meta?: Record<string, unknown>; content: object[]; isError?: boolean; structuredContent?: Record<string, unknown>;}>;Invoke a tool and return the full serializable MCP result.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<{
_meta?: Record<string, unknown>;
content: object[];
isError?: boolean;
structuredContent?: Record<string, unknown>;
}>
Implementation of
Section titled “Implementation of”MCPServerWithResources.callToolResult
Overrides
Section titled “Overrides”BaseMCPServerStdio.callToolResult
close()
Section titled “close()”close(): Promise<void>;Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”BaseMCPServerStdio.close
connect()
Section titled “connect()”connect(): Promise<void>;Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”MCPServerWithResources.connect
Overrides
Section titled “Overrides”BaseMCPServerStdio.connect
invalidateToolsCache()
Section titled “invalidateToolsCache()”invalidateToolsCache(): Promise<void>;Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”MCPServerWithResources.invalidateToolsCache
Overrides
Section titled “Overrides”BaseMCPServerStdio.invalidateToolsCache
listResources()
Section titled “listResources()”listResources(params?): Promise<MCPListResourcesResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<MCPListResourcesResult>
Implementation of
Section titled “Implementation of”MCPServerWithResources.listResources
Overrides
Section titled “Overrides”BaseMCPServerStdio.listResources
listResourceTemplates()
Section titled “listResourceTemplates()”listResourceTemplates(params?): Promise<MCPListResourceTemplatesResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<MCPListResourceTemplatesResult>
Implementation of
Section titled “Implementation of”MCPServerWithResources.listResourceTemplates
Overrides
Section titled “Overrides”BaseMCPServerStdio.listResourceTemplates
listTools()
Section titled “listTools()”listTools(): Promise<object[]>;Returns
Section titled “Returns”Promise<object[]>
Implementation of
Section titled “Implementation of”MCPServerWithResources.listTools
Overrides
Section titled “Overrides”BaseMCPServerStdio.listTools
readResource()
Section titled “readResource()”readResource(uri): Promise<MCPReadResourceResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<MCPReadResourceResult>
Implementation of
Section titled “Implementation of”MCPServerWithResources.readResource
Overrides
Section titled “Overrides”BaseMCPServerStdio.readResource