mcpserver

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mcpserver exposes the curated odh command surface as Model Context Protocol tools. Every tool executes the corresponding CLI command in-process and returns its documented JSON output unchanged, so the JSON contracts in docs/json-contracts.md apply to MCP results as well.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string, exec ExecFunc) *mcp.Server

New builds an MCP server exposing the curated odh tool surface. Tool calls are executed through exec.

func ServeStdio

func ServeStdio(ctx context.Context, version string, exec ExecFunc) error

ServeStdio runs the MCP server on stdin/stdout until the client disconnects or ctx is canceled.

Types

type ExecFunc

type ExecFunc func(ctx context.Context, args []string, stdout, stderr io.Writer) int

ExecFunc runs one CLI argument vector and returns its process exit code. Implementations must be safe for concurrent calls.

type ToolInfo

type ToolInfo struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"input_schema"`
}

ToolInfo describes one exposed MCP tool for listings outside an MCP session, such as odh mcp tools.

func Tools

func Tools() []ToolInfo

Tools returns the exposed tool surface in registration order.

Jump to

Keyboard shortcuts

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