mcpserver

package
v0.2.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 16 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

Overview

Package mcpserver 将共享应用用例公开为 HTTP MCP 工具,不持有独立业务连接池。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(options Options) http.Handler

Types

type Options

type Options struct {
	Instance agentmcp.Instance
	Config   config.MCP
	Token    string
	Queries  *agentmcp.Queries
	Engine   *agentmcp.Engine
}

type Result

type Result[T any] struct {
	SchemaVersion    int        `json:"schema_version"`
	ServerInstanceID string     `json:"server_instance_id"`
	OK               bool       `json:"ok"`
	Data             *T         `json:"data,omitempty"`
	Error            *ToolError `json:"error,omitempty"`
}

type ServerInfo

type ServerInfo struct {
	Host         string                `json:"host"`
	Capabilities []string              `json:"capabilities"`
	State        string                `json:"state"`
	RequestEpoch uint64                `json:"request_epoch"`
	Counts       *agentmcp.EngineStats `json:"counts,omitempty"`
	Limits       map[string]int64      `json:"limits,omitempty"`
}

type ToolError

type ToolError struct {
	Code      string         `json:"code"`
	Message   string         `json:"message"`
	Retryable bool           `json:"retryable"`
	Details   map[string]any `json:"details,omitempty"`
}

Jump to

Keyboard shortcuts

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