McpToolRegistrationService class
Discover MCP servers and list tools formatted for the Claude SDK. Use getMcpServers to fetch server configs and getTools to enumerate tools.
Methods
| add |
Registers MCP tool servers and updates agent options with discovered tools and server configs. Call this to enable dynamic Claude tool access. |
Method Details
addToolServersToAgent(Options, Authorization, string, TurnContext, string)
Registers MCP tool servers and updates agent options with discovered tools and server configs. Call this to enable dynamic Claude tool access.
function addToolServersToAgent(agentOptions: Options, authorization: Authorization, authHandlerName: string, turnContext: TurnContext, authToken: string): Promise<void>
Parameters
- agentOptions
-
Options
The Claude Agent options to which MCP servers will be added.
- authorization
- Authorization
Authorization object for token exchange.
- authHandlerName
-
string
The name of the auth handler to use for token exchange.
- turnContext
- TurnContext
The TurnContext of the current request.
- authToken
-
string
Optional bearer token for MCP server access.
Returns
Promise<void>