mcp

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mcp 通过 Model Context Protocol 暴露 Leros 运行时能力。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthToken

func DefaultAuthToken() string

DefaultAuthToken 返回当前 MCP 授权令牌。

func NewTools

func NewTools() []tools.Tool

NewTools 返回当前通过 MCP 暴露的 Leros 工具。

func RegisterRoutes

func RegisterRoutes(r gin.IRouter, srv *Server)

RegisterRoutes 挂载 Leros MCP 可流式 HTTP 端点。

func SetAuthToken

func SetAuthToken(token string)

SetAuthToken 设置 MCP 授权令牌。

Types

type Server

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

Server 持有 MCP SDK 服务器和 HTTP 传输层。

func NewServer

func NewServer() *Server

NewServer 使用当前公开的工具创建 Leros MCP 服务器。

func NewServerWithTools

func NewServerWithTools(publicTools ...tools.Tool) *Server

NewServerWithTools 从 Leros 内部工具创建 Leros MCP 服务器。

func (*Server) GetTool

func (s *Server) GetTool(name string) *mcpserver.ServerTool

GetTool 按名称返回已注册的 MCP 工具。用于测试和诊断。

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler 返回可流式传输的 HTTP MCP 传输处理器。

Jump to

Keyboard shortcuts

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