(mcpConfig map[string]any, toolName string, config *RegistryMCPServerConfig)
| 629 | } |
| 630 | |
| 631 | func parseMCPHTTPTypeConfig(mcpConfig map[string]any, toolName string, config *RegistryMCPServerConfig) error { |
| 632 | url, hasURL := mcpConfig["url"] |
| 633 | if !hasURL { |
| 634 | return fmt.Errorf( |
| 635 | "http MCP tool '%s' missing required 'url' field. HTTP MCP servers must specify a URL endpoint. "+ |
| 636 | "Example:\n"+ |
| 637 | "mcp-servers:\n"+ |
| 638 | " %s:\n"+ |
| 639 | " type: http\n"+ |
| 640 | " url: \"https://api.example.com/mcp\"\n"+ |
| 641 | " headers:\n"+ |
| 642 | " Authorization: \"${{ secrets.API_KEY }}\"", |
| 643 | toolName, toolName, |
| 644 | ) |
| 645 | } |
| 646 | urlStr, ok := url.(string) |
| 647 | if !ok { |
| 648 | return fmt.Errorf( |
| 649 | "url field must be a string, got %T. Example:\n"+ |
| 650 | "mcp-servers:\n"+ |
| 651 | " %s:\n"+ |
| 652 | " type: http\n"+ |
| 653 | " url: \"https://api.example.com/mcp\"\n"+ |
| 654 | " headers:\n"+ |
| 655 | " Authorization: \"${{ secrets.API_KEY }}\"", |
| 656 | url, toolName) |
| 657 | } |
| 658 | mcpLog.Printf("Tool %s uses HTTP transport with URL: %s", toolName, urlStr) |
| 659 | config.URL = urlStr |
| 660 | copyStringMapFromAny(mcpConfig["headers"], config.Headers) |
| 661 | return nil |
| 662 | } |
no test coverage detected