Documentation
¶
Index ¶
Constants ¶
View Source
const ( TransportHTTP = "HTTP" TransportSTDIO = "STDIO" )
Transports accepted by Options.Transport (case-insensitive).
View Source
const (
// PluginsRoot is where each server plugin package roots its keys.
PluginsRoot = root + ".plugins"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Name string
Version string
Instructions string
Transport string
Port int
Path string
Stateless bool
JSONResponse bool
SessionTimeout time.Duration
KeepAlive time.Duration
}
Options configures the MCP server.
func NewOptions ¶
NewOptions returns options from the default config path.
func NewOptionsWithPath ¶
NewOptionsWithPath returns options from path, falling back to the root defaults.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps an *mcp.Server and serves it over the configured transport.
func NewServerWithConfigPath ¶
NewServerWithConfigPath builds a server from the given config path.
func NewServerWithOptions ¶
NewServerWithOptions builds a server from o and runs the plugins on it.
func (*Server) Handler ¶
Handler returns the streamable HTTP handler, to mount the server on an existing HTTP server (echo, net/http) instead of its own port.
func (*Server) Instance ¶
Instance returns the wrapped server; register tools, prompts and resources on it.
Directories
¶
| Path | Synopsis |
|---|---|
|
plugins
|
|
|
contrib/go.opentelemetry.io/otel/v1
Package otel opens an OpenTelemetry span for every MCP call the server receives, continuing the trace the client sent in _meta.
|
Package otel opens an OpenTelemetry span for every MCP call the server receives, continuing the trace the client sent in _meta. |
|
local/wrapper/log
Package log logs every MCP call the server receives through wrapper/log: method, tool, duration and error.
|
Package log logs every MCP call the server receives through wrapper/log: method, tool, duration and error. |
Click to show internal directories.
Click to hide internal directories.