ChatGPT tools are the search and fetch tools as defined in https://platform.openai.com/docs/mcp. We do not expose any extra ones because ChatGPT has an undocumented "Safety Scan" feature. In my experiments, if I included extra tools in the MCP server, ChatGPT would often - but not always - refuse to
(client *codersdk.Client, opts ...func(*toolsdk.Deps))
| 101 | // In my experiments, if I included extra tools in the MCP server, ChatGPT would often - but not always - |
| 102 | // refuse to add Coder as a connector. |
| 103 | func (s *Server) RegisterChatGPTTools(client *codersdk.Client, opts ...func(*toolsdk.Deps)) error { |
| 104 | if client == nil { |
| 105 | return xerrors.New("client cannot be nil: MCP HTTP server requires authenticated client") |
| 106 | } |
| 107 | |
| 108 | // Create tool dependencies |
| 109 | toolDeps, err := toolsdk.NewDeps(client, opts...) |
| 110 | if err != nil { |
| 111 | return xerrors.Errorf("failed to initialize tool dependencies: %w", err) |
| 112 | } |
| 113 | |
| 114 | for _, tool := range toolsdk.All { |
| 115 | if tool.Name != toolsdk.ToolNameChatGPTSearch && tool.Name != toolsdk.ToolNameChatGPTFetch { |
| 116 | continue |
| 117 | } |
| 118 | |
| 119 | s.mcpServer.AddTools(mcpFromSDK(tool, toolDeps)) |
| 120 | } |
| 121 | return nil |
| 122 | } |
| 123 | |
| 124 | // mcpFromSDK adapts a toolsdk.Tool to go-mcp's server.ServerTool |
| 125 | func mcpFromSDK(sdkTool toolsdk.GenericTool, tb toolsdk.Deps) server.ServerTool { |
no test coverage detected