mcp

package
v2.38.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"

	// Used in tests and aibridge.
	MCPEndpoint = "/api/experimental/mcp/http"
)

Variables

This section is empty.

Functions

func RegisterSDKPrompt added in v2.37.0

func RegisterSDKPrompt(srv *mcp.Server, sdkPrompt toolsdk.Prompt)

RegisterSDKPrompt registers a toolsdk.Prompt with an MCP server.

func RegisterSDKTool added in v2.37.0

func RegisterSDKTool(srv *mcp.Server, sdkTool toolsdk.GenericTool, tb toolsdk.Deps)

RegisterSDKTool registers a toolsdk.GenericTool with an MCP server.

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, opts ...func(*toolsdk.Deps)) 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) RegisterPrompts added in v2.37.0

func (s *Server) RegisterPrompts()

RegisterPrompts registers all MCP prompt templates with the server.

func (*Server) RegisterTools

func (s *Server) RegisterTools(client *codersdk.Client, opts ...func(*toolsdk.Deps)) 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