mcp

package
v1.261022.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MPL-2.0 Imports: 12 Imported by: 0 modules, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler handles MCP configuration HTTP requests

func NewHandler

func NewHandler(cfg *config.Config, rt ...*mcpruntime.Runtime) *Handler

NewHandler creates a new MCP handler. rt is an optional shared Runtime; when provided (e.g. from the main server) it is reused so the transport handler sees already-connected sources and registered builtins. When nil (e.g. in openapi/CLI mode) a fresh runtime is created from config.

func (*Handler) GetLocalHandler added in v0.260414.2000

func (h *Handler) GetLocalHandler() *local.Handler

GetLocalHandler returns the local mode handler

func (*Handler) GetMCPRuntimeConfig

func (h *Handler) GetMCPRuntimeConfig(c *gin.Context)

GetMCPRuntimeConfig returns the global MCP runtime configuration

func (*Handler) GetTransportHandler added in v0.260414.2000

func (h *Handler) GetTransportHandler() *local.TransportHandler

GetTransportHandler returns the transport handler for local mode

func (*Handler) IsMCPEnabled added in v0.260414.2000

func (h *Handler) IsMCPEnabled() bool

IsMCPEnabled checks if MCP feature is enabled via scenario flag

func (*Handler) RegisterRoutes added in v1.261002.1

func (h *Handler) RegisterRoutes(rt *module.Routes)

func (*Handler) SetMCPRuntimeConfig

func (h *Handler) SetMCPRuntimeConfig(c *gin.Context)

SetMCPRuntimeConfig sets the global MCP runtime configuration

type MCPRuntimeConfigRequest

type MCPRuntimeConfigRequest struct {
	Sources               []typ.MCPSourceConfig `json:"sources,omitempty"`
	RequestTimeout        int                   `json:"request_timeout,omitempty"`          // seconds, default: 30
	StripDisabledMCPTools bool                  `json:"strip_disabled_mcp_tools,omitempty"` // dangerous: strip disabled MCP declarations/tool_calls
}

MCPRuntimeConfigRequest is the API request for setting MCP runtime config

type MCPRuntimeConfigResponse

type MCPRuntimeConfigResponse struct {
	Success bool                  `json:"success"`
	Config  *typ.MCPRuntimeConfig `json:"config,omitempty"`
	Error   string                `json:"error,omitempty"`
}

MCPRuntimeConfigResponse is the API response for MCP runtime config

Jump to

Keyboard shortcuts

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