mcp

package
v1.10.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResult

func ErrorResult(msg string) *mcpsdk.CallToolResult

ErrorResult creates a CallToolResult with IsError set, containing the given error message.

func JSONResult

func JSONResult(v any) (*mcpsdk.CallToolResult, error)

JSONResult creates a CallToolResult containing the JSON-encoded value as text content. This is the standard way to return structured data from a tool handler.

func TextResult

func TextResult(msg string) *mcpsdk.CallToolResult

TextResult creates a CallToolResult containing a plain text message.

func TranslateAPIError

func TranslateAPIError(err error) string

TranslateAPIError converts a Hookdeck API error into a human-readable message suitable for returning to an MCP client. If the error is not an *hookdeck.APIError, the original error message is returned unchanged.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps the MCP SDK server and the Hookdeck API client.

func NewServer

func NewServer(client *hookdeck.Client, cfg *config.Config) *Server

NewServer creates an MCP server with all Hookdeck tools registered. The supplied client is shared across all tool handlers; changing its ProjectID (e.g. via the projects.use action) affects subsequent calls within the same session.

When the client has no API key (unauthenticated), the server additionally registers a hookdeck_login tool that initiates browser-based device auth. Resource tool handlers will return an auth error until login completes.

func (*Server) RunStdio

func (s *Server) RunStdio(ctx context.Context) error

RunStdio starts the MCP server on stdin/stdout and blocks until the connection is closed (i.e. stdin reaches EOF).

Jump to

Keyboard shortcuts

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