externalmcp

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package externalmcp hosts MCP servers for rocketclaw integrations.

Index

Constants

View Source
const (
	SessionPromptToolName = "session_prompt"
	ExternalMCPPath       = "/mcp"
)

SessionPromptToolName and ExternalMCPPath define the public external MCP surface.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an HTTP MCP server.

func StartSessionPromptServer

func StartSessionPromptServer(ctx context.Context, logger *slog.Logger, listenAddr string, users map[string]string, defaultAgent string, sessionPromptHandler func(context.Context, string, string, string, string, map[string]string, []SessionPromptAttachment, string) (SessionResult, error)) (*Server, error)

StartSessionPromptServer starts the persistent external MCP HTTP server.

func (*Server) Close

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

Close stops the HTTP server and waits for it to exit.

func (*Server) Name

func (s *Server) Name() string

Name returns the server identifier used in logs.

func (*Server) Stop

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

Stop stops the HTTP server and waits for it to exit.

func (*Server) URL

func (s *Server) URL() string

URL returns the server base URL.

type SessionPromptAttachment

type SessionPromptAttachment struct {
	Name       string `json:"name,omitempty" jsonschema:"display filename for the attachment"`
	MIMEType   string `json:"mime_type,omitempty" jsonschema:"attachment MIME type, for example image/png"`
	DataBase64 string `json:"data_base64" jsonschema:"base64-encoded attachment bytes"`
}

SessionPromptAttachment carries an externally supplied attachment into the session_prompt tool.

type SessionResult

type SessionResult struct {
	ExternalConversationID string `json:"external_conversation_id,omitempty" jsonschema:"external conversation ID for this MCP conversation"`
	Answer                 string `json:"answer" jsonschema:"plain-text answer from rocketclaw"`
}

SessionResult is the app-level result for an external MCP session tool call.

Jump to

Keyboard shortcuts

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