mcpprobe

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mcpprobe is a minimal MCP client for health checks. It starts an MCP server command over stdio, performs the initialize handshake, and lists the server's tools. `vegaload doctor` uses it to prove that the exact command an agent host has configured really starts and answers.

It speaks the same newline-delimited JSON-RPC 2.0 as internal/mcp and knows nothing about what any tool does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Path string
	Args []string
	Env  map[string]string // added to the current environment
	Dir  string            // working directory; empty for the current one
}

Command is an MCP server launch command, as an agent host would run it.

type Info

type Info struct {
	ServerName      string
	ProtocolVersion string
	Tools           []string // sorted
}

Info is what a successful probe learned about the server.

func Handshake

func Handshake(ctx context.Context, r io.Reader, w io.Writer) (Info, error)

Handshake runs initialize and tools/list over an already-connected stream. It is split from Probe so tests can drive it in process.

func Probe

func Probe(ctx context.Context, c Command) (Info, error)

Probe starts c, runs the handshake, and stops the process. Errors include the tail of the server's stderr, which is where a crashing server explains itself.

func (Info) MissingTools

func (i Info) MissingTools(want []string) []string

MissingTools returns the names in want that info does not list.

Jump to

Keyboard shortcuts

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