mcp

package
v2.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MCPServerName is the name used for the MCP server.
	MCPServerName = "Coder"
	// MCPServerInstructions is the instructions text for the MCP server.
	MCPServerInstructions = "Coder MCP Server providing workspace and template management tools"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Logger slog.Logger
	// contains filtered or unexported fields
}

Server represents an MCP HTTP server instance

func NewServer

func NewServer(logger slog.Logger) (*Server, error)

NewServer creates a new MCP HTTP server

func (*Server) RegisterChatGPTTools added in v2.26.0

func (s *Server) RegisterChatGPTTools(client *codersdk.Client) error

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 add Coder as a connector.

func (*Server) RegisterTools

func (s *Server) RegisterTools(client *codersdk.Client) error

Register all available MCP tools with the server excluding: - ReportTask - which requires dependencies not available in the remote MCP context - ChatGPT search and fetch tools, which are redundant with the standard tools.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL