Documentation
¶
Index ¶
- func CreateConsoleCore() zapcore.Core
- func CreateNewLoggerFromCore(core zapcore.Core) *zap.Logger
- func InitLogger(config TelemetryConfig) error
- func InitTracer(ctx context.Context, config TelemetryConfig) (func(context.Context) error, error)
- func RunServer(ctx context.Context, cfg *Config) error
- type Config
- type ServerInfo
- type TelemetryConfig
- type ToolRegistryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConsoleCore ¶
CreateConsoleCore returns a zapcore.Core that writes info/warn logs to stdout and error logs to stderr using a console encoder.
func CreateNewLoggerFromCore ¶
CreateNewLoggerFromCore creates a named zap.Logger from the given core with caller information enabled.
func InitLogger ¶
func InitLogger(config TelemetryConfig) error
InitLogger sets up the global logger to use the OTel bridge, allowing logs to be exported to OTel.
func InitTracer ¶
InitTracer initializes the OpenTelemetry tracer and returns a shutdown function
Types ¶
type Config ¶
type Config struct {
// SocketPath is the Unix domain socket path the gRPC server listens on.
SocketPath string
// ToolRegistryConfig configures how tools are loaded from OpenAPI specs.
ToolRegistryConfig *ToolRegistryConfig
// ServerInfo configures the identity and instructions for the MCP server.
ServerInfo ServerInfo
}
Config holds the configuration for the ext_proc gRPC server.
type ServerInfo ¶
type ServerInfo struct {
// Name is the server name reported to MCP clients.
Name string
// Version is the server version reported to MCP clients.
Version string
// Instructions is human-readable text returned to MCP clients.
Instructions string
}
ServerInfo holds the identity and instructions returned in the MCP initialize response.
type TelemetryConfig ¶
type TelemetryConfig struct {
// OtelEndpoint is the gRPC address of the OpenTelemetry Collector (e.g. "localhost:4317").
OtelEndpoint string
// ServiceName identifies this service in traces and logs.
ServiceName string
// ServiceVersion is the version string reported in telemetry resource attributes.
ServiceVersion string
}
TelemetryConfig holds the configuration for OpenTelemetry tracing and logging exporters.
type ToolRegistryConfig ¶
type ToolRegistryConfig struct {
// OpenAPISpecPattern is a glob pattern to match OpenAPI spec files for loading tools.
// For example, "specs/*.yaml" would load all YAML files in the specs directory.
OpenAPISpecPattern string
// ToolAllowlist is an optional list of tool names to allow. If empty, all tools loaded from the OpenAPI specs will be allowed.
ToolAllowlist []string
// StructuredOutput indicates whether to enable structured output for tools,
// which allows using outputSchema for response validation and structured content in tool responses.
StructuredOutput bool
}
ToolRegistryConfig defines the configuration for creating a toolRegistry from OpenAPI specs.