@elizaos/plugin-mcp 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/dynamic-tool-actions.d.ts +16 -0
- package/dist/actions/dynamic-tool-actions.d.ts.map +1 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/schema-cache.d.ts +34 -0
- package/dist/cache/schema-cache.d.ts.map +1 -0
- package/dist/cjs/index.cjs +1161 -1646
- package/dist/cjs/index.js.map +23 -24
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1166 -1667
- package/dist/index.js.map +23 -24
- package/dist/provider.d.ts.map +1 -1
- package/dist/service.d.ts +23 -21
- package/dist/service.d.ts.map +1 -1
- package/dist/tool-compatibility/base.d.ts +25 -0
- package/dist/tool-compatibility/base.d.ts.map +1 -0
- package/dist/tool-compatibility/index.d.ts +7 -52
- package/dist/tool-compatibility/index.d.ts.map +1 -1
- package/dist/tool-compatibility/providers/anthropic.d.ts +2 -3
- package/dist/tool-compatibility/providers/anthropic.d.ts.map +1 -1
- package/dist/tool-compatibility/providers/google.d.ts +2 -3
- package/dist/tool-compatibility/providers/google.d.ts.map +1 -1
- package/dist/tool-compatibility/providers/openai.d.ts +2 -3
- package/dist/tool-compatibility/providers/openai.d.ts.map +1 -1
- package/dist/types.d.ts +53 -88
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/action-naming.d.ts +9 -0
- package/dist/utils/action-naming.d.ts.map +1 -0
- package/dist/utils/error.d.ts +1 -11
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/processing.d.ts +5 -11
- package/dist/utils/processing.d.ts.map +1 -1
- package/dist/utils/schema-converter.d.ts +9 -0
- package/dist/utils/schema-converter.d.ts.map +1 -0
- package/dist/utils/validation.d.ts +1 -24
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/wrapper.d.ts +6 -15
- package/dist/utils/wrapper.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/actions/callToolAction.d.ts +0 -3
- package/dist/actions/callToolAction.d.ts.map +0 -1
- package/dist/templates/feedbackTemplate.d.ts +0 -2
- package/dist/templates/feedbackTemplate.d.ts.map +0 -1
- package/dist/templates/toolReasoningTemplate.d.ts +0 -2
- package/dist/templates/toolReasoningTemplate.d.ts.map +0 -1
- package/dist/templates/toolSelectionTemplate.d.ts +0 -3
- package/dist/templates/toolSelectionTemplate.d.ts.map +0 -1
- package/dist/utils/handler.d.ts +0 -3
- package/dist/utils/handler.d.ts.map +0 -1
- package/dist/utils/schemas.d.ts +0 -69
- package/dist/utils/schemas.d.ts.map +0 -1
- package/dist/utils/selection.d.ts +0 -38
- package/dist/utils/selection.d.ts.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
3
|
+
"sources": ["../src/index.ts", "../src/actions/readResourceAction.ts", "../src/templates/resourceSelectionTemplate.ts", "../src/types.ts", "../src/utils/error.ts", "../src/templates/errorAnalysisPrompt.ts", "../src/utils/processing.ts", "../src/templates/resourceAnalysisTemplate.ts", "../src/utils/mcp.ts", "../src/utils/json.ts", "../src/utils/validation.ts", "../src/utils/wrapper.ts", "../src/provider.ts", "../src/service.ts", "../src/actions/dynamic-tool-actions.ts", "../src/utils/schema-converter.ts", "../src/utils/action-naming.ts", "../src/cache/schema-cache.ts", "../src/tool-compatibility/base.ts", "../src/tool-compatibility/providers/openai.ts", "../src/tool-compatibility/providers/anthropic.ts", "../src/tool-compatibility/providers/google.ts", "../src/tool-compatibility/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import {
|
|
6
|
-
"import {
|
|
7
|
-
"
|
|
8
|
-
"import type { JSONSchema7 } from 'json-schema';\n\n// Constraint types for embedding in descriptions\nexport interface StringConstraints {\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n format?: string;\n enum?: string[];\n}\n\nexport interface NumberConstraints {\n minimum?: number;\n maximum?: number;\n exclusiveMinimum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n}\n\nexport interface ArrayConstraints {\n minItems?: number;\n maxItems?: number;\n uniqueItems?: boolean;\n}\n\nexport interface ObjectConstraints {\n minProperties?: number;\n maxProperties?: number;\n additionalProperties?: boolean;\n}\n\nexport type SchemaConstraints = StringConstraints | NumberConstraints | ArrayConstraints | ObjectConstraints;\n\n// Model provider detection\nexport type ModelProvider = 'openai' | 'anthropic' | 'google' | 'openrouter' | 'unknown';\n\nexport interface ModelInfo {\n provider: ModelProvider;\n modelId: string;\n supportsStructuredOutputs?: boolean;\n isReasoningModel?: boolean;\n}\n\n// Abstract base class for tool compatibility\nexport abstract class McpToolCompatibility {\n protected modelInfo: ModelInfo;\n\n constructor(modelInfo: ModelInfo) {\n this.modelInfo = modelInfo;\n }\n\n // Determine if this compatibility layer should be applied\n abstract shouldApply(): boolean;\n\n // Transform a complete tool schema\n public transformToolSchema(toolSchema: JSONSchema7): JSONSchema7 {\n if (!this.shouldApply()) {\n return toolSchema;\n }\n\n return this.processSchema(toolSchema);\n }\n\n // Process any JSON schema recursively\n protected processSchema(schema: JSONSchema7): JSONSchema7 {\n const processed = { ...schema };\n\n // Handle different schema types\n switch (processed.type) {\n case 'string':\n return this.processStringSchema(processed);\n case 'number':\n case 'integer':\n return this.processNumberSchema(processed);\n case 'array':\n return this.processArraySchema(processed);\n case 'object':\n return this.processObjectSchema(processed);\n default:\n return this.processGenericSchema(processed);\n }\n }\n\n // String schema processing\n protected processStringSchema(schema: JSONSchema7): JSONSchema7 {\n const constraints: StringConstraints = {};\n const processed = { ...schema };\n\n // Extract constraints that might not be supported\n if (typeof schema.minLength === 'number') {\n constraints.minLength = schema.minLength;\n }\n if (typeof schema.maxLength === 'number') {\n constraints.maxLength = schema.maxLength;\n }\n if (typeof schema.pattern === 'string') {\n constraints.pattern = schema.pattern;\n }\n if (typeof schema.format === 'string') {\n constraints.format = schema.format;\n }\n if (Array.isArray(schema.enum)) {\n constraints.enum = schema.enum as string[];\n }\n\n // Remove unsupported properties and embed in description\n const unsupportedProps = this.getUnsupportedStringProperties();\n for (const prop of unsupportedProps) {\n if (prop in processed) {\n delete (processed as any)[prop];\n }\n }\n\n // Embed constraints in description if any were found\n if (Object.keys(constraints).length > 0) {\n processed.description = this.mergeDescription(schema.description, constraints);\n }\n\n return processed;\n }\n\n // Number schema processing\n protected processNumberSchema(schema: JSONSchema7): JSONSchema7 {\n const constraints: NumberConstraints = {};\n const processed = { ...schema };\n\n // Extract numerical constraints\n if (typeof schema.minimum === 'number') {\n constraints.minimum = schema.minimum;\n }\n if (typeof schema.maximum === 'number') {\n constraints.maximum = schema.maximum;\n }\n if (typeof schema.exclusiveMinimum === 'number') {\n constraints.exclusiveMinimum = schema.exclusiveMinimum;\n }\n if (typeof schema.exclusiveMaximum === 'number') {\n constraints.exclusiveMaximum = schema.exclusiveMaximum;\n }\n if (typeof schema.multipleOf === 'number') {\n constraints.multipleOf = schema.multipleOf;\n }\n\n // Remove unsupported properties\n const unsupportedProps = this.getUnsupportedNumberProperties();\n for (const prop of unsupportedProps) {\n if (prop in processed) {\n delete (processed as any)[prop];\n }\n }\n\n // Embed constraints in description\n if (Object.keys(constraints).length > 0) {\n processed.description = this.mergeDescription(schema.description, constraints);\n }\n\n return processed;\n }\n\n // Array schema processing\n protected processArraySchema(schema: JSONSchema7): JSONSchema7 {\n const constraints: ArrayConstraints = {};\n const processed = { ...schema };\n\n // Extract array constraints\n if (typeof schema.minItems === 'number') {\n constraints.minItems = schema.minItems;\n }\n if (typeof schema.maxItems === 'number') {\n constraints.maxItems = schema.maxItems;\n }\n if (typeof schema.uniqueItems === 'boolean') {\n constraints.uniqueItems = schema.uniqueItems;\n }\n\n // Process items schema recursively\n if (schema.items && typeof schema.items === 'object' && !Array.isArray(schema.items)) {\n processed.items = this.processSchema(schema.items as JSONSchema7);\n }\n\n // Remove unsupported properties\n const unsupportedProps = this.getUnsupportedArrayProperties();\n for (const prop of unsupportedProps) {\n if (prop in processed) {\n delete (processed as any)[prop];\n }\n }\n\n // Embed constraints in description\n if (Object.keys(constraints).length > 0) {\n processed.description = this.mergeDescription(schema.description, constraints);\n }\n\n return processed;\n }\n\n // Object schema processing\n protected processObjectSchema(schema: JSONSchema7): JSONSchema7 {\n const constraints: ObjectConstraints = {};\n const processed = { ...schema };\n\n // Extract object constraints\n if (typeof schema.minProperties === 'number') {\n constraints.minProperties = schema.minProperties;\n }\n if (typeof schema.maxProperties === 'number') {\n constraints.maxProperties = schema.maxProperties;\n }\n if (typeof schema.additionalProperties === 'boolean') {\n constraints.additionalProperties = schema.additionalProperties;\n }\n\n // Process properties recursively\n if (schema.properties && typeof schema.properties === 'object') {\n processed.properties = {};\n for (const [key, prop] of Object.entries(schema.properties)) {\n if (typeof prop === 'object' && !Array.isArray(prop)) {\n processed.properties[key] = this.processSchema(prop as JSONSchema7);\n } else {\n processed.properties[key] = prop;\n }\n }\n }\n\n // Remove unsupported properties\n const unsupportedProps = this.getUnsupportedObjectProperties();\n for (const prop of unsupportedProps) {\n if (prop in processed) {\n delete (processed as any)[prop];\n }\n }\n\n // Embed constraints in description\n if (Object.keys(constraints).length > 0) {\n processed.description = this.mergeDescription(schema.description, constraints);\n }\n\n return processed;\n }\n\n // Generic schema processing (for union types, etc.)\n protected processGenericSchema(schema: JSONSchema7): JSONSchema7 {\n const processed = { ...schema };\n\n // Handle oneOf, anyOf, allOf recursively\n if (Array.isArray(schema.oneOf)) {\n processed.oneOf = schema.oneOf.map(s => typeof s === 'object' ? this.processSchema(s as JSONSchema7) : s);\n }\n if (Array.isArray(schema.anyOf)) {\n processed.anyOf = schema.anyOf.map(s => typeof s === 'object' ? this.processSchema(s as JSONSchema7) : s);\n }\n if (Array.isArray(schema.allOf)) {\n processed.allOf = schema.allOf.map(s => typeof s === 'object' ? this.processSchema(s as JSONSchema7) : s);\n }\n\n return processed;\n }\n\n // Merge constraints into description\n protected mergeDescription(originalDescription: string | undefined, constraints: SchemaConstraints): string {\n const constraintJson = JSON.stringify(constraints);\n if (originalDescription) {\n return `${originalDescription}\\n${constraintJson}`;\n }\n return constraintJson;\n }\n\n // Abstract methods that subclasses must implement\n protected abstract getUnsupportedStringProperties(): string[];\n protected abstract getUnsupportedNumberProperties(): string[];\n protected abstract getUnsupportedArrayProperties(): string[];\n protected abstract getUnsupportedObjectProperties(): string[];\n}\n\n// Model detection utilities\nexport function detectModelProvider(runtime: any): ModelInfo {\n // Try to extract model info from ElizaOS runtime\n const modelString = runtime?.modelProvider || runtime?.model || '';\n const modelId = String(modelString).toLowerCase();\n\n let provider: ModelProvider = 'unknown';\n let supportsStructuredOutputs = false;\n let isReasoningModel = false;\n\n // Detect provider based on model string\n if (modelId.includes('openai') || modelId.includes('gpt-') || modelId.includes('o1-') || modelId.includes('o3-')) {\n provider = 'openai';\n supportsStructuredOutputs = modelId.includes('gpt-4') || modelId.includes('o1') || modelId.includes('o3');\n isReasoningModel = modelId.includes('o1') || modelId.includes('o3');\n } else if (modelId.includes('anthropic') || modelId.includes('claude')) {\n provider = 'anthropic';\n supportsStructuredOutputs = true;\n } else if (modelId.includes('google') || modelId.includes('gemini')) {\n provider = 'google';\n supportsStructuredOutputs = true;\n } else if (modelId.includes('openrouter')) {\n provider = 'openrouter';\n // OpenRouter depends on the underlying model\n supportsStructuredOutputs = false;\n }\n\n return {\n provider,\n modelId,\n supportsStructuredOutputs,\n isReasoningModel,\n };\n}\n\n// Factory function to get the appropriate compatibility layer\nexport async function createMcpToolCompatibility(runtime: any): Promise<McpToolCompatibility | null> {\n const modelInfo = detectModelProvider(runtime);\n \n // Import and instantiate the appropriate compatibility layer\n try {\n switch (modelInfo.provider) {\n case 'openai':\n // Use dynamic ES module imports\n const { OpenAIMcpCompatibility } = await import('./providers/openai.js');\n return new OpenAIMcpCompatibility(modelInfo);\n case 'anthropic':\n const { AnthropicMcpCompatibility } = await import('./providers/anthropic.js');\n return new AnthropicMcpCompatibility(modelInfo);\n case 'google':\n const { GoogleMcpCompatibility } = await import('./providers/google.js');\n return new GoogleMcpCompatibility(modelInfo);\n default:\n return null; // No compatibility layer needed\n }\n } catch (error) {\n console.warn('Failed to load compatibility provider:', error);\n return null;\n }\n}\n\n// Synchronous version for environments that need it (like service.ts)\nexport function createMcpToolCompatibilitySync(runtime: any): McpToolCompatibility | null {\n const modelInfo = detectModelProvider(runtime);\n \n // Use synchronous requires for CommonJS environments\n try {\n switch (modelInfo.provider) {\n case 'openai':\n // Use eval to avoid bundlers trying to process this\n const OpenAIModule = eval('require')('./providers/openai');\n const { OpenAIMcpCompatibility } = OpenAIModule;\n return new OpenAIMcpCompatibility(modelInfo);\n case 'anthropic':\n const AnthropicModule = eval('require')('./providers/anthropic');\n const { AnthropicMcpCompatibility } = AnthropicModule;\n return new AnthropicMcpCompatibility(modelInfo);\n case 'google':\n const GoogleModule = eval('require')('./providers/google');\n const { GoogleMcpCompatibility } = GoogleModule;\n return new GoogleMcpCompatibility(modelInfo);\n default:\n return null; // No compatibility layer needed\n }\n } catch (error) {\n console.warn('Failed to load compatibility provider:', error);\n return null;\n }\n} ",
|
|
9
|
-
"import { type IAgentRuntime
|
|
10
|
-
"import {\n type Action,\n type ActionResult,\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n type State,\n logger,\n} from \"@elizaos/core\";\nimport type { McpService } from \"../service\";\nimport { MCP_SERVICE_NAME, type McpServer } from \"../types\";\nimport { handleMcpError } from \"../utils/error\";\nimport { handleNoToolAvailable } from \"../utils/handler\";\nimport { handleToolResponse, processToolResult } from \"../utils/processing\";\nimport { createToolSelectionArgument, createToolSelectionName } from \"../utils/selection\";\n\nexport const callToolAction: Action = {\n name: \"CALL_MCP_TOOL\",\n similes: [\n \"CALL_TOOL\",\n \"CALL_MCP_TOOL\",\n \"USE_TOOL\",\n \"USE_MCP_TOOL\",\n \"EXECUTE_TOOL\",\n \"EXECUTE_MCP_TOOL\",\n \"RUN_TOOL\",\n \"RUN_MCP_TOOL\",\n \"INVOKE_TOOL\",\n \"INVOKE_MCP_TOOL\",\n ],\n description: \"Calls a tool from an MCP server to perform a specific task\",\n\n validate: async (runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> => {\n const mcpService = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!mcpService) return false;\n\n const servers = mcpService.getServers();\n return (\n servers.length > 0 &&\n servers.some(\n (server: McpServer) =>\n server.status === \"connected\" && server.tools && server.tools.length > 0\n )\n );\n },\n\n handler: async (\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: { [key: string]: unknown },\n callback?: HandlerCallback\n ): Promise<ActionResult> => {\n const composedState = await runtime.composeState(message, [\"RECENT_MESSAGES\", \"MCP\"]);\n const mcpService = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!mcpService) {\n throw new Error(\"MCP service not available\");\n }\n const mcpProvider = mcpService.getProviderData();\n\n try {\n // Select the tool with this servername and toolname\n const toolSelectionName = await createToolSelectionName({\n runtime,\n state: composedState,\n message,\n callback,\n mcpProvider,\n });\n if (!toolSelectionName || toolSelectionName.noToolAvailable) {\n logger.warn(\"[NO_TOOL_AVAILABLE] No appropriate tool available for the request\");\n return await handleNoToolAvailable(callback, toolSelectionName);\n }\n const { serverName, toolName, reasoning } = toolSelectionName;\n logger.info(\n `[CALLING] Calling tool \"${serverName}/${toolName}\" on server with reasoning: \"${reasoning}\"`\n );\n\n // Create the tool selection \"argument\" based on the selected tool name\n const toolSelectionArgument = await createToolSelectionArgument({\n runtime,\n state: composedState,\n message,\n callback,\n mcpProvider,\n toolSelectionName,\n });\n if (!toolSelectionArgument) {\n logger.warn(\n \"[NO_TOOL_SELECTION_ARGUMENT] No appropriate tool selection argument available\"\n );\n return await handleNoToolAvailable(callback, toolSelectionName);\n }\n logger.info(\n `[SELECTED] Tool Selection result:\\n${JSON.stringify(toolSelectionArgument, null, 2)}`\n );\n\n const result = await mcpService.callTool(\n serverName,\n toolName,\n toolSelectionArgument.toolArguments\n );\n\n const { toolOutput, hasAttachments, attachments } = processToolResult(\n result,\n serverName,\n toolName,\n runtime,\n message.entityId\n );\n\n const replyMemory = await handleToolResponse(\n runtime,\n message,\n serverName,\n toolName,\n toolSelectionArgument.toolArguments,\n toolOutput,\n hasAttachments,\n attachments,\n composedState,\n mcpProvider,\n callback\n );\n\n const actionResult = {\n text: `Successfully called tool: ${serverName}/${toolName}. Reasoned response: ${replyMemory.content.text}`,\n values: {\n success: true,\n toolExecuted: true,\n serverName,\n toolName,\n hasAttachments,\n output: toolOutput,\n },\n data: {\n actionName: \"CALL_MCP_TOOL\",\n serverName,\n toolName,\n toolArguments: toolSelectionArgument.toolArguments,\n reasoning: toolSelectionName.reasoning,\n output: toolOutput,\n attachments: attachments || [],\n },\n success: true,\n };\n\n logger.info(\n {\n serverName,\n toolName,\n hasOutput: !!toolOutput,\n outputLength: toolOutput?.length || 0,\n hasAttachments,\n reasoning: toolSelectionName.reasoning,\n },\n `[CALL_MCP_TOOL] Action result`\n );\n\n return actionResult;\n } catch (error) {\n return await handleMcpError(\n composedState,\n mcpProvider,\n error,\n runtime,\n message,\n \"tool\",\n callback\n );\n }\n },\n\n examples: [\n [\n {\n name: \"{{user}}\",\n content: {\n text: \"Can you search for information about climate change?\",\n },\n },\n {\n name: \"{{assistant}}\",\n content: {\n text: \"I'll help you with that request. Let me access the right tool...\",\n actions: [\"CALL_MCP_TOOL\"],\n },\n },\n {\n name: \"{{assistant}}\",\n content: {\n text: \"I found the following information about climate change:\\n\\nClimate change refers to long-term shifts in temperatures and weather patterns. These shifts may be natural, but since the 1800s, human activities have been the main driver of climate change, primarily due to the burning of fossil fuels like coal, oil, and gas, which produces heat-trapping gases.\",\n actions: [\"CALL_MCP_TOOL\"],\n },\n },\n ],\n ],\n};\n",
|
|
11
|
-
"import type { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport type { SSEClientTransport } from \"@modelcontextprotocol/sdk/client/sse.js\";\nimport type { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\nimport type { StreamableHTTPClientTransport } from \"@modelcontextprotocol/sdk/client/streamableHttp.js\";\nimport type {\n EmbeddedResource,\n ImageContent,\n Resource,\n ResourceTemplate,\n TextContent,\n Tool,\n} from \"@modelcontextprotocol/sdk/types.js\";\n\nexport const MCP_SERVICE_NAME = \"mcp\";\nexport const DEFAULT_MCP_TIMEOUT_SECONDS = 60000;\nexport const MIN_MCP_TIMEOUT_SECONDS = 1;\nexport const DEFAULT_MAX_RETRIES = 2;\n\nexport interface PingConfig {\n enabled: boolean;\n intervalMs: number;\n timeoutMs: number;\n failuresBeforeDisconnect: number;\n}\n\nexport interface ConnectionState {\n status: \"connecting\" | \"connected\" | \"disconnected\" | \"failed\";\n pingInterval?: NodeJS.Timer;\n reconnectTimeout?: NodeJS.Timer;\n reconnectAttempts: number;\n lastConnected?: Date;\n lastError?: Error;\n consecutivePingFailures: number;\n}\n\nexport type StdioMcpServerConfig = {\n type: \"stdio\";\n command?: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n timeoutInMillis?: number;\n};\n\nexport type HttpMcpServerConfig = {\n type: \"http\" | \"streamable-http\" | \"sse\"; // Support modern and legacy naming\n url: string;\n timeout?: number;\n headers?: Record<string, string>;\n};\n\nexport type McpServerConfig = StdioMcpServerConfig | HttpMcpServerConfig;\n\nexport type McpSettings = {\n servers: Record<string, McpServerConfig>;\n maxRetries?: number;\n};\n\nexport type McpServerStatus = \"connecting\" | \"connected\" | \"disconnected\";\n\nexport interface McpServer {\n name: string;\n status: McpServerStatus;\n config: string;\n error?: string;\n disabled?: boolean;\n tools?: Tool[];\n resources?: Resource[];\n resourceTemplates?: ResourceTemplate[];\n}\n\nexport interface McpConnection {\n server: McpServer;\n client: Client;\n transport: StdioClientTransport | SSEClientTransport | StreamableHTTPClientTransport;\n}\n\nexport interface McpToolResult {\n content: Array<TextContent | ImageContent | EmbeddedResource>;\n isError?: boolean;\n}\n\nexport interface McpToolCallResponse {\n content: Array<TextContent | ImageContent | EmbeddedResource>;\n isError?: boolean;\n}\n\nexport interface McpResourceResponse {\n contents: Array<{\n uri: string;\n mimeType?: string;\n text?: string;\n blob?: string;\n }>;\n}\n\nexport interface McpToolInfo {\n description: string;\n inputSchema?: {\n properties?: Record<string, unknown>;\n required?: string[];\n [key: string]: unknown;\n };\n}\n\nexport interface McpResourceInfo {\n name: string;\n description: string;\n mimeType?: string;\n}\n\nexport interface McpServerInfo {\n status: string;\n tools: Record<string, McpToolInfo>;\n resources: Record<string, McpResourceInfo>;\n}\n\nexport type McpProvider = {\n values: { mcp: McpProviderData; mcpText?: string };\n data: { mcp: McpProviderData };\n text: string;\n};\n\nexport interface McpProviderData {\n [serverName: string]: McpServerInfo;\n}\n\nexport const ToolSelectionSchema = {\n type: \"object\",\n required: [\"serverName\", \"toolName\", \"arguments\"],\n properties: {\n serverName: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"serverName must not be empty\",\n },\n toolName: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"toolName must not be empty\",\n },\n arguments: {\n type: \"object\",\n },\n reasoning: {\n type: \"string\",\n },\n noToolAvailable: {\n type: \"boolean\",\n },\n },\n};\n\nexport const ResourceSelectionSchema = {\n type: \"object\",\n required: [\"serverName\", \"uri\"],\n properties: {\n serverName: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"serverName must not be empty\",\n },\n uri: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"uri must not be empty\",\n },\n reasoning: {\n type: \"string\",\n },\n noResourceAvailable: {\n type: \"boolean\",\n },\n },\n};\n\nexport const DEFAULT_PING_CONFIG: PingConfig = {\n enabled: true,\n intervalMs: 10000, // 10 seconds\n timeoutMs: 5000, // 5 seconds\n failuresBeforeDisconnect: 3,\n};\n\nexport const MAX_RECONNECT_ATTEMPTS = 5;\nexport const BACKOFF_MULTIPLIER = 2;\nexport const INITIAL_RETRY_DELAY = 2000; // 2 seconds\n\ninterface SuccessResult<T> {\n success: true;\n data: T;\n}\n\ninterface ErrorResult {\n success: false;\n error: string;\n}\n\nexport type ValidationResult<T> = SuccessResult<T> | ErrorResult;\n",
|
|
12
|
-
"import {\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n ModelType,\n composePromptFromState,\n logger,\n type ActionResult,\n} from '@elizaos/core';\nimport type { State } from '@elizaos/core';\nimport { errorAnalysisPrompt } from '../templates/errorAnalysisPrompt';\nimport type { McpProvider } from '../types';\n\nexport async function handleMcpError(\n state: State,\n mcpProvider: McpProvider,\n error: unknown,\n runtime: IAgentRuntime,\n message: Memory,\n type: 'tool' | 'resource',\n callback?: HandlerCallback\n): Promise<ActionResult> {\n const errorMessage = error instanceof Error ? error.message : String(error);\n\n logger.error({ error, mcpType: type }, `Error executing MCP ${type}: ${errorMessage}`);\n\n let responseText = `I'm sorry, I wasn't able to get the information you requested. There seems to be an issue with the ${type} right now. Is there something else I can help you with?`;\n let thoughtText = `Error calling MCP ${type} and failed to generate a custom response. Providing a generic fallback response.`;\n\n if (callback) {\n const enhancedState: State = {\n ...state,\n values: {\n ...state.values,\n mcpProvider,\n userMessage: message.content.text || '',\n error: errorMessage,\n },\n };\n\n const prompt = composePromptFromState({\n state: enhancedState,\n template: errorAnalysisPrompt,\n });\n\n try {\n const errorResponse = await runtime.useModel(ModelType.TEXT_SMALL, {\n prompt,\n });\n\n responseText = errorResponse;\n thoughtText = `Error calling MCP ${type}: ${errorMessage}. Providing a helpful response to the user.`;\n\n await callback({\n thought: thoughtText,\n text: responseText,\n actions: ['REPLY'],\n });\n } catch (modelError) {\n logger.error(\n { error: modelError instanceof Error ? modelError.message : String(modelError) },\n 'Failed to generate error response'\n );\n\n await callback({\n thought: thoughtText,\n text: responseText,\n actions: ['REPLY'],\n });\n }\n }\n\n return {\n text: `Failed to execute MCP ${type}`,\n values: {\n success: false,\n error: errorMessage,\n errorType: type,\n },\n data: {\n actionName: type === 'tool' ? 'CALL_MCP_TOOL' : 'READ_MCP_RESOURCE',\n error: errorMessage,\n mcpType: type,\n },\n success: false,\n error: error instanceof Error ? error : new Error(errorMessage),\n };\n}\n\nexport class McpError extends Error {\n constructor(\n message: string,\n public readonly code: string = 'UNKNOWN'\n ) {\n super(message);\n this.name = 'McpError';\n }\n\n static connectionError(serverName: string, details?: string): McpError {\n return new McpError(\n `Failed to connect to server '${serverName}'${details ? `: ${details}` : ''}`,\n 'CONNECTION_ERROR'\n );\n }\n\n static toolNotFound(toolName: string, serverName: string): McpError {\n return new McpError(`Tool '${toolName}' not found on server '${serverName}'`, 'TOOL_NOT_FOUND');\n }\n\n static resourceNotFound(uri: string, serverName: string): McpError {\n return new McpError(\n `Resource '${uri}' not found on server '${serverName}'`,\n 'RESOURCE_NOT_FOUND'\n );\n }\n\n static validationError(details: string): McpError {\n return new McpError(`Validation error: ${details}`, 'VALIDATION_ERROR');\n }\n\n static serverError(serverName: string, details?: string): McpError {\n return new McpError(\n `Server error from '${serverName}'${details ? `: ${details}` : ''}`,\n 'SERVER_ERROR'\n );\n }\n}\n",
|
|
5
|
+
"import { type IAgentRuntime, type Plugin, logger } from \"@elizaos/core\";\nimport { readResourceAction } from \"./actions/readResourceAction\";\nimport { provider } from \"./provider\";\nimport { McpService } from \"./service\";\n\n// Re-export types\nexport * from \"./types\";\n\n// Re-export service\nexport { McpService } from \"./service\";\n\n// Re-export dynamic action utilities\nexport {\n createMcpToolAction,\n createMcpToolActions,\n isMcpToolAction,\n getMcpToolActionsForServer,\n type McpToolAction,\n} from \"./actions/dynamic-tool-actions\";\n\n// Re-export tool compatibility\nexport {\n createMcpToolCompatibilitySync,\n createMcpToolCompatibility,\n detectModelProvider,\n McpToolCompatibility,\n type ModelInfo,\n type ModelProvider,\n} from \"./tool-compatibility\";\n\n// Re-export schema cache\nexport { McpSchemaCache, getSchemaCache } from \"./cache\";\n\nconst mcpPlugin: Plugin = {\n name: \"mcp\",\n description: \"Plugin for connecting to MCP (Model Context Protocol) servers\",\n\n init: async (_config: Record<string, string>, _runtime: IAgentRuntime) => {\n logger.info(\"Initializing MCP plugin...\");\n },\n\n services: [McpService],\n actions: [readResourceAction],\n providers: [provider],\n};\n\nexport default mcpPlugin;\n",
|
|
6
|
+
"import {\n type Action,\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n ModelType,\n type State,\n composePromptFromState,\n logger,\n type ActionResult,\n} from '@elizaos/core';\nimport type { McpService } from '../service';\nimport { resourceSelectionTemplate } from '../templates/resourceSelectionTemplate';\nimport { MCP_SERVICE_NAME, type McpServer, type McpServerInfo } from '../types';\nimport { handleMcpError } from '../utils/error';\nimport {\n handleResourceAnalysis,\n processResourceResult,\n sendInitialResponse,\n} from '../utils/processing';\nimport {\n createResourceSelectionFeedbackPrompt,\n validateResourceSelection,\n} from '../utils/validation';\nimport type { ResourceSelection } from '../utils/validation';\nimport { withModelRetry } from '../utils/wrapper';\n\nfunction createResourceSelectionPrompt(composedState: State, userMessage: string): string {\n const mcpData = (composedState.values.mcp || {}) as Record<string, McpServerInfo>;\n const serverNames = Object.keys(mcpData);\n\n let resourcesDescription = '';\n for (const serverName of serverNames) {\n const server = mcpData[serverName];\n if (server.status !== 'connected') continue;\n\n const resourceUris = Object.keys(server.resources || {});\n for (const uri of resourceUris) {\n const resource = server.resources[uri];\n resourcesDescription += `Resource: ${uri} (Server: ${serverName})\\n`;\n resourcesDescription += `Name: ${resource.name || 'No name available'}\\n`;\n resourcesDescription += `Description: ${\n resource.description || 'No description available'\n }\\n`;\n resourcesDescription += `MIME Type: ${resource.mimeType || 'Not specified'}\\n\\n`;\n }\n }\n\n const enhancedState: State = {\n ...composedState,\n values: {\n ...composedState.values,\n resourcesDescription,\n userMessage,\n },\n };\n\n return composePromptFromState({\n state: enhancedState,\n template: resourceSelectionTemplate,\n });\n}\n\nexport const readResourceAction: Action = {\n name: 'READ_MCP_RESOURCE',\n similes: [\n 'READ_RESOURCE',\n 'READ_MCP_RESOURCE',\n 'GET_RESOURCE',\n 'GET_MCP_RESOURCE',\n 'FETCH_RESOURCE',\n 'FETCH_MCP_RESOURCE',\n 'ACCESS_RESOURCE',\n 'ACCESS_MCP_RESOURCE',\n ],\n description: 'Reads a resource from an MCP server',\n\n validate: async (runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> => {\n const mcpService = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!mcpService) return false;\n\n const servers = mcpService.getServers();\n return (\n servers.length > 0 &&\n servers.some(\n (server: McpServer) =>\n server.status === 'connected' && server.resources && server.resources.length > 0\n )\n );\n },\n\n handler: async (\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: { [key: string]: unknown },\n callback?: HandlerCallback\n ): Promise<ActionResult> => {\n const composedState = await runtime.composeState(message, ['RECENT_MESSAGES', 'MCP']);\n\n const mcpService = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!mcpService) {\n throw new Error('MCP service not available');\n }\n\n const mcpProvider = mcpService.getProviderData();\n\n try {\n await sendInitialResponse(callback);\n\n const resourceSelectionPrompt = createResourceSelectionPrompt(\n composedState,\n message.content.text || ''\n );\n\n const resourceSelection = await runtime.useModel(ModelType.TEXT_SMALL, {\n prompt: resourceSelectionPrompt,\n });\n\n const parsedSelection = await withModelRetry<ResourceSelection>({\n runtime,\n state: composedState,\n message,\n callback,\n input: resourceSelection,\n validationFn: (data) => validateResourceSelection(data),\n createFeedbackPromptFn: (originalResponse, errorMessage, state, userMessage) =>\n createResourceSelectionFeedbackPrompt(\n originalResponse as string,\n errorMessage,\n state,\n userMessage\n ),\n failureMsg: `I'm having trouble finding the resource you're looking for. Could you provide more details about what you need?`,\n retryCount: 0,\n });\n\n if (!parsedSelection || parsedSelection.noResourceAvailable) {\n const responseText =\n \"I don't have a specific resource that contains the information you're looking for. Let me try to assist you directly instead.\";\n const thoughtText =\n 'No appropriate MCP resource available for this request. Falling back to direct assistance.';\n\n if (callback && parsedSelection?.noResourceAvailable) {\n await callback({\n text: responseText,\n thought: thoughtText,\n actions: ['REPLY'],\n });\n }\n return {\n text: responseText,\n values: {\n success: true,\n noResourceAvailable: true,\n fallbackToDirectAssistance: true,\n },\n data: {\n actionName: 'READ_MCP_RESOURCE',\n noResourceAvailable: true,\n reason: parsedSelection?.reasoning || 'No appropriate resource available',\n },\n success: true,\n };\n }\n\n const { serverName, uri, reasoning } = parsedSelection;\n\n logger.debug(`Selected resource \"${uri}\" on server \"${serverName}\" because: ${reasoning}`);\n\n const result = await mcpService.readResource(serverName, uri);\n logger.debug(`Read resource ${uri} from server ${serverName}`);\n\n const { resourceContent, resourceMeta } = processResourceResult(result, uri);\n\n await handleResourceAnalysis(\n runtime,\n message,\n uri,\n serverName,\n resourceContent,\n resourceMeta,\n callback\n );\n\n return {\n text: `Successfully read resource: ${uri}`,\n values: {\n success: true,\n resourceRead: true,\n serverName,\n uri,\n },\n data: {\n actionName: 'READ_MCP_RESOURCE',\n serverName,\n uri,\n reasoning,\n resourceMeta,\n contentLength: resourceContent?.length || 0,\n },\n success: true,\n };\n } catch (error) {\n return await handleMcpError(\n composedState,\n mcpProvider,\n error,\n runtime,\n message,\n 'resource',\n callback\n );\n }\n },\n\n examples: [\n [\n {\n name: '{{user}}',\n content: {\n text: 'Can you get the documentation about installing ElizaOS?',\n },\n },\n {\n name: '{{assistant}}',\n content: {\n text: `I'll retrieve that information for you. Let me access the resource...`,\n actions: ['READ_MCP_RESOURCE'],\n },\n },\n {\n name: '{{assistant}}',\n content: {\n text: `ElizaOS installation is straightforward. You'll need Node.js 23+ and Git installed. For Windows users, WSL 2 is required. The quickest way to get started is by cloning the ElizaOS starter repository with \\`git clone https://github.com/elizaos/eliza-starter.git\\`, then run \\`cd eliza-starter && cp .env.example .env && bun i && bun run build && bun start\\`. This will set up a development environment with the core features enabled. After starting, you can access the web interface at http://localhost:3000 to interact with your agent.`,\n actions: ['READ_MCP_RESOURCE'],\n },\n },\n ],\n ],\n};\n",
|
|
7
|
+
"export const resourceSelectionTemplate = `\n{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are an intelligent assistant helping select the right resource to address a user's request.\n\nCRITICAL INSTRUCTIONS:\n1. You MUST specify both a valid serverName AND uri from the list above\n2. The serverName value should match EXACTLY the server name shown in parentheses (Server: X)\n CORRECT: \"serverName\": \"github\" (if the server is called \"github\") \n WRONG: \"serverName\": \"GitHub\" or \"Github\" or any other variation\n3. The uri value should match EXACTLY the resource uri listed\n CORRECT: \"uri\": \"weather://San Francisco/current\" (if that's the exact uri)\n WRONG: \"uri\": \"weather://sanfrancisco/current\" or any variation\n4. Identify the user's information need from the conversation context\n5. Select the most appropriate resource based on its description and the request\n6. If no resource seems appropriate, output {\"noResourceAvailable\": true}\n\n!!! YOUR RESPONSE MUST BE A VALID JSON OBJECT ONLY !!! \n\nSTRICT FORMAT REQUIREMENTS:\n- NO code block formatting (NO backticks or \\`\\`\\`)\n- NO comments (NO // or /* */)\n- NO placeholders like \"replace with...\", \"example\", \"your...\", \"actual\", etc.\n- Every parameter value must be a concrete, usable value (not instructions to replace)\n- Use proper JSON syntax with double quotes for strings\n- NO explanatory text before or after the JSON object\n\nEXAMPLE RESPONSE:\n{\n \"serverName\": \"weather-server\",\n \"uri\": \"weather://San Francisco/current\",\n \"reasoning\": \"Based on the conversation, the user is asking about current weather in San Francisco. This resource provides up-to-date weather information for that city.\"\n}\n\nREMEMBER: Your response will be parsed directly as JSON. If it fails to parse, the operation will fail completely!\n`;\n",
|
|
8
|
+
"import type { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport type { SSEClientTransport } from \"@modelcontextprotocol/sdk/client/sse.js\";\nimport type { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\nimport type { Resource, ResourceTemplate, Tool } from \"@modelcontextprotocol/sdk/types.js\";\n\n// ─── Constants ───────────────────────────────────────────────────────────────\n\nexport const MCP_SERVICE_NAME = \"mcp\";\nexport const DEFAULT_MCP_TIMEOUT_SECONDS = 60000;\nexport const DEFAULT_MAX_RETRIES = 2;\nexport const MAX_RECONNECT_ATTEMPTS = 5;\nexport const BACKOFF_MULTIPLIER = 2;\nexport const INITIAL_RETRY_DELAY = 2000;\n\nexport const DEFAULT_PING_CONFIG: PingConfig = {\n enabled: true,\n intervalMs: 10000,\n timeoutMs: 5000,\n failuresBeforeDisconnect: 3,\n};\n\n// ─── Server Configuration ────────────────────────────────────────────────────\n\nexport interface StdioMcpServerConfig {\n type: \"stdio\";\n command?: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n timeoutInMillis?: number;\n}\n\nexport interface HttpMcpServerConfig {\n type: \"http\" | \"streamable-http\" | \"sse\";\n url: string;\n timeout?: number;\n headers?: Record<string, string>;\n}\n\nexport type McpServerConfig = StdioMcpServerConfig | HttpMcpServerConfig;\n\nexport interface McpSettings {\n servers: Record<string, McpServerConfig>;\n maxRetries?: number;\n}\n\n// ─── Connection State ────────────────────────────────────────────────────────\n\nexport interface PingConfig {\n enabled: boolean;\n intervalMs: number;\n timeoutMs: number;\n failuresBeforeDisconnect: number;\n}\n\nexport interface ConnectionState {\n status: \"connecting\" | \"connected\" | \"disconnected\" | \"failed\";\n pingInterval?: NodeJS.Timer;\n reconnectTimeout?: NodeJS.Timer;\n reconnectAttempts: number;\n lastConnected?: Date;\n lastError?: Error;\n consecutivePingFailures: number;\n}\n\nexport type McpServerStatus = \"connecting\" | \"connected\" | \"disconnected\";\n\nexport interface McpServer {\n name: string;\n status: McpServerStatus;\n config: string;\n error?: string;\n disabled?: boolean;\n tools?: Tool[];\n resources?: Resource[];\n resourceTemplates?: ResourceTemplate[];\n}\n\nexport interface McpConnection {\n server: McpServer;\n client: Client;\n transport: StdioClientTransport | SSEClientTransport;\n}\n\n// ─── Provider Data ───────────────────────────────────────────────────────────\n\nexport interface McpToolInfo {\n description: string;\n inputSchema?: Record<string, unknown>;\n}\n\nexport interface McpResourceInfo {\n name: string;\n description: string;\n mimeType?: string;\n}\n\nexport interface McpServerInfo {\n status: string;\n tools: Record<string, McpToolInfo>;\n resources: Record<string, McpResourceInfo>;\n}\n\nexport interface McpProviderData {\n [serverName: string]: McpServerInfo;\n}\n\nexport interface McpProvider {\n values: { mcp: McpProviderData; mcpText?: string };\n data: { mcp: McpProviderData };\n text: string;\n}\n\n// ─── Schema Cache ────────────────────────────────────────────────────────────\n\nexport interface McpSchemaCacheConfig {\n enabled: boolean;\n redisUrl?: string;\n redisToken?: string;\n ttlSeconds: number;\n}\n\nexport interface CachedToolSchema {\n name: string;\n description?: string;\n inputSchema?: Tool[\"inputSchema\"];\n}\n\nexport interface CachedServerSchema {\n serverName: string;\n tools: CachedToolSchema[];\n cachedAt: number;\n configHash: string;\n}\n\n// ─── Validation ──────────────────────────────────────────────────────────────\n\nexport type ValidationResult<T> = { success: true; data: T } | { success: false; error: string };\n\nexport const ResourceSelectionSchema = {\n type: \"object\",\n required: [\"serverName\", \"uri\"],\n properties: {\n serverName: { type: \"string\", minLength: 1 },\n uri: { type: \"string\", minLength: 1 },\n reasoning: { type: \"string\" },\n noResourceAvailable: { type: \"boolean\" },\n },\n};\n",
|
|
9
|
+
"import {\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n ModelType,\n composePromptFromState,\n logger,\n type ActionResult,\n type State,\n} from '@elizaos/core';\nimport { errorAnalysisPrompt } from '../templates/errorAnalysisPrompt';\nimport type { McpProvider } from '../types';\n\nexport async function handleMcpError(\n state: State,\n mcpProvider: McpProvider,\n error: unknown,\n runtime: IAgentRuntime,\n message: Memory,\n type: 'tool' | 'resource',\n callback?: HandlerCallback\n): Promise<ActionResult> {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logger.error({ error, mcpType: type }, `MCP ${type} error: ${errorMessage}`);\n\n const fallbackText = `I wasn't able to complete that request. There's an issue with the ${type}. Can I help with something else?`;\n let responseText = fallbackText;\n\n if (callback) {\n try {\n const prompt = composePromptFromState({\n state: {\n ...state,\n values: { ...state.values, mcpProvider, userMessage: message.content.text || '', error: errorMessage },\n },\n template: errorAnalysisPrompt,\n });\n responseText = await runtime.useModel(ModelType.TEXT_SMALL, { prompt });\n } catch {\n // Use fallback\n }\n\n await callback({ thought: `MCP ${type} error: ${errorMessage}`, text: responseText, actions: ['REPLY'] });\n }\n\n return {\n text: `Failed to execute MCP ${type}`,\n values: { success: false, error: errorMessage, errorType: type },\n data: { actionName: type === 'tool' ? 'CALL_MCP_TOOL' : 'READ_MCP_RESOURCE', error: errorMessage },\n success: false,\n error: error instanceof Error ? error : new Error(errorMessage),\n };\n}\n",
|
|
13
10
|
"export const errorAnalysisPrompt = `\n{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou're an assistant helping a user, but there was an error accessing the resource you tried to use.\n\nUser request: \"{{{userMessage}}}\"\nError message: {{{error}}}\n\nCreate a helpful response that:\n1. Acknowledges the issue in user-friendly terms\n2. Offers alternative approaches to help if possible\n3. Doesn't expose technical error details unless they're truly helpful\n4. Maintains a helpful, conversational tone\n\nYour response:\n`;\n",
|
|
14
|
-
"import type {
|
|
15
|
-
"import {\n type Content,\n ContentType,\n type HandlerCallback,\n type IAgentRuntime,\n type Media,\n type Memory,\n ModelType,\n createUniqueUuid,\n logger,\n} from '@elizaos/core';\nimport { type State, composePromptFromState } from '@elizaos/core';\nimport { resourceAnalysisTemplate } from '../templates/resourceAnalysisTemplate';\nimport { toolReasoningTemplate } from '../templates/toolReasoningTemplate';\nimport { createMcpMemory } from './mcp';\n\nfunction getMimeTypeToContentType(mimeType?: string): ContentType | undefined {\n if (!mimeType) return undefined;\n\n if (mimeType.startsWith('image/')) return ContentType.IMAGE;\n if (mimeType.startsWith('video/')) return ContentType.VIDEO;\n if (mimeType.startsWith('audio/')) return ContentType.AUDIO;\n if (mimeType.includes('pdf') || mimeType.includes('document')) return ContentType.DOCUMENT;\n\n return undefined;\n}\n\nexport function processResourceResult(\n result: {\n contents: Array<{\n uri: string;\n mimeType?: string;\n text?: string;\n blob?: string;\n }>;\n },\n uri: string\n): { resourceContent: string; resourceMeta: string } {\n let resourceContent = '';\n let resourceMeta = '';\n\n for (const content of result.contents) {\n if (content.text) {\n resourceContent += content.text;\n } else if (content.blob) {\n resourceContent += `[Binary data - ${content.mimeType || 'unknown type'}]`;\n }\n\n resourceMeta += `Resource: ${content.uri || uri}\\n`;\n if (content.mimeType) {\n resourceMeta += `Type: ${content.mimeType}\\n`;\n }\n }\n\n return { resourceContent, resourceMeta };\n}\n\nexport function processToolResult(\n result: {\n content: Array<{\n type: string;\n text?: string;\n mimeType?: string;\n data?: string;\n resource?: {\n uri: string;\n text?: string;\n blob?: string;\n };\n }>;\n isError?: boolean;\n },\n serverName: string,\n toolName: string,\n runtime: IAgentRuntime,\n messageEntityId: string\n): { toolOutput: string; hasAttachments: boolean; attachments: Media[] } {\n let toolOutput = '';\n let hasAttachments = false;\n const attachments: Media[] = [];\n\n for (const content of result.content) {\n if (content.type === 'text') {\n toolOutput += content.text;\n } else if (content.type === 'image') {\n hasAttachments = true;\n attachments.push({\n contentType: getMimeTypeToContentType(content.mimeType),\n url: `data:${content.mimeType};base64,${content.data}`,\n id: createUniqueUuid(runtime, messageEntityId),\n title: 'Generated image',\n source: `${serverName}/${toolName}`,\n description: 'Tool-generated image',\n text: 'Generated image',\n });\n } else if (content.type === 'resource') {\n const resource = content.resource;\n if (resource && 'text' in resource) {\n toolOutput += `\\n\\nResource (${resource.uri}):\\n${resource.text}`;\n } else if (resource && 'blob' in resource) {\n toolOutput += `\\n\\nResource (${resource.uri}): [Binary data]`;\n }\n }\n }\n\n return { toolOutput, hasAttachments, attachments };\n}\n\nexport async function handleResourceAnalysis(\n runtime: IAgentRuntime,\n message: Memory,\n uri: string,\n serverName: string,\n resourceContent: string,\n resourceMeta: string,\n callback?: HandlerCallback\n): Promise<void> {\n await createMcpMemory(runtime, message, 'resource', serverName, resourceContent, {\n uri,\n isResourceAccess: true,\n });\n\n const analysisPrompt = createAnalysisPrompt(\n uri,\n message.content.text || '',\n resourceContent,\n resourceMeta\n );\n\n const analyzedResponse = await runtime.useModel(ModelType.TEXT_SMALL, {\n prompt: analysisPrompt,\n });\n\n if (callback) {\n await callback({\n text: analyzedResponse,\n thought: `I analyzed the content from the ${uri} resource on ${serverName} and crafted a thoughtful response that addresses the user's request while maintaining my conversational style.`,\n actions: ['READ_MCP_RESOURCE'],\n });\n }\n}\n\nexport async function handleToolResponse(\n runtime: IAgentRuntime,\n message: Memory,\n serverName: string,\n toolName: string,\n toolArgs: Record<string, unknown>,\n toolOutput: string,\n hasAttachments: boolean,\n attachments: Media[],\n state: State,\n mcpProvider: {\n values: { mcp: unknown };\n data: { mcp: unknown };\n text: string;\n },\n callback?: HandlerCallback\n): Promise<Memory> {\n await createMcpMemory(runtime, message, 'tool', serverName, toolOutput, {\n toolName,\n arguments: toolArgs,\n isToolCall: true,\n });\n\n const reasoningPrompt = createReasoningPrompt(\n state,\n mcpProvider,\n toolName,\n serverName,\n message.content.text || '',\n toolOutput,\n hasAttachments\n );\n\n logger.info({ reasoningPrompt }, 'reasoning prompt');\n\n const reasonedResponse = await runtime.useModel(ModelType.TEXT_SMALL, {\n prompt: reasoningPrompt,\n });\n\n const agentId = message.agentId || runtime.agentId;\n const replyMemory: Memory = {\n entityId: agentId,\n roomId: message.roomId,\n worldId: message.worldId,\n content: {\n text: reasonedResponse,\n thought: `I analyzed the output from the ${toolName} tool on ${serverName} and crafted a thoughtful response that addresses the user's request while maintaining my conversational style.`,\n actions: ['CALL_MCP_TOOL'],\n attachments: hasAttachments && attachments.length > 0 ? attachments : undefined,\n },\n };\n\n await runtime.createMemory(replyMemory, 'messages');\n\n if (callback) {\n await callback({\n text: reasonedResponse,\n thought: `I analyzed the output from the ${toolName} tool on ${serverName} and crafted a thoughtful response that addresses the user's request while maintaining my conversational style.`,\n actions: ['CALL_MCP_TOOL'],\n attachments: hasAttachments && attachments.length > 0 ? attachments : undefined,\n });\n }\n\n return replyMemory;\n}\n\nexport async function sendInitialResponse(callback?: HandlerCallback): Promise<void> {\n if (callback) {\n const responseContent: Content = {\n thought:\n 'The user is asking for information that can be found in an MCP resource. I will retrieve and analyze the appropriate resource.',\n text: \"I'll retrieve that information for you. Let me access the resource...\",\n actions: ['READ_MCP_RESOURCE'],\n };\n await callback(responseContent);\n }\n}\n\nfunction createAnalysisPrompt(\n uri: string,\n userMessage: string,\n resourceContent: string,\n resourceMeta: string\n): string {\n const enhancedState: State = {\n data: {},\n text: '',\n values: {\n uri,\n userMessage,\n resourceContent,\n resourceMeta,\n },\n };\n\n return composePromptFromState({\n state: enhancedState,\n template: resourceAnalysisTemplate,\n });\n}\n\nfunction createReasoningPrompt(\n state: State,\n mcpProvider: {\n values: { mcp: unknown };\n data: { mcp: unknown };\n text: string;\n },\n toolName: string,\n serverName: string,\n userMessage: string,\n toolOutput: string,\n hasAttachments: boolean\n): string {\n const enhancedState: State = {\n ...state,\n values: {\n ...state.values,\n mcpProvider,\n toolName,\n serverName,\n userMessage,\n toolOutput,\n hasAttachments,\n },\n };\n\n return composePromptFromState({\n state: enhancedState,\n template: toolReasoningTemplate,\n });\n}\n",
|
|
11
|
+
"import {\n type Content,\n ContentType,\n type HandlerCallback,\n type IAgentRuntime,\n type Media,\n type Memory,\n ModelType,\n createUniqueUuid,\n} from \"@elizaos/core\";\nimport { type State, composePromptFromState } from \"@elizaos/core\";\nimport { resourceAnalysisTemplate } from \"../templates/resourceAnalysisTemplate\";\nimport { createMcpMemory } from \"./mcp\";\n\nfunction getMimeTypeToContentType(mimeType?: string): ContentType | undefined {\n if (!mimeType) return undefined;\n if (mimeType.startsWith(\"image/\")) return ContentType.IMAGE;\n if (mimeType.startsWith(\"video/\")) return ContentType.VIDEO;\n if (mimeType.startsWith(\"audio/\")) return ContentType.AUDIO;\n if (mimeType.includes(\"pdf\") || mimeType.includes(\"document\")) return ContentType.DOCUMENT;\n return undefined;\n}\n\n/** Process resource result from MCP */\nexport function processResourceResult(\n result: { contents: Array<{ uri: string; mimeType?: string; text?: string; blob?: string }> },\n uri: string\n): { resourceContent: string; resourceMeta: string } {\n let resourceContent = \"\";\n let resourceMeta = \"\";\n\n for (const content of result.contents) {\n resourceContent += content.text || (content.blob ? `[Binary: ${content.mimeType || \"unknown\"}]` : \"\");\n resourceMeta += `Resource: ${content.uri || uri}\\n`;\n if (content.mimeType) resourceMeta += `Type: ${content.mimeType}\\n`;\n }\n\n return { resourceContent, resourceMeta };\n}\n\n/** Process tool result from MCP - used by dynamic-tool-actions */\nexport function processToolResult(\n result: {\n content: Array<{\n type: string;\n text?: string;\n mimeType?: string;\n data?: string;\n resource?: { uri: string; text?: string; blob?: string };\n }>;\n isError?: boolean;\n },\n serverName: string,\n toolName: string,\n runtime: IAgentRuntime,\n messageEntityId: string\n): { toolOutput: string; hasAttachments: boolean; attachments: Media[] } {\n let toolOutput = \"\";\n let hasAttachments = false;\n const attachments: Media[] = [];\n let attachmentIndex = 0;\n\n for (const content of result.content) {\n if (content.type === \"text\") {\n toolOutput += content.text;\n } else if (content.type === \"image\") {\n hasAttachments = true;\n attachments.push({\n contentType: getMimeTypeToContentType(content.mimeType),\n url: `data:${content.mimeType};base64,${content.data}`,\n id: createUniqueUuid(runtime, `${messageEntityId}-attachment-${attachmentIndex++}`),\n title: \"Generated image\",\n source: `${serverName}/${toolName}`,\n description: \"Tool-generated image\",\n text: \"Generated image\",\n });\n } else if (content.type === \"resource\" && content.resource) {\n const r = content.resource;\n toolOutput += r.text ? `\\n\\nResource (${r.uri}):\\n${r.text}` : `\\n\\nResource (${r.uri}): [Binary]`;\n }\n }\n\n return { toolOutput, hasAttachments, attachments };\n}\n\n/** Handle resource analysis for readResourceAction */\nexport async function handleResourceAnalysis(\n runtime: IAgentRuntime,\n message: Memory,\n uri: string,\n serverName: string,\n resourceContent: string,\n resourceMeta: string,\n callback?: HandlerCallback\n): Promise<void> {\n await createMcpMemory(runtime, message, \"resource\", serverName, resourceContent, {\n uri,\n isResourceAccess: true,\n });\n\n const prompt = composePromptFromState({\n state: {\n data: {},\n text: \"\",\n values: { uri, userMessage: message.content.text || \"\", resourceContent, resourceMeta },\n },\n template: resourceAnalysisTemplate,\n });\n\n const response = await runtime.useModel(ModelType.TEXT_SMALL, { prompt });\n\n if (callback) {\n await callback({\n text: response,\n thought: `Analyzed resource ${uri} from ${serverName}`,\n actions: [\"READ_MCP_RESOURCE\"],\n });\n }\n}\n\n/** Send initial response for readResourceAction */\nexport async function sendInitialResponse(callback?: HandlerCallback): Promise<void> {\n if (callback) {\n await callback({\n thought: \"Retrieving MCP resource...\",\n text: \"I'll retrieve that information for you. Let me access the resource...\",\n actions: [\"READ_MCP_RESOURCE\"],\n });\n }\n}\n",
|
|
16
12
|
"export const resourceAnalysisTemplate = `\n{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are a helpful assistant responding to a user's request. You've just accessed the resource \"{{{uri}}}\" to help answer this request.\n\nOriginal user request: \"{{{userMessage}}}\"\n\nResource metadata: \n{{{resourceMeta}}\n\nResource content: \n{{{resourceContent}}\n\nInstructions:\n1. Analyze how well the resource's content addresses the user's specific question or need\n2. Identify the most relevant information from the resource\n3. Create a natural, conversational response that incorporates this information\n4. If the resource content is insufficient, acknowledge its limitations and explain what you can determine\n5. Do not start with phrases like \"According to the resource\" or \"Here's what I found\" - instead, integrate the information naturally\n6. Maintain your helpful, intelligent assistant personality while presenting the information\n\nYour response (written as if directly to the user):\n`;\n",
|
|
17
|
-
"export const toolReasoningTemplate = `\n{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are a helpful assistant responding to a user's request. You've just used the \"{{{toolName}}}\" tool from the \"{{{serverName}}}\" server to help answer this request.\n\nOriginal user request: \"{{{userMessage}}}\"\n\nTool response:\n{{{toolOutput}}}\n\n{{#if hasAttachments}}\nThe tool also returned images or other media that will be shared with the user.\n{{/if}}\n\nInstructions:\n1. Analyze how well the tool's response addresses the user's specific question or need\n2. Identify the most relevant information from the tool's output\n3. Create a natural, conversational response that incorporates this information\n4. If the tool's response is insufficient, acknowledge its limitations and explain what you can determine\n5. Do not start with phrases like \"I used the X tool\" or \"Here's what I found\" - instead, integrate the information naturally\n6. Maintain your helpful, intelligent assistant personality while presenting the information\n\nYour response (written as if directly to the user):\n`;\n",
|
|
18
13
|
"import type { IAgentRuntime, Memory } from \"@elizaos/core\";\nimport type { McpProvider, McpProviderData, McpResourceInfo, McpServer, McpToolInfo } from \"../types\";\n\nconst NO_DESC = \"No description\";\n\nexport async function createMcpMemory(\n runtime: IAgentRuntime,\n message: Memory,\n type: string,\n serverName: string,\n content: string,\n metadata: Record<string, unknown>\n): Promise<void> {\n const memory = await runtime.addEmbeddingToMemory({\n entityId: message.entityId,\n agentId: runtime.agentId,\n roomId: message.roomId,\n content: {\n text: `Used \"${type}\" from \"${serverName}\". Content: ${content}`,\n metadata: { ...metadata, serverName },\n },\n });\n await runtime.createMemory(memory, type === \"resource\" ? \"resources\" : \"tools\", true);\n}\n\nexport function buildMcpProviderData(servers: McpServer[]): McpProvider {\n if (servers.length === 0) {\n return { values: { mcp: {} }, data: { mcp: {} }, text: \"No MCP servers connected.\" };\n }\n\n const mcpData: McpProviderData = {};\n const lines: string[] = [\"# MCP Configuration\\n\"];\n\n for (const server of servers) {\n const tools: Record<string, McpToolInfo> = {};\n const resources: Record<string, McpResourceInfo> = {};\n\n lines.push(`## ${server.name} (${server.status})\\n`);\n\n if (server.tools?.length) {\n lines.push(\"### Tools\\n\");\n for (const t of server.tools) {\n tools[t.name] = { description: t.description || NO_DESC, inputSchema: t.inputSchema || {} };\n lines.push(`- **${t.name}**: ${t.description || NO_DESC}`);\n }\n lines.push(\"\");\n }\n\n if (server.resources?.length) {\n lines.push(\"### Resources\\n\");\n for (const r of server.resources) {\n resources[r.uri] = { name: r.name, description: r.description || NO_DESC, mimeType: r.mimeType };\n lines.push(`- **${r.name}** (${r.uri}): ${r.description || NO_DESC}`);\n }\n lines.push(\"\");\n }\n\n mcpData[server.name] = { status: server.status, tools, resources };\n }\n\n const text = lines.join(\"\\n\");\n return { values: { mcp: mcpData, mcpText: text }, data: { mcp: mcpData }, text };\n}\n",
|
|
19
|
-
"import
|
|
20
|
-
"import
|
|
21
|
-
"import {
|
|
22
|
-
"
|
|
23
|
-
"export const toolSelectionNameSchema = {\n type: \"object\",\n required: [\"serverName\", \"toolName\"],\n properties: {\n serverName: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"serverName must not be empty\",\n },\n toolName: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"toolName must not be empty\",\n },\n reasoning: {\n type: \"string\",\n },\n noToolAvailable: {\n type: \"boolean\",\n },\n },\n};\n\nexport interface ToolSelectionName {\n serverName: string;\n toolName: string;\n reasoning?: string;\n noToolAvailable?: boolean;\n}\n\nexport const toolSelectionArgumentSchema = {\n type: \"object\",\n required: [\"toolArguments\"],\n properties: {\n toolArguments: {\n type: \"object\",\n },\n },\n};\n\nexport interface ToolSelectionArgument {\n toolArguments: Record<string, unknown>;\n}\n\nexport const ResourceSelectionSchema = {\n type: \"object\",\n required: [\"serverName\", \"uri\"],\n properties: {\n serverName: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"serverName must not be empty\",\n },\n uri: {\n type: \"string\",\n minLength: 1,\n errorMessage: \"uri must not be empty\",\n },\n reasoning: {\n type: \"string\",\n },\n noResourceAvailable: {\n type: \"boolean\",\n },\n },\n};\n\nexport interface ResourceSelection {\n serverName: string;\n uri: string;\n reasoning?: string;\n noResourceAvailable?: boolean;\n}\n",
|
|
24
|
-
"import
|
|
25
|
-
"import
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"import { type IAgentRuntime, Service, logger } from \"@elizaos/core\";\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { SSEClientTransport } from \"@modelcontextprotocol/sdk/client/sse.js\";\nimport { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\nimport { StreamableHTTPClientTransport } from \"@modelcontextprotocol/sdk/client/streamableHttp.js\";\nimport type {\n CallToolResult,\n Resource,\n ResourceTemplate,\n Tool,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n type McpToolCompatibility,\n createMcpToolCompatibilitySync as createMcpToolCompatibility,\n} from \"./tool-compatibility\";\nimport {\n BACKOFF_MULTIPLIER,\n type ConnectionState,\n DEFAULT_MCP_TIMEOUT_SECONDS,\n DEFAULT_PING_CONFIG,\n type HttpMcpServerConfig,\n INITIAL_RETRY_DELAY,\n MAX_RECONNECT_ATTEMPTS,\n MCP_SERVICE_NAME,\n type McpConnection,\n type McpProvider,\n type McpResourceResponse,\n type McpServer,\n type McpServerConfig,\n type McpSettings,\n type PingConfig,\n type StdioMcpServerConfig,\n} from \"./types\";\nimport { buildMcpProviderData } from \"./utils/mcp\";\n\nconst errMsg = (e: unknown): string => (e instanceof Error ? e.message : String(e));\n\nexport class McpService extends Service {\n static serviceType: string = MCP_SERVICE_NAME;\n capabilityDescription = \"Enables the agent to interact with MCP (Model Context Protocol) servers\";\n\n private connections: Map<string, McpConnection> = new Map();\n private connectionStates: Map<string, ConnectionState> = new Map();\n private mcpProvider: McpProvider = {\n values: { mcp: {}, mcpText: \"\" },\n data: { mcp: {} },\n text: \"\",\n };\n private pingConfig: PingConfig = DEFAULT_PING_CONFIG;\n private toolCompatibility: McpToolCompatibility | null = null;\n private compatibilityInitialized = false;\n\n private initializationPromise: Promise<void> | null = null;\n\n constructor(runtime: IAgentRuntime) {\n super(runtime);\n this.initializationPromise = this.initializeMcpServers();\n }\n\n static async start(runtime: IAgentRuntime): Promise<McpService> {\n const service = new McpService(runtime);\n if (service.initializationPromise) {\n await service.initializationPromise;\n }\n return service;\n }\n\n async waitForInitialization(): Promise<void> {\n if (this.initializationPromise) {\n await this.initializationPromise;\n }\n }\n\n async stop(): Promise<void> {\n for (const name of this.connections.keys()) {\n await this.deleteConnection(name);\n }\n // Clean up any orphaned connection states (e.g., from failed initializations)\n for (const [name, state] of this.connectionStates.entries()) {\n if (state.pingInterval) clearInterval(state.pingInterval);\n if (state.reconnectTimeout) clearTimeout(state.reconnectTimeout);\n this.connectionStates.delete(name);\n }\n }\n\n private async initializeMcpServers(): Promise<void> {\n try {\n const mcpSettings = this.getMcpSettings();\n\n if (!mcpSettings?.servers || Object.keys(mcpSettings.servers).length === 0) {\n this.mcpProvider = buildMcpProviderData([]);\n return;\n }\n\n const connectionStartTime = Date.now();\n await this.updateServerConnections(mcpSettings.servers);\n const connectionDuration = Date.now() - connectionStartTime;\n\n const servers = this.getServers();\n const connected = servers.filter((s) => s.status === \"connected\");\n const failed = servers.filter((s) => s.status !== \"connected\");\n\n if (connected.length > 0) {\n logger.info(\n `[MCP] Connected ${connected.length}/${servers.length} in ${connectionDuration}ms (${connected.map((s) => `${s.name}:${s.tools?.length || 0}`).join(\", \")})`\n );\n }\n if (failed.length > 0) {\n logger.warn(`[MCP] Failed: ${failed.map((s) => s.name).join(\", \")}`);\n }\n if (connected.length === 0 && servers.length > 0) {\n logger.error(`[MCP] All servers failed`);\n }\n\n this.mcpProvider = buildMcpProviderData(servers);\n } catch (error) {\n logger.error({ error: errMsg(error) }, \"[MCP] Initialization failed\");\n this.mcpProvider = buildMcpProviderData([]);\n }\n }\n\n private getMcpSettings(): McpSettings | undefined {\n let settings = this.runtime.getSetting(\"mcp\");\n\n if (!settings || (typeof settings === \"object\" && !settings.servers)) {\n settings = (this.runtime as any).character?.settings?.mcp;\n }\n if (!settings || (typeof settings === \"object\" && !settings.servers)) {\n settings = (this.runtime as any).settings?.mcp;\n }\n\n return settings && typeof settings === \"object\" && (settings as McpSettings).servers\n ? (settings as McpSettings)\n : undefined;\n }\n\n private async updateServerConnections(\n serverConfigs: Record<string, McpServerConfig>\n ): Promise<void> {\n const newNames = new Set(Object.keys(serverConfigs));\n\n for (const name of this.connections.keys()) {\n if (!newNames.has(name)) await this.deleteConnection(name);\n }\n\n await Promise.allSettled(\n Object.entries(serverConfigs).map(async ([name, config]) => {\n const current = this.connections.get(name);\n if (!current) {\n await this.initializeConnection(name, config).catch((e) =>\n logger.error({ error: errMsg(e), serverName: name }, `[MCP] Failed: ${name}`)\n );\n } else if (JSON.stringify(config) !== current.server.config) {\n await this.deleteConnection(name);\n await this.initializeConnection(name, config).catch((e) =>\n logger.error({ error: errMsg(e), serverName: name }, `[MCP] Failed: ${name}`)\n );\n }\n })\n );\n }\n\n private async initializeConnection(name: string, config: McpServerConfig): Promise<void> {\n await this.deleteConnection(name);\n const state: ConnectionState = {\n status: \"connecting\",\n reconnectAttempts: 0,\n consecutivePingFailures: 0,\n };\n this.connectionStates.set(name, state);\n\n try {\n const client = new Client({ name: \"ElizaOS\", version: \"1.0.0\" }, { capabilities: {} });\n const transport =\n config.type === \"stdio\"\n ? await this.buildStdioClientTransport(name, config)\n : await this.buildHttpClientTransport(name, config);\n\n const connection: McpConnection = {\n server: { name, config: JSON.stringify(config), status: \"connecting\" },\n client,\n transport,\n };\n this.connections.set(name, connection);\n this.setupTransportHandlers(name, connection, state);\n\n const connectPromise = client.connect(transport);\n // Attach a no-op catch to prevent unhandled rejection if timeout fires first\n connectPromise.catch(() => {});\n await Promise.race([\n connectPromise,\n new Promise<never>((_, reject) =>\n setTimeout(() => reject(new Error(`Timeout connecting to ${name}`)), 60000)\n ),\n ]);\n\n const capabilities = client.getServerCapabilities();\n const tools = await this.fetchToolsList(name);\n const resources = capabilities?.resources ? await this.fetchResourcesList(name) : [];\n const resourceTemplates = capabilities?.resources\n ? await this.fetchResourceTemplatesList(name)\n : [];\n\n connection.server = {\n status: \"connected\",\n name,\n config: JSON.stringify(config),\n error: \"\",\n tools,\n resources,\n resourceTemplates,\n };\n state.status = \"connected\";\n state.lastConnected = new Date();\n state.reconnectAttempts = 0;\n state.consecutivePingFailures = 0;\n this.startPingMonitoring(name);\n } catch (error) {\n state.status = \"disconnected\";\n state.lastError = error instanceof Error ? error : new Error(String(error));\n this.handleDisconnection(name, error);\n throw error;\n }\n }\n\n private setupTransportHandlers(name: string, connection: McpConnection, state: ConnectionState) {\n const config = JSON.parse(connection.server.config) as McpServerConfig;\n const isHttp = config.type !== \"stdio\";\n\n connection.transport.onerror = async (error) => {\n const msg = error?.message || String(error);\n const isExpectedTimeout =\n isHttp && (!msg || msg === \"undefined\" || msg.includes(\"SSE\") || msg.includes(\"timeout\"));\n\n if (!isExpectedTimeout) {\n logger.error({ error, serverName: name }, `Transport error: ${name}`);\n connection.server.status = \"disconnected\";\n this.appendErrorMessage(connection, msg);\n }\n if (!isHttp) this.handleDisconnection(name, error);\n };\n\n connection.transport.onclose = async () => {\n if (!isHttp) {\n logger.warn({ serverName: name }, `Transport closed: ${name}`);\n connection.server.status = \"disconnected\";\n this.handleDisconnection(name, new Error(\"Transport closed\"));\n }\n };\n }\n\n private startPingMonitoring(name: string) {\n const connection = this.connections.get(name);\n if (!connection) return;\n\n const config = JSON.parse(connection.server.config) as McpServerConfig;\n if (config.type !== \"stdio\") return; // HTTP transports are stateless\n\n const state = this.connectionStates.get(name);\n if (!state || !this.pingConfig.enabled) return;\n if (state.pingInterval) clearInterval(state.pingInterval);\n\n state.pingInterval = setInterval(() => {\n this.sendPing(name).catch((err) => {\n logger.warn({ error: errMsg(err), serverName: name }, `Ping failed: ${name}`);\n this.handlePingFailure(name, err);\n });\n }, this.pingConfig.intervalMs);\n }\n\n private async sendPing(name: string): Promise<void> {\n const connection = this.connections.get(name);\n if (!connection) throw new Error(`No connection: ${name}`);\n\n await Promise.race([\n connection.client.listTools(),\n new Promise((_, reject) =>\n setTimeout(() => reject(new Error(\"Ping timeout\")), this.pingConfig.timeoutMs)\n ),\n ]);\n\n const state = this.connectionStates.get(name);\n if (state) state.consecutivePingFailures = 0;\n }\n\n private handlePingFailure(name: string, error: unknown) {\n const state = this.connectionStates.get(name);\n if (!state) return;\n state.consecutivePingFailures++;\n if (state.consecutivePingFailures >= this.pingConfig.failuresBeforeDisconnect) {\n logger.warn(`Ping failures exceeded for ${name}, disconnecting and attempting reconnect.`);\n this.handleDisconnection(name, error);\n }\n }\n\n private handleDisconnection(name: string, error: unknown) {\n const state = this.connectionStates.get(name);\n if (!state) return;\n state.status = \"disconnected\";\n state.lastError = error instanceof Error ? error : new Error(String(error));\n if (state.pingInterval) clearInterval(state.pingInterval);\n if (state.reconnectTimeout) clearTimeout(state.reconnectTimeout);\n if (state.reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {\n logger.error(`Max reconnect attempts reached for ${name}. Giving up.`);\n return;\n }\n const delay = INITIAL_RETRY_DELAY * Math.pow(BACKOFF_MULTIPLIER, state.reconnectAttempts);\n state.reconnectTimeout = setTimeout(async () => {\n state.reconnectAttempts++;\n logger.info(`Attempting to reconnect to ${name} (attempt ${state.reconnectAttempts})...`);\n const config = this.connections.get(name)?.server.config;\n if (config) {\n try {\n await this.initializeConnection(name, JSON.parse(config));\n } catch (err) {\n logger.error(\n { error: errMsg(err), serverName: name },\n `Reconnect attempt failed for ${name}`\n );\n this.handleDisconnection(name, err);\n }\n }\n }, delay);\n }\n\n async deleteConnection(name: string): Promise<void> {\n const connection = this.connections.get(name);\n if (connection) {\n try {\n await connection.transport.close();\n await connection.client.close();\n } catch (error) {\n logger.error(\n { error: errMsg(error), serverName: name },\n `Failed to close transport for ${name}`\n );\n }\n this.connections.delete(name);\n }\n const state = this.connectionStates.get(name);\n if (state) {\n if (state.pingInterval) clearInterval(state.pingInterval);\n if (state.reconnectTimeout) clearTimeout(state.reconnectTimeout);\n this.connectionStates.delete(name);\n }\n }\n\n private async buildStdioClientTransport(name: string, config: StdioMcpServerConfig) {\n if (!config.command) {\n throw new Error(`Missing command for stdio MCP server ${name}`);\n }\n\n return new StdioClientTransport({\n command: config.command,\n args: config.args,\n env: {\n ...config.env,\n ...(process.env.PATH ? { PATH: process.env.PATH } : {}),\n },\n stderr: \"pipe\",\n cwd: config.cwd,\n });\n }\n\n private async buildHttpClientTransport(\n name: string,\n config: HttpMcpServerConfig\n ): Promise<SSEClientTransport | StreamableHTTPClientTransport> {\n if (!config.url) throw new Error(`Missing URL for MCP server ${name}`);\n\n const url = new URL(config.url);\n const opts = config.headers ? { requestInit: { headers: config.headers } } : undefined;\n\n if (config.type === \"sse\") {\n logger.warn(`[MCP] \"${name}\": SSE requires Redis. Use \"streamable-http\" instead.`);\n return new SSEClientTransport(url, opts);\n }\n\n return new StreamableHTTPClientTransport(url, opts);\n }\n\n private appendErrorMessage(connection: McpConnection, error: string) {\n connection.server.error = connection.server.error\n ? `${connection.server.error}\\n${error}`\n : error;\n }\n\n private async fetchToolsList(serverName: string): Promise<Tool[]> {\n const connection = this.connections.get(serverName);\n if (!connection) return [];\n\n try {\n const response = await connection.client.listTools();\n return (response?.tools || []).map((tool) => {\n if (!tool.inputSchema) return tool;\n\n if (!this.compatibilityInitialized) this.initializeToolCompatibility();\n\n try {\n return { ...tool, inputSchema: this.applyToolCompatibility(tool.inputSchema) };\n } catch {\n return tool;\n }\n });\n } catch (error) {\n logger.error({ error: errMsg(error), serverName }, `Failed to fetch tools: ${serverName}`);\n return [];\n }\n }\n\n private async fetchResourcesList(name: string): Promise<Resource[]> {\n const conn = this.connections.get(name);\n if (!conn) return [];\n try {\n return (await conn.client.listResources())?.resources || [];\n } catch (error) {\n logger.debug({ error: errMsg(error), serverName: name }, `No resources for ${name}`);\n return [];\n }\n }\n\n private async fetchResourceTemplatesList(name: string): Promise<ResourceTemplate[]> {\n const conn = this.connections.get(name);\n if (!conn) return [];\n try {\n return (await conn.client.listResourceTemplates())?.resourceTemplates || [];\n } catch (error) {\n logger.debug({ error: errMsg(error), serverName: name }, `No resource templates for ${name}`);\n return [];\n }\n }\n\n public getServers(): McpServer[] {\n return Array.from(this.connections.values())\n .filter((conn) => !conn.server.disabled)\n .map((conn) => conn.server);\n }\n\n public getProviderData(): McpProvider {\n return this.mcpProvider;\n }\n\n public async callTool(\n serverName: string,\n toolName: string,\n args?: Record<string, unknown>\n ): Promise<CallToolResult> {\n const conn = this.connections.get(serverName);\n if (!conn) throw new Error(`No connection: ${serverName}`);\n if (conn.server.disabled) throw new Error(`Server disabled: ${serverName}`);\n\n const config = JSON.parse(conn.server.config) as StdioMcpServerConfig | HttpMcpServerConfig;\n const timeout =\n (config.type === \"stdio\" ? config.timeoutInMillis : config.timeout) ??\n DEFAULT_MCP_TIMEOUT_SECONDS;\n\n const result = await conn.client.callTool({ name: toolName, arguments: args }, undefined, {\n timeout,\n });\n if (!result.content) throw new Error(\"Invalid tool result: missing content\");\n return result as CallToolResult;\n }\n\n public async readResource(serverName: string, uri: string): Promise<McpResourceResponse> {\n const conn = this.connections.get(serverName);\n if (!conn) throw new Error(`No connection: ${serverName}`);\n if (conn.server.disabled) throw new Error(`Server disabled: ${serverName}`);\n return conn.client.readResource({ uri });\n }\n\n public async restartConnection(serverName: string): Promise<void> {\n const conn = this.connections.get(serverName);\n if (!conn) throw new Error(`No connection: ${serverName}`);\n\n const config = conn.server.config;\n conn.server.status = \"connecting\";\n conn.server.error = \"\";\n\n await this.deleteConnection(serverName);\n await this.initializeConnection(serverName, JSON.parse(config));\n }\n\n private initializeToolCompatibility(): void {\n if (this.compatibilityInitialized) return;\n this.toolCompatibility = createMcpToolCompatibility(this.runtime);\n this.compatibilityInitialized = true;\n }\n\n public applyToolCompatibility(toolSchema: any): any {\n if (!this.compatibilityInitialized) this.initializeToolCompatibility();\n if (!this.toolCompatibility || !toolSchema) return toolSchema;\n\n try {\n return this.toolCompatibility.transformToolSchema(toolSchema);\n } catch {\n return toolSchema;\n }\n }\n}\n"
|
|
14
|
+
"import Ajv from \"ajv\";\nimport JSON5 from \"json5\";\n\n/** Find matching closing bracket/brace using depth counting */\nfunction findMatchingClose(str: string, start: number, open: string, close: string): number {\n let depth = 0;\n let inString = false;\n let escape = false;\n\n for (let i = start; i < str.length; i++) {\n const ch = str[i];\n\n if (escape) {\n escape = false;\n continue;\n }\n\n if (ch === '\\\\' && inString) {\n escape = true;\n continue;\n }\n\n if (ch === '\"') {\n inString = !inString;\n continue;\n }\n\n if (inString) continue;\n\n if (ch === open) depth++;\n else if (ch === close) {\n depth--;\n if (depth === 0) return i;\n }\n }\n return -1;\n}\n\nexport function parseJSON<T>(input: string): T {\n // Remove code blocks\n let cleanedInput = input.replace(/^```(?:json)?\\s*|\\s*```$/g, \"\").trim();\n\n // Find first JSON start character\n const firstBrace = cleanedInput.indexOf('{');\n const firstBracket = cleanedInput.indexOf('[');\n\n // Determine which comes first (or only one exists)\n let start = -1;\n let isArray = false;\n\n if (firstBrace === -1 && firstBracket === -1) {\n // No JSON found, try parsing as-is (might be primitive)\n return JSON5.parse(cleanedInput);\n } else if (firstBrace === -1) {\n start = firstBracket;\n isArray = true;\n } else if (firstBracket === -1) {\n start = firstBrace;\n isArray = false;\n } else {\n // Both exist, use whichever comes first\n if (firstBracket < firstBrace) {\n start = firstBracket;\n isArray = true;\n } else {\n start = firstBrace;\n isArray = false;\n }\n }\n\n // Find matching closing character\n const end = isArray\n ? findMatchingClose(cleanedInput, start, '[', ']')\n : findMatchingClose(cleanedInput, start, '{', '}');\n\n if (end !== -1) {\n cleanedInput = cleanedInput.substring(start, end + 1);\n }\n\n return JSON5.parse(cleanedInput);\n}\n\nconst ajv = new Ajv({\n allErrors: true,\n strict: false,\n});\n\nexport function validateJsonSchema<T = unknown>(\n data: unknown,\n schema: Record<string, unknown>\n): { success: true; data: T } | { success: false; error: string } {\n try {\n const validate = ajv.compile(schema);\n const valid = validate(data);\n\n if (!valid) {\n const errors = (validate.errors || []).map((err: any) => {\n const path = err.instancePath ? `${err.instancePath.replace(/^\\//, \"\")}` : \"value\";\n return `${path}: ${err.message}`;\n });\n\n return { success: false, error: errors.join(\", \") };\n }\n\n return { success: true, data: data as T };\n } catch (error) {\n return {\n success: false,\n error: `Schema validation error: ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n}\n",
|
|
15
|
+
"import type { State } from \"@elizaos/core\";\nimport { type McpProviderData, ResourceSelectionSchema, type ValidationResult } from \"../types\";\nimport { validateJsonSchema } from \"./json\";\n\nexport interface ResourceSelection {\n serverName: string;\n uri: string;\n reasoning?: string;\n noResourceAvailable?: boolean;\n}\n\nexport function validateResourceSelection(\n selection: unknown\n): ValidationResult<ResourceSelection> {\n return validateJsonSchema<ResourceSelection>(selection, ResourceSelectionSchema);\n}\n\nexport function createResourceSelectionFeedbackPrompt(\n originalResponse: string,\n errorMessage: string,\n composedState: State,\n userMessage: string\n): string {\n let description = \"\";\n\n for (const [serverName, server] of Object.entries(composedState.values.mcp || {}) as [\n string,\n McpProviderData[string],\n ][]) {\n if (server.status !== \"connected\") continue;\n\n for (const [uri, resource] of Object.entries(server.resources || {}) as [\n string,\n { description?: string; name?: string },\n ][]) {\n description += `Resource: ${uri} (Server: ${serverName})\\n`;\n description += `Name: ${resource.name || \"No name\"}\\n`;\n description += `Description: ${resource.description || \"No description\"}\\n\\n`;\n }\n }\n\n return `Error parsing JSON: ${errorMessage}\n\nYour original response:\n${originalResponse}\n\nPlease try again with valid JSON for resource selection.\nAvailable resources:\n${description}\n\nUser request: ${userMessage}`;\n}\n",
|
|
16
|
+
"import {\n type HandlerCallback,\n type Memory,\n type IAgentRuntime,\n type State,\n logger,\n ModelType,\n} from \"@elizaos/core\";\nimport { parseJSON } from \"./json\";\nimport { DEFAULT_MAX_RETRIES, type ValidationResult } from \"../types\";\n\nexport interface WithModelRetryOptions<T> {\n runtime: IAgentRuntime;\n message: Memory;\n state: State;\n input: string | object;\n validationFn: (data: unknown) => ValidationResult<T>;\n createFeedbackPromptFn: (original: string | object, error: string, state: State, userMsg: string) => string;\n callback?: HandlerCallback;\n failureMsg?: string;\n retryCount?: number;\n}\n\n/**\n * Retries model selection with feedback on parse errors\n */\nexport async function withModelRetry<T>({\n runtime,\n message,\n state,\n callback,\n input,\n validationFn,\n createFeedbackPromptFn,\n failureMsg,\n retryCount = 0,\n}: WithModelRetryOptions<T>): Promise<T | null> {\n const maxRetries = getMaxRetries(runtime);\n\n try {\n const parsed = typeof input === \"string\" ? parseJSON<unknown>(input) : input;\n const result = validationFn(parsed);\n if (!result.success) throw new Error(result.error);\n return result.data as T;\n } catch (e) {\n const error = e instanceof Error ? e.message : \"Parse error\";\n logger.error({ error }, \"[Retry] Parse failed\");\n\n if (retryCount < maxRetries) {\n const feedback = createFeedbackPromptFn(input, error, state, message.content.text || \"\");\n const retry = await runtime.useModel(ModelType.OBJECT_LARGE, { prompt: feedback });\n return withModelRetry({\n runtime,\n input: retry,\n validationFn,\n message,\n state,\n createFeedbackPromptFn,\n callback,\n failureMsg,\n retryCount: retryCount + 1,\n });\n }\n\n if (callback && failureMsg) {\n await callback({ text: failureMsg, thought: \"Parse failed after retries\", actions: [\"REPLY\"] });\n }\n return null;\n }\n}\n\nfunction getMaxRetries(runtime: IAgentRuntime): number {\n try {\n const mcp = runtime.getSetting(\"mcp\");\n if (mcp?.maxRetries !== undefined) {\n const val = Number(mcp.maxRetries);\n if (!isNaN(val) && val >= 0) return val;\n }\n } catch (e) {\n logger.debug({ error: e instanceof Error ? e.message : e }, \"[Retry] Failed to get maxRetries setting\");\n }\n return DEFAULT_MAX_RETRIES;\n}\n",
|
|
17
|
+
"import type { IAgentRuntime, Memory, Provider, State } from \"@elizaos/core\";\nimport type { McpService } from \"./service\";\nimport { MCP_SERVICE_NAME } from \"./types\";\n\nconst EMPTY_PROVIDER = { values: { mcp: {} }, data: { mcp: {} }, text: \"No MCP servers available.\" };\n\nexport const provider: Provider = {\n name: \"MCP\",\n description: \"Connected MCP servers, tools, and resources\",\n\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n const svc = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!svc) return EMPTY_PROVIDER;\n await svc.waitForInitialization();\n return svc.getProviderData();\n },\n};\n",
|
|
18
|
+
"import { type Action, type IAgentRuntime, Service, logger } from \"@elizaos/core\";\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { SSEClientTransport } from \"@modelcontextprotocol/sdk/client/sse.js\";\nimport { StreamableHTTPClientTransport } from \"@modelcontextprotocol/sdk/client/streamableHttp.js\";\nimport { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\nimport type { CallToolResult, Resource, ResourceTemplate, Tool } from \"@modelcontextprotocol/sdk/types.js\";\n\nimport { createMcpToolActions, type McpToolAction } from \"./actions/dynamic-tool-actions\";\nimport { getSchemaCache, McpSchemaCache } from \"./cache\";\nimport {\n MCP_SERVICE_NAME,\n DEFAULT_MCP_TIMEOUT_SECONDS,\n DEFAULT_PING_CONFIG,\n MAX_RECONNECT_ATTEMPTS,\n BACKOFF_MULTIPLIER,\n INITIAL_RETRY_DELAY,\n type McpConnection,\n type McpProvider,\n type McpServer,\n type McpServerConfig,\n type McpSettings,\n type HttpMcpServerConfig,\n type StdioMcpServerConfig,\n type ConnectionState,\n type PingConfig,\n} from \"./types\";\nimport { buildMcpProviderData } from \"./utils/mcp\";\nimport { createMcpToolCompatibilitySync, type McpToolCompatibility } from \"./tool-compatibility\";\n\nconst err = (e: unknown): string => (e instanceof Error ? e.message : String(e));\n\nexport class McpService extends Service {\n static serviceType = MCP_SERVICE_NAME;\n capabilityDescription = \"Enables the agent to interact with MCP servers\";\n\n private connections = new Map<string, McpConnection>();\n private connectionStates = new Map<string, ConnectionState>();\n private mcpProvider: McpProvider = { values: { mcp: {}, mcpText: \"\" }, data: { mcp: {} }, text: \"\" };\n private pingConfig: PingConfig = DEFAULT_PING_CONFIG;\n private toolCompatibility: McpToolCompatibility | null = null;\n private initPromise: Promise<void> | null = null;\n private registeredActions = new Map<string, McpToolAction>();\n private schemaCache = getSchemaCache();\n private lazyConnections = new Map<string, McpServerConfig>();\n\n constructor(runtime: IAgentRuntime) {\n super(runtime);\n this.initPromise = this.init();\n }\n\n static async start(runtime: IAgentRuntime): Promise<McpService> {\n const svc = new McpService(runtime);\n await svc.initPromise;\n return svc;\n }\n\n async waitForInitialization(): Promise<void> {\n await this.initPromise;\n }\n\n async stop(): Promise<void> {\n for (const name of this.connections.keys()) {\n await this.disconnect(name);\n }\n }\n\n // ─── Initialization ────────────────────────────────────────────────────────\n\n private async init(): Promise<void> {\n try {\n const settings = this.getSettings();\n if (!settings?.servers || Object.keys(settings.servers).length === 0) {\n this.mcpProvider = buildMcpProviderData([]);\n return;\n }\n\n const start = Date.now();\n const entries = Object.entries(settings.servers);\n const results = { cached: [] as string[], connected: [] as string[], failed: [] as string[] };\n\n await Promise.allSettled(\n entries.map(async ([name, config]) => {\n try {\n const hash = this.schemaCache.hashConfig(config);\n\n // Try cache first\n if (this.schemaCache.isEnabled) {\n const cached = await this.schemaCache.getSchemas(this.runtime.agentId, name, hash);\n if (cached) {\n this.registerToolsAsActions(name, McpSchemaCache.toTools(cached));\n this.lazyConnections.set(name, config);\n results.cached.push(`${name}:${cached.tools.length}`);\n return;\n }\n }\n\n // Connect directly\n await this.connect(name, config);\n const server = this.connections.get(name)?.server;\n if (this.schemaCache.isEnabled && server?.tools?.length) {\n await this.schemaCache.setSchemas(this.runtime.agentId, name, hash, server.tools);\n }\n results.connected.push(`${name}:${server?.tools?.length || 0}`);\n } catch (e) {\n logger.error({ error: err(e), server: name }, `[MCP] Failed: ${name}`);\n results.failed.push(name);\n }\n })\n );\n\n const total = results.cached.length + results.connected.length;\n logger.info(\n `[MCP] Ready ${total}/${entries.length} in ${Date.now() - start}ms ` +\n `(${results.cached.length} cached, ${results.connected.length} connected, ${results.failed.length} failed)`\n );\n\n this.mcpProvider = buildMcpProviderData(this.getServers());\n } catch (e) {\n logger.error({ error: err(e) }, \"[MCP] Init failed\");\n this.mcpProvider = buildMcpProviderData([]);\n }\n }\n\nprivate getSettings(): McpSettings | undefined {\n let s = this.runtime.getSetting(\"mcp\");\n if (!s?.servers) s = (this.runtime as any).character?.settings?.mcp;\n if (!s?.servers) s = (this.runtime as any).settings?.mcp;\n return s?.servers ? (s as McpSettings) : undefined;\n }\n\n // ─── Connection Management ─────────────────────────────────────────────────\n\n private async connect(name: string, config: McpServerConfig): Promise<void> {\n await this.disconnect(name);\n const state: ConnectionState = { status: \"connecting\", reconnectAttempts: 0, consecutivePingFailures: 0 };\n this.connectionStates.set(name, state);\n\n try {\n const client = new Client({ name: \"ElizaOS\", version: \"1.0.0\" }, { capabilities: {} });\n const transport = config.type === \"stdio\"\n ? this.createStdioTransport(name, config)\n : this.createHttpTransport(name, config);\n\n const conn: McpConnection = {\n server: { name, config: JSON.stringify(config), status: \"connecting\" },\n client,\n transport: transport as any,\n };\n this.connections.set(name, conn);\n this.setupTransportHandlers(name, conn, state, config.type === \"stdio\");\n\n await Promise.race([\n client.connect(transport),\n new Promise<never>((_, rej) => setTimeout(() => rej(new Error(\"Connection timeout\")), 60000)),\n ]);\n\n const caps = client.getServerCapabilities();\n const tools = await this.fetchTools(name);\n const resources = caps?.resources ? await this.fetchResources(name) : [];\n const resourceTemplates = caps?.resources ? await this.fetchResourceTemplates(name) : [];\n\n conn.server = { status: \"connected\", name, config: JSON.stringify(config), error: \"\", tools, resources, resourceTemplates };\n state.status = \"connected\";\n state.lastConnected = new Date();\n state.reconnectAttempts = 0;\n state.consecutivePingFailures = 0;\n\n if (config.type === \"stdio\") this.startPingMonitor(name);\n this.registerToolsAsActions(name, tools);\n\n logger.info(`[MCP] Connected: ${name} (${tools?.length || 0} tools)`);\n } catch (e) {\n state.status = \"disconnected\";\n state.lastError = e instanceof Error ? e : new Error(String(e));\n this.handleDisconnect(name, e);\n throw e;\n }\n }\n\n async disconnect(name: string): Promise<void> {\n this.unregisterToolsAsActions(name);\n const conn = this.connections.get(name);\n if (conn) {\n try {\n await conn.transport.close();\n await conn.client.close();\n } catch (e) {\n logger.debug({ error: err(e), server: name }, `[MCP] Error during disconnect (expected during shutdown)`);\n }\n this.connections.delete(name);\n }\n const state = this.connectionStates.get(name);\n if (state) {\n if (state.pingInterval) clearInterval(state.pingInterval);\n if (state.reconnectTimeout) clearTimeout(state.reconnectTimeout);\n this.connectionStates.delete(name);\n }\n }\n\n private createStdioTransport(name: string, config: StdioMcpServerConfig): StdioClientTransport {\n if (!config.command) throw new Error(`Missing command for stdio server ${name}`);\n return new StdioClientTransport({\n command: config.command,\n args: config.args,\n env: { ...config.env, ...(process.env.PATH ? { PATH: process.env.PATH } : {}) },\n stderr: \"pipe\",\n cwd: config.cwd,\n });\n }\n\n private createHttpTransport(name: string, config: HttpMcpServerConfig): SSEClientTransport | StreamableHTTPClientTransport {\n if (!config.url) throw new Error(`Missing URL for server ${name}`);\n const url = new URL(config.url);\n const opts = config.headers ? { requestInit: { headers: config.headers } } : undefined;\n return config.type === \"sse\" ? new SSEClientTransport(url, opts) : new StreamableHTTPClientTransport(url, opts);\n }\n\n private setupTransportHandlers(name: string, conn: McpConnection, state: ConnectionState, isStdio: boolean): void {\n conn.transport.onerror = async (e) => {\n const msg = e?.message || \"\";\n if (isStdio || (!msg.includes(\"SSE\") && !msg.includes(\"timeout\") && msg !== \"undefined\")) {\n logger.error({ error: e, server: name }, `[MCP] Transport error: ${name}`);\n conn.server.status = \"disconnected\";\n conn.server.error = (conn.server.error || \"\") + \"\\n\" + msg;\n }\n if (isStdio) this.handleDisconnect(name, e);\n };\n\n conn.transport.onclose = async () => {\n if (isStdio) {\n conn.server.status = \"disconnected\";\n this.handleDisconnect(name, new Error(\"Transport closed\"));\n }\n };\n }\n\n // ─── Ping & Reconnect ──────────────────────────────────────────────────────\n\n private startPingMonitor(name: string): void {\n const state = this.connectionStates.get(name);\n if (!state || !this.pingConfig.enabled) return;\n if (state.pingInterval) clearInterval(state.pingInterval);\n\n state.pingInterval = setInterval(async () => {\n const conn = this.connections.get(name);\n if (!conn) return;\n try {\n await Promise.race([\n conn.client.listTools(),\n new Promise((_, r) => setTimeout(() => r(new Error(\"Ping timeout\")), this.pingConfig.timeoutMs)),\n ]);\n state.consecutivePingFailures = 0;\n } catch (e) {\n state.consecutivePingFailures++;\n if (state.consecutivePingFailures >= this.pingConfig.failuresBeforeDisconnect) {\n this.handleDisconnect(name, e);\n }\n }\n }, this.pingConfig.intervalMs);\n }\n\n private handleDisconnect(name: string, error: unknown): void {\n const state = this.connectionStates.get(name);\n if (!state) return;\n state.status = \"disconnected\";\n state.lastError = error instanceof Error ? error : new Error(String(error));\n if (state.pingInterval) clearInterval(state.pingInterval);\n if (state.reconnectTimeout) clearTimeout(state.reconnectTimeout);\n\n if (state.reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {\n logger.error(`[MCP] Max reconnect attempts for ${name}`);\n return;\n }\n\n const delay = INITIAL_RETRY_DELAY * Math.pow(BACKOFF_MULTIPLIER, state.reconnectAttempts);\n state.reconnectTimeout = setTimeout(async () => {\n state.reconnectAttempts++;\n const config = this.connections.get(name)?.server.config;\n if (config) {\n try {\n await this.connect(name, JSON.parse(config));\n } catch (e) {\n this.handleDisconnect(name, e);\n }\n }\n }, delay);\n }\n\n // ─── Data Fetching ─────────────────────────────────────────────────────────\n\n private async fetchTools(name: string): Promise<Tool[]> {\n const conn = this.connections.get(name);\n if (!conn) return [];\n try {\n const res = await conn.client.listTools();\n return (res?.tools || []).map(t => {\n if (!t.inputSchema) return t;\n if (!this.toolCompatibility) this.toolCompatibility = createMcpToolCompatibilitySync(this.runtime);\n try {\n return { ...t, inputSchema: this.toolCompatibility.transformToolSchema(t.inputSchema) };\n } catch (e) {\n logger.debug({ error: err(e), tool: t.name }, `[MCP] Schema transform failed, using original`);\n return t;\n }\n });\n } catch (e) {\n logger.warn({ error: err(e), server: name }, `[MCP] Failed to fetch tools`);\n return [];\n }\n }\n\n private async fetchResources(name: string): Promise<Resource[]> {\n try {\n return (await this.connections.get(name)?.client.listResources())?.resources || [];\n } catch (e) {\n logger.debug({ error: err(e), server: name }, `[MCP] Failed to fetch resources`);\n return [];\n }\n }\n\n private async fetchResourceTemplates(name: string): Promise<ResourceTemplate[]> {\n try {\n return (await this.connections.get(name)?.client.listResourceTemplates())?.resourceTemplates || [];\n } catch (e) {\n logger.debug({ error: err(e), server: name }, `[MCP] Failed to fetch resource templates`);\n return [];\n }\n }\n\n // ─── Action Registration ───────────────────────────────────────────────────\n\n private registerToolsAsActions(serverName: string, tools: Tool[]): void {\n if (!tools?.length) return;\n\n const existing = new Set([...this.runtime.actions.map(a => a.name), ...this.registeredActions.keys()]);\n const actions = createMcpToolActions(serverName, tools, existing);\n\n for (const action of actions) {\n if (!this.registeredActions.has(action.name)) {\n this.runtime.registerAction(action);\n this.registeredActions.set(action.name, action);\n }\n }\n\n logger.info(`[MCP] Registered ${actions.length} actions for ${serverName}`);\n }\n\n private unregisterToolsAsActions(serverName: string): void {\n const toRemove: string[] = [];\n for (const [name, action] of this.registeredActions) {\n if (action._mcpMeta.serverName === serverName) toRemove.push(name);\n }\n\n for (const name of toRemove) {\n const idx = this.runtime.actions.findIndex(a => a.name === name);\n if (idx !== -1) this.runtime.actions.splice(idx, 1);\n this.registeredActions.delete(name);\n }\n }\n\n // ─── Public API ────────────────────────────────────────────────────────────\n\n getServers(): McpServer[] {\n return Array.from(this.connections.values())\n .filter(c => !c.server.disabled)\n .map(c => c.server);\n }\n\n getProviderData(): McpProvider {\n return this.mcpProvider;\n }\n\n getRegisteredActions(): McpToolAction[] {\n return Array.from(this.registeredActions.values());\n }\n\n isLazyConnection(serverName: string): boolean {\n return this.lazyConnections.has(serverName);\n }\n\n async ensureConnected(serverName: string): Promise<void> {\n if (this.connections.has(serverName)) return;\n\n const config = this.lazyConnections.get(serverName);\n if (!config) throw new Error(`Unknown server: ${serverName}`);\n\n const start = Date.now();\n await this.connect(serverName, config);\n this.lazyConnections.delete(serverName);\n\n const server = this.connections.get(serverName)?.server;\n if (this.schemaCache.isEnabled && server?.tools?.length) {\n await this.schemaCache.setSchemas(this.runtime.agentId, serverName, this.schemaCache.hashConfig(config), server.tools);\n }\n\n logger.info(`[MCP] Lazy connected: ${serverName} in ${Date.now() - start}ms`);\n this.mcpProvider = buildMcpProviderData(this.getServers());\n }\n\n async callTool(serverName: string, toolName: string, args?: Record<string, unknown>): Promise<CallToolResult> {\n await this.ensureConnected(serverName);\n const conn = this.connections.get(serverName);\n if (!conn) throw new Error(`No connection: ${serverName}`);\n if (conn.server.disabled) throw new Error(`Server disabled: ${serverName}`);\n\n const config = JSON.parse(conn.server.config);\n const timeout = config.timeoutInMillis || DEFAULT_MCP_TIMEOUT_SECONDS;\n const result = await conn.client.callTool({ name: toolName, arguments: args }, undefined, { timeout });\n if (!result.content) throw new Error(\"Invalid tool result\");\n return result as CallToolResult;\n }\n\n async readResource(serverName: string, uri: string): Promise<any> {\n await this.ensureConnected(serverName);\n const conn = this.connections.get(serverName);\n if (!conn) throw new Error(`No connection: ${serverName}`);\n if (conn.server.disabled) throw new Error(`Server disabled: ${serverName}`);\n return conn.client.readResource({ uri });\n }\n\n async restartConnection(serverName: string): Promise<void> {\n const conn = this.connections.get(serverName);\n if (!conn) throw new Error(`No connection: ${serverName}`);\n const config = conn.server.config;\n await this.disconnect(serverName);\n await this.connect(serverName, JSON.parse(config));\n }\n}\n",
|
|
19
|
+
"import {\n type Action,\n type ActionResult,\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n type State,\n logger,\n} from \"@elizaos/core\";\nimport type { Tool } from \"@modelcontextprotocol/sdk/types.js\";\nimport type { McpService } from \"../service\";\nimport { MCP_SERVICE_NAME } from \"../types\";\nimport { type ActionParameter, convertJsonSchemaToActionParams, validateParamsAgainstSchema } from \"../utils/schema-converter\";\nimport { toActionName, generateSimiles, makeUniqueActionName } from \"../utils/action-naming\";\nimport { processToolResult } from \"../utils/processing\";\n\nexport interface McpToolAction extends Action {\n parameters?: Record<string, ActionParameter>;\n _mcpMeta: { serverName: string; toolName: string; originalSchema: Tool[\"inputSchema\"] };\n}\n\nfunction extractParams(message: Memory, state?: State): Record<string, unknown> {\n const content = message.content as Record<string, unknown>;\n return (content.actionParams as Record<string, unknown>) ||\n (content.actionInput as Record<string, unknown>) ||\n (state?.data?.actionParams as Record<string, unknown>) ||\n {};\n}\n\nexport function createMcpToolAction(serverName: string, tool: Tool, existingNames: Set<string>): McpToolAction {\n const actionName = makeUniqueActionName(serverName, tool.name, existingNames);\n const description = `${tool.description || `Execute ${tool.name}`} (MCP: ${serverName}/${tool.name})`;\n\n return {\n name: actionName,\n description,\n similes: generateSimiles(serverName, tool.name),\n parameters: convertJsonSchemaToActionParams(tool.inputSchema),\n\n validate: async (runtime: IAgentRuntime) => {\n const svc = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!svc) return false;\n if (svc.isLazyConnection(serverName)) return true;\n\n const server = svc.getServers().find(s => s.name === serverName);\n return server?.status === \"connected\" && !!server.tools?.some(t => t.name === tool.name);\n },\n\n handler: async (runtime, message, state, _options, callback): Promise<ActionResult> => {\n const svc = runtime.getService<McpService>(MCP_SERVICE_NAME);\n if (!svc) {\n return { success: false, error: \"MCP service not available\", data: { actionName, serverName, toolName: tool.name } };\n }\n\n const params = extractParams(message, state);\n logger.info({ serverName, toolName: tool.name, params }, `[MCP] Executing ${actionName}`);\n\n const errors = validateParamsAgainstSchema(params, tool.inputSchema);\n const missing = errors.filter(e => e.startsWith(\"Missing required\"));\n if (missing.length > 0) {\n logger.error({ missing, params }, `[MCP] Missing required params for ${actionName}`);\n return { success: false, error: missing.join(\", \"), data: { actionName, serverName, toolName: tool.name } };\n }\n\n const warnings = errors.filter(e => !e.startsWith(\"Missing required\"));\n if (warnings.length > 0) {\n logger.warn({ warnings, params }, `[MCP] Type warnings for ${actionName}`);\n }\n\n const result = await svc.callTool(serverName, tool.name, params);\n const { toolOutput, hasAttachments, attachments } = processToolResult(result, serverName, tool.name, runtime, message.entityId);\n\n if (result.isError) {\n logger.error({ serverName, toolName: tool.name, output: toolOutput }, `[MCP] Tool error`);\n return {\n success: false,\n error: toolOutput || \"Tool execution failed\",\n text: toolOutput,\n data: { actionName, serverName, toolName: tool.name, toolArguments: params, isError: true },\n };\n }\n\n if (callback && hasAttachments && attachments.length > 0) {\n await callback({ text: `Executed ${serverName}/${tool.name}`, attachments });\n }\n\n return {\n success: true,\n text: toolOutput,\n values: { success: true, serverName, toolName: tool.name, hasAttachments, output: toolOutput },\n data: { actionName, serverName, toolName: tool.name, toolArguments: params, output: toolOutput, attachments: attachments.length > 0 ? attachments : undefined },\n };\n },\n\n examples: [[\n { name: \"{{user}}\", content: { text: `Can you use ${tool.name}?` } },\n { name: \"{{assistant}}\", content: { text: `I'll execute ${tool.name} for you.`, actions: [actionName] } },\n ]],\n\n _mcpMeta: { serverName, toolName: tool.name, originalSchema: tool.inputSchema },\n };\n}\n\nexport function createMcpToolActions(serverName: string, tools: Tool[], existingNames: Set<string>): McpToolAction[] {\n const actions = tools.map(tool => {\n const action = createMcpToolAction(serverName, tool, existingNames);\n existingNames.add(action.name);\n logger.debug({ actionName: action.name, serverName, toolName: tool.name }, `[MCP] Created action`);\n return action;\n });\n\n logger.info({ serverName, toolCount: actions.length }, `[MCP] Created ${actions.length} actions for ${serverName}`);\n return actions;\n}\n\nexport function isMcpToolAction(action: Action): action is McpToolAction {\n return \"_mcpMeta\" in action && typeof (action as McpToolAction)._mcpMeta === \"object\";\n}\n\nexport function getMcpToolActionsForServer(actions: Action[], serverName: string): McpToolAction[] {\n return actions.filter((a): a is McpToolAction => isMcpToolAction(a) && a._mcpMeta.serverName === serverName);\n}\n",
|
|
20
|
+
"import type { Tool } from \"@modelcontextprotocol/sdk/types.js\";\n\nexport interface ActionParameter {\n type: \"string\" | \"number\" | \"boolean\" | \"object\" | \"array\";\n description: string;\n required?: boolean;\n}\n\ninterface JsonSchemaProperty {\n type?: string | string[];\n description?: string;\n enum?: unknown[];\n default?: unknown;\n items?: JsonSchemaProperty;\n properties?: Record<string, JsonSchemaProperty>;\n required?: string[];\n format?: string;\n minimum?: number;\n maximum?: number;\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n}\n\nfunction mapJsonSchemaType(jsonType: string | string[] | undefined): ActionParameter[\"type\"] {\n if (Array.isArray(jsonType)) {\n return mapJsonSchemaType(jsonType.find(t => t !== \"null\"));\n }\n switch (jsonType) {\n case \"string\": return \"string\";\n case \"number\": case \"integer\": return \"number\";\n case \"boolean\": return \"boolean\";\n case \"array\": return \"array\";\n default: return \"object\";\n }\n}\n\nfunction buildDescription(name: string, prop: JsonSchemaProperty): string {\n const parts: string[] = [prop.description || `Parameter: ${name}`];\n\n if (prop.enum?.length) parts.push(`Allowed: ${prop.enum.map(v => JSON.stringify(v)).join(\", \")}`);\n if (prop.format) parts.push(`Format: ${prop.format}`);\n if (prop.minimum !== undefined || prop.maximum !== undefined) {\n parts.push(`Range: ${[prop.minimum !== undefined ? `min: ${prop.minimum}` : '', prop.maximum !== undefined ? `max: ${prop.maximum}` : ''].filter(Boolean).join(\", \")}`);\n }\n if (prop.minLength !== undefined || prop.maxLength !== undefined) {\n parts.push(`Length: ${[prop.minLength !== undefined ? `min: ${prop.minLength}` : '', prop.maxLength !== undefined ? `max: ${prop.maxLength}` : ''].filter(Boolean).join(\", \")}`);\n }\n if (prop.pattern) parts.push(`Pattern: ${prop.pattern}`);\n if (prop.default !== undefined) parts.push(`Default: ${JSON.stringify(prop.default)}`);\n if (prop.type === \"array\" && prop.items) parts.push(`Array of ${prop.items.type || \"any\"}`);\n if (prop.type === \"object\" && prop.properties) {\n const keys = Object.keys(prop.properties);\n parts.push(`Object with: ${keys.join(\", \")}`);\n }\n\n return parts.join(\". \");\n}\n\nexport function convertJsonSchemaToActionParams(schema?: Tool[\"inputSchema\"]): Record<string, ActionParameter> | undefined {\n const properties = schema?.properties as Record<string, JsonSchemaProperty> | undefined;\n if (!properties || Object.keys(properties).length === 0) return undefined;\n\n const required = new Set<string>(schema?.required as string[] || []);\n const params: Record<string, ActionParameter> = {};\n\n for (const [name, prop] of Object.entries(properties)) {\n params[name] = {\n type: mapJsonSchemaType(prop.type),\n description: buildDescription(name, prop),\n required: required.has(name),\n };\n }\n\n return Object.keys(params).length > 0 ? params : undefined;\n}\n\nexport function validateParamsAgainstSchema(params: Record<string, unknown>, schema?: Tool[\"inputSchema\"]): string[] {\n if (!schema) return [];\n\n const errors: string[] = [];\n const properties = schema.properties as Record<string, JsonSchemaProperty> | undefined;\n const required = new Set<string>(schema.required as string[] || []);\n\n for (const field of required) {\n if (params[field] === undefined || params[field] === null) {\n errors.push(`Missing required parameter: ${field}`);\n }\n }\n\n if (properties) {\n for (const [name, value] of Object.entries(params)) {\n const prop = properties[name];\n if (!prop) continue;\n\n const expected = mapJsonSchemaType(prop.type);\n const actual = getValueType(value);\n\n if (actual !== expected && value !== null && value !== undefined) {\n errors.push(`Parameter '${name}' expected ${expected}, got ${actual}`);\n }\n if (prop.enum && !prop.enum.includes(value)) {\n errors.push(`Parameter '${name}' must be one of: ${prop.enum.map(v => JSON.stringify(v)).join(\", \")}`);\n }\n }\n }\n\n return errors;\n}\n\nfunction getValueType(value: unknown): ActionParameter[\"type\"] {\n if (Array.isArray(value)) return \"array\";\n if (value === null) return \"object\";\n switch (typeof value) {\n case \"string\": return \"string\";\n case \"number\": return \"number\";\n case \"boolean\": return \"boolean\";\n default: return \"object\";\n }\n}\n",
|
|
21
|
+
"function normalize(str: string): string {\n return str.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\").replace(/_+/g, \"_\").replace(/^_|_$/g, \"\");\n}\n\nexport function toActionName(serverName: string, toolName: string): string {\n const server = normalize(serverName);\n const tool = normalize(toolName);\n\n if (!server) return tool || \"_\";\n if (!tool) return server + \"_\";\n if (tool.startsWith(server + \"_\")) return tool;\n\n return `${server}_${tool}`;\n}\n\nexport function generateSimiles(serverName: string, toolName: string): string[] {\n const tool = normalize(toolName);\n const fullName = toActionName(serverName, toolName);\n\n const similes = [\n tool,\n `${serverName}/${toolName}`,\n `${serverName.toLowerCase()}/${toolName.toLowerCase()}`,\n `MCP_${fullName}`,\n ];\n\n const parts = toolName.split(\"_\");\n if (parts.length === 2) {\n const reversed = `${parts[1]}_${parts[0]}`.toUpperCase();\n if (reversed !== tool) similes.push(reversed);\n }\n\n return [...new Set(similes)].filter(s => s !== fullName);\n}\n\nexport function parseActionName(actionName: string): { serverName: string; toolName: string } | null {\n const normalized = normalize(actionName);\n const idx = normalized.indexOf(\"_\");\n if (idx === -1) return null;\n\n return {\n serverName: normalized.substring(0, idx).toLowerCase(),\n toolName: normalized.substring(idx + 1).toLowerCase(),\n };\n}\n\nexport function actionNamesCollide(name1: string, name2: string): boolean {\n return normalize(name1) === normalize(name2);\n}\n\nexport function makeUniqueActionName(serverName: string, toolName: string, existing: Set<string>): string {\n let name = toActionName(serverName, toolName);\n if (!existing.has(name)) return name;\n\n let suffix = 2;\n while (existing.has(`${name}_${suffix}`)) suffix++;\n return `${name}_${suffix}`;\n}\n",
|
|
22
|
+
"/**\n * MCP Schema Cache - Optional Redis caching for serverless cold start optimization\n *\n * When enabled (via env vars), caches tool schemas to avoid MCP connection on cold start.\n * When disabled or misconfigured, gracefully falls back to direct MCP connections.\n *\n * Environment variables:\n * - MCP_SCHEMA_CACHE_ENABLED: \"true\" to enable (default: disabled)\n * - MCP_CACHE_REDIS_URL: Upstash REST API URL (https://..., NOT rediss://)\n * - MCP_CACHE_REDIS_TOKEN: Upstash REST API token\n * - MCP_SCHEMA_CACHE_TTL: Cache TTL in seconds (default: 3600)\n */\n\nimport { createHash } from \"crypto\";\nimport { logger } from \"@elizaos/core\";\nimport type { CachedServerSchema, CachedToolSchema, McpServerConfig } from \"../types\";\nimport type { Tool } from \"@modelcontextprotocol/sdk/types.js\";\n\nconst CACHE_KEY_PREFIX = \"mcp:schema:v1\";\nconst DEFAULT_TTL = 3600;\n\n/** Simple Upstash REST client - avoids heavy dependencies */\nclass UpstashClient {\n constructor(private url: string, private token: string) {\n // Validate URL format\n if (url.startsWith(\"redis://\") || url.startsWith(\"rediss://\")) {\n throw new Error(\n \"MCP_CACHE_REDIS_URL must be Upstash REST URL (https://...), not Redis protocol URL\"\n );\n }\n this.url = url.replace(/\\/$/, \"\");\n }\n\n private async exec<T>(cmd: string[]): Promise<T | null> {\n try {\n const res = await fetch(this.url, {\n method: \"POST\",\n headers: { Authorization: `Bearer ${this.token}`, \"Content-Type\": \"application/json\" },\n body: JSON.stringify(cmd),\n });\n if (!res.ok) return null;\n const data = await res.json();\n return data.result as T;\n } catch {\n return null;\n }\n }\n\n get = (key: string) => this.exec<string>([\"GET\", key]);\n setex = (key: string, ttl: number, val: string) => this.exec([\"SETEX\", key, String(ttl), val]);\n del = (key: string) => this.exec([\"DEL\", key]);\n}\n\n/**\n * MCP Schema Cache - singleton for caching tool schemas\n */\nexport class McpSchemaCache {\n private client: UpstashClient | null = null;\n private ttl: number;\n\n constructor() {\n const enabled = process.env.MCP_SCHEMA_CACHE_ENABLED === \"true\";\n const url = process.env.MCP_CACHE_REDIS_URL;\n const token = process.env.MCP_CACHE_REDIS_TOKEN;\n this.ttl = parseInt(process.env.MCP_SCHEMA_CACHE_TTL || String(DEFAULT_TTL), 10);\n\n if (!enabled) {\n logger.debug(\"[McpSchemaCache] Disabled\");\n return;\n }\n\n if (!url || !token) {\n logger.warn(\"[McpSchemaCache] Enabled but missing MCP_CACHE_REDIS_URL or MCP_CACHE_REDIS_TOKEN\");\n return;\n }\n\n try {\n this.client = new UpstashClient(url, token);\n logger.info(`[McpSchemaCache] Enabled (TTL: ${this.ttl}s)`);\n } catch (e) {\n logger.error(`[McpSchemaCache] Init failed: ${e instanceof Error ? e.message : e}`);\n }\n }\n\n get isEnabled(): boolean {\n return this.client !== null;\n }\n\n /** Hash config to detect changes */\n hashConfig(config: McpServerConfig): string {\n // Sort keys recursively to ensure consistent hashing regardless of key order\n const sortedJson = JSON.stringify(config, (_, value) =>\n value && typeof value === \"object\" && !Array.isArray(value)\n ? Object.keys(value).sort().reduce((sorted: Record<string, unknown>, key) => {\n sorted[key] = value[key];\n return sorted;\n }, {})\n : value\n );\n return createHash(\"sha256\").update(sortedJson).digest(\"hex\").slice(0, 16);\n }\n\n private key(agentId: string, serverName: string): string {\n return `${CACHE_KEY_PREFIX}:${agentId}:${serverName}`;\n }\n\n /** Get cached schemas (returns null on miss or error) */\n async getSchemas(agentId: string, serverName: string, configHash: string): Promise<CachedServerSchema | null> {\n if (!this.client) return null;\n\n try {\n const raw = await this.client.get(this.key(agentId, serverName));\n if (!raw) return null;\n\n const cached: CachedServerSchema = JSON.parse(raw);\n if (cached.configHash !== configHash) {\n await this.client.del(this.key(agentId, serverName));\n logger.debug(`[McpSchemaCache] Config changed for ${serverName}, invalidated`);\n return null;\n }\n\n logger.info(`[McpSchemaCache] Hit: ${serverName} (${cached.tools.length} tools)`);\n return cached;\n } catch {\n return null;\n }\n }\n\n /** Cache schemas (fails silently) */\n async setSchemas(agentId: string, serverName: string, configHash: string, tools: Tool[]): Promise<void> {\n if (!this.client) return;\n\n try {\n const cached: CachedServerSchema = {\n serverName,\n tools: tools.map(t => ({ name: t.name, description: t.description, inputSchema: t.inputSchema })),\n cachedAt: Date.now(),\n configHash,\n };\n await this.client.setex(this.key(agentId, serverName), this.ttl, JSON.stringify(cached));\n logger.info(`[McpSchemaCache] Cached: ${serverName} (${tools.length} tools)`);\n } catch {\n // Silent fail - caching is optional\n }\n }\n\n /** Convert cached schemas to Tool format */\n static toTools(cached: CachedServerSchema): Tool[] {\n return cached.tools.map(t => ({\n name: t.name,\n description: t.description,\n inputSchema: t.inputSchema || { type: \"object\" as const, properties: {} },\n }));\n }\n}\n\n// Singleton\nlet instance: McpSchemaCache | null = null;\nexport function getSchemaCache(): McpSchemaCache {\n if (!instance) instance = new McpSchemaCache();\n return instance;\n}\n",
|
|
23
|
+
"import type { JSONSchema7 } from 'json-schema';\n\nexport type ModelProvider = 'openai' | 'anthropic' | 'google' | 'openrouter' | 'unknown';\n\nexport interface ModelInfo {\n provider: ModelProvider;\n modelId: string;\n supportsStructuredOutputs?: boolean;\n isReasoningModel?: boolean;\n}\n\nexport abstract class McpToolCompatibility {\n protected modelInfo: ModelInfo;\n\n constructor(modelInfo: ModelInfo) {\n this.modelInfo = modelInfo;\n }\n\n abstract shouldApply(): boolean;\n\n transformToolSchema(toolSchema: JSONSchema7): JSONSchema7 {\n return this.shouldApply() ? this.processSchema(toolSchema) : toolSchema;\n }\n\n protected processSchema(schema: JSONSchema7): JSONSchema7 {\n const processed = { ...schema };\n\n switch (processed.type) {\n case 'string':\n return this.processTypeSchema(processed, this.getUnsupportedStringProperties());\n case 'number':\n case 'integer':\n return this.processTypeSchema(processed, this.getUnsupportedNumberProperties());\n case 'array':\n return this.processArraySchema(processed);\n case 'object':\n return this.processObjectSchema(processed);\n default:\n return this.processGenericSchema(processed);\n }\n }\n\n protected processTypeSchema(schema: JSONSchema7, unsupported: string[]): JSONSchema7 {\n const processed = { ...schema };\n const constraints: Record<string, unknown> = {};\n\n // Extract all constraint properties\n for (const prop of ['minLength', 'maxLength', 'pattern', 'format', 'enum',\n 'minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf',\n 'minItems', 'maxItems', 'uniqueItems']) {\n if (schema[prop as keyof JSONSchema7] !== undefined) {\n constraints[prop] = schema[prop as keyof JSONSchema7];\n }\n }\n\n for (const prop of unsupported) {\n delete (processed as any)[prop];\n }\n\n if (Object.keys(constraints).length > 0) {\n processed.description = this.mergeDescription(schema.description, constraints);\n }\n\n return processed;\n }\n\n protected processArraySchema(schema: JSONSchema7): JSONSchema7 {\n const processed = this.processTypeSchema(schema, this.getUnsupportedArrayProperties());\n\n if (schema.items && typeof schema.items === 'object' && !Array.isArray(schema.items)) {\n processed.items = this.processSchema(schema.items as JSONSchema7);\n }\n\n return processed;\n }\n\n protected processObjectSchema(schema: JSONSchema7): JSONSchema7 {\n const processed = this.processTypeSchema(schema, this.getUnsupportedObjectProperties());\n\n if (schema.properties) {\n processed.properties = {};\n for (const [key, prop] of Object.entries(schema.properties)) {\n processed.properties[key] = typeof prop === 'object' && !Array.isArray(prop)\n ? this.processSchema(prop as JSONSchema7)\n : prop;\n }\n }\n\n return processed;\n }\n\n protected processGenericSchema(schema: JSONSchema7): JSONSchema7 {\n const processed = { ...schema };\n\n for (const key of ['oneOf', 'anyOf', 'allOf'] as const) {\n if (Array.isArray(schema[key])) {\n (processed as any)[key] = schema[key]!.map(s =>\n typeof s === 'object' ? this.processSchema(s as JSONSchema7) : s\n );\n }\n }\n\n return processed;\n }\n\n protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string {\n const json = JSON.stringify(constraints);\n return original ? `${original}\\n${json}` : json;\n }\n\n protected abstract getUnsupportedStringProperties(): string[];\n protected abstract getUnsupportedNumberProperties(): string[];\n protected abstract getUnsupportedArrayProperties(): string[];\n protected abstract getUnsupportedObjectProperties(): string[];\n}\n",
|
|
24
|
+
"import { McpToolCompatibility, type ModelInfo } from '../base.js';\n\nexport class OpenAIMcpCompatibility extends McpToolCompatibility {\n constructor(modelInfo: ModelInfo) {\n super(modelInfo);\n }\n\n shouldApply(): boolean {\n return this.modelInfo.provider === 'openai' &&\n (!this.modelInfo.supportsStructuredOutputs || this.modelInfo.isReasoningModel === true);\n }\n\n protected getUnsupportedStringProperties(): string[] {\n return this.modelInfo.isReasoningModel || this.modelInfo.modelId.includes('gpt-3.5')\n ? ['format', 'pattern']\n : ['format'];\n }\n\n protected getUnsupportedNumberProperties(): string[] {\n return this.modelInfo.isReasoningModel\n ? ['exclusiveMinimum', 'exclusiveMaximum', 'multipleOf']\n : [];\n }\n\n protected getUnsupportedArrayProperties(): string[] {\n return this.modelInfo.isReasoningModel ? ['uniqueItems'] : [];\n }\n\n protected getUnsupportedObjectProperties(): string[] {\n return ['minProperties', 'maxProperties'];\n }\n}\n\nexport class OpenAIReasoningMcpCompatibility extends McpToolCompatibility {\n constructor(modelInfo: ModelInfo) {\n super(modelInfo);\n }\n\n shouldApply(): boolean {\n return this.modelInfo.provider === 'openai' && this.modelInfo.isReasoningModel === true;\n }\n\n protected getUnsupportedStringProperties(): string[] {\n return ['format', 'pattern', 'minLength', 'maxLength'];\n }\n\n protected getUnsupportedNumberProperties(): string[] {\n return ['exclusiveMinimum', 'exclusiveMaximum', 'multipleOf'];\n }\n\n protected getUnsupportedArrayProperties(): string[] {\n return ['uniqueItems', 'minItems', 'maxItems'];\n }\n\n protected getUnsupportedObjectProperties(): string[] {\n return ['minProperties', 'maxProperties', 'additionalProperties'];\n }\n\n protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string {\n const rules: string[] = [];\n if (constraints.minLength) rules.push(`minimum ${constraints.minLength} characters`);\n if (constraints.maxLength) rules.push(`maximum ${constraints.maxLength} characters`);\n if (constraints.minimum !== undefined) rules.push(`must be >= ${constraints.minimum}`);\n if (constraints.maximum !== undefined) rules.push(`must be <= ${constraints.maximum}`);\n if (constraints.format === 'email') rules.push(`must be a valid email`);\n if (constraints.format === 'uri' || constraints.format === 'url') rules.push(`must be a valid URL`);\n if (constraints.pattern) rules.push(`must match: ${constraints.pattern}`);\n if (constraints.enum) rules.push(`must be one of: ${(constraints.enum as string[]).join(', ')}`);\n if (constraints.minItems) rules.push(`at least ${constraints.minItems} items`);\n if (constraints.maxItems) rules.push(`at most ${constraints.maxItems} items`);\n\n const text = rules.length > 0 ? `IMPORTANT: ${rules.join(', ')}` : JSON.stringify(constraints);\n return original ? `${original}\\n\\n${text}` : text;\n }\n}\n",
|
|
25
|
+
"import { McpToolCompatibility, type ModelInfo } from '../base.js';\n\nexport class AnthropicMcpCompatibility extends McpToolCompatibility {\n constructor(modelInfo: ModelInfo) {\n super(modelInfo);\n }\n\n shouldApply(): boolean {\n return this.modelInfo.provider === 'anthropic';\n }\n\n protected getUnsupportedStringProperties(): string[] { return []; }\n protected getUnsupportedNumberProperties(): string[] { return []; }\n protected getUnsupportedArrayProperties(): string[] { return []; }\n protected getUnsupportedObjectProperties(): string[] { return ['additionalProperties']; }\n\n protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string {\n const hints: string[] = [];\n if (constraints.additionalProperties === false) hints.push('Only use the specified properties');\n if (constraints.format === 'date-time') hints.push('Use ISO 8601 format');\n if (constraints.pattern) hints.push(`Must match: ${constraints.pattern}`);\n\n const text = hints.join('. ');\n return original && text ? `${original}. ${text}` : original || text || '';\n }\n}\n",
|
|
26
|
+
"import { McpToolCompatibility, type ModelInfo } from '../base.js';\n\nexport class GoogleMcpCompatibility extends McpToolCompatibility {\n constructor(modelInfo: ModelInfo) {\n super(modelInfo);\n }\n\n shouldApply(): boolean {\n return this.modelInfo.provider === 'google';\n }\n\n protected getUnsupportedStringProperties(): string[] {\n return ['minLength', 'maxLength', 'pattern', 'format'];\n }\n\n protected getUnsupportedNumberProperties(): string[] {\n return ['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf'];\n }\n\n protected getUnsupportedArrayProperties(): string[] {\n return ['minItems', 'maxItems', 'uniqueItems'];\n }\n\n protected getUnsupportedObjectProperties(): string[] {\n return ['minProperties', 'maxProperties', 'additionalProperties'];\n }\n\n protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string {\n const rules: string[] = [];\n if (constraints.minLength) rules.push(`at least ${constraints.minLength} chars`);\n if (constraints.maxLength) rules.push(`at most ${constraints.maxLength} chars`);\n if (constraints.minimum !== undefined) rules.push(`>= ${constraints.minimum}`);\n if (constraints.maximum !== undefined) rules.push(`<= ${constraints.maximum}`);\n if (constraints.format === 'email') rules.push(`valid email`);\n if (constraints.format === 'uri' || constraints.format === 'url') rules.push(`valid URL`);\n if (constraints.pattern) rules.push(`matches ${constraints.pattern}`);\n if (constraints.enum) rules.push(`one of: ${(constraints.enum as string[]).join(', ')}`);\n if (constraints.minItems) rules.push(`>= ${constraints.minItems} items`);\n if (constraints.maxItems) rules.push(`<= ${constraints.maxItems} items`);\n if (constraints.uniqueItems) rules.push(`unique items`);\n\n const text = rules.length > 0 ? `Constraints: ${rules.join('; ')}` : '';\n return original && text ? `${original}\\n\\n${text}` : original || text;\n }\n}\n",
|
|
27
|
+
"export { McpToolCompatibility, type ModelInfo, type ModelProvider } from './base.js';\n\nimport type { ModelInfo, ModelProvider } from './base.js';\nimport { OpenAIMcpCompatibility, OpenAIReasoningMcpCompatibility } from './providers/openai.js';\nimport { AnthropicMcpCompatibility } from './providers/anthropic.js';\nimport { GoogleMcpCompatibility } from './providers/google.js';\n\nexport function detectModelProvider(runtime: any): ModelInfo {\n const providerString = String(runtime?.modelProvider || '').toLowerCase();\n const modelString = String(runtime?.model || '').toLowerCase();\n\n let provider: ModelProvider = 'unknown';\n let supportsStructuredOutputs = false;\n let isReasoningModel = false;\n\n if (providerString.includes('openai') || modelString.includes('gpt-') || modelString.includes('o1') || modelString.includes('o3')) {\n provider = 'openai';\n supportsStructuredOutputs = modelString.includes('gpt-4') || modelString.includes('o1') || modelString.includes('o3');\n isReasoningModel = modelString.includes('o1') || modelString.includes('o3');\n } else if (providerString.includes('anthropic') || modelString.includes('claude')) {\n provider = 'anthropic';\n supportsStructuredOutputs = true;\n } else if (providerString.includes('google') || modelString.includes('gemini')) {\n provider = 'google';\n supportsStructuredOutputs = true;\n } else if (providerString.includes('openrouter') || modelString.includes('openrouter')) {\n provider = 'openrouter';\n }\n\n return { provider, modelId: modelString || providerString || 'unknown', supportsStructuredOutputs, isReasoningModel };\n}\n\nexport function createMcpToolCompatibilitySync(runtime: any) {\n const info = detectModelProvider(runtime);\n\n switch (info.provider) {\n case 'openai':\n return info.isReasoningModel ? new OpenAIReasoningMcpCompatibility(info) : new OpenAIMcpCompatibility(info);\n case 'anthropic':\n return new AnthropicMcpCompatibility(info);\n case 'google':\n return new GoogleMcpCompatibility(info);\n default:\n return null;\n }\n}\n\n// Async alias for API compatibility\nexport const createMcpToolCompatibility = createMcpToolCompatibilitySync;\n"
|
|
29
28
|
],
|
|
30
|
-
"mappings": ";;;;;;;;;;;;;;;;;;IAEa,yBAuDA;AAAA;AAAA,EAvDA,0BAAN,MAAM,gCAA+B,qBAAqB;AAAA,IAC/D,WAAW,CAAC,YAAsB;AAAA,MAChC,MAAM,UAAS;AAAA;AAAA,IAGjB,WAAW,GAAY;AAAA,MAGrB,OACE,KAAK,UAAU,aAAa,aAC3B,CAAC,KAAK,UAAU,6BAA6B,KAAK,UAAU,qBAAqB;AAAA;AAAA,IAI5E,8BAA8B,GAAa;AAAA,MACnD,MAAM,kBAAkB,CAAC,QAAQ;AAAA,MAGjC,IAAI,KAAK,UAAU,qBAAqB,MAAM;AAAA,QAC5C,OAAO,CAAC,GAAG,iBAAiB,SAAS;A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