Documentation
¶
Overview ¶
Package server assembles what `verdict serve` runs: a Twirp endpoint, an MCP endpoint, and a health check over one HTTP listener. It also serves MCP over stdio, for a client that launches Verdict as a subprocess.
The library has no dependency on this package. Everything here is a thin wrapper: a Go service that wants a decision engine imports pkg/verdict and never starts a server at all.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeStdio ¶
ServeStdio runs the MCP surface over stdin and stdout until ctx is cancelled or the client disconnects. It is what an MCP client that launches Verdict as a subprocess talks to.
Nothing may be written to stdout but protocol frames: stdout *is* the transport. Anything a caller wants to log goes to stderr, which is why Options.Logger must not be writing to stdout when this is used.
Types ¶
type Options ¶
type Options struct {
// Listen is the address to bind, e.g. ":7430".
Listen string
// TwirpPath is the prefix the Twirp handler is mounted under. Defaults to
// "/twirp".
TwirpPath string
// MCPEnabled mounts the MCP endpoint at /mcp.
MCPEnabled bool
// MCPAllowLoad exposes the model-loading MCP tool.
MCPAllowLoad bool
// ModelRoot bounds LoadModel's path field. Empty forbids loading by path.
ModelRoot string
// ReadTimeout and WriteTimeout bound a single request.
ReadTimeout time.Duration
WriteTimeout time.Duration
// Version is reported by the health endpoint and to MCP clients.
Version string
// Logger receives request and lifecycle logs.
Logger *slog.Logger
}
Options configure a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the assembled HTTP surface.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mcp exposes a Verdict engine as MCP tools, so an agent can evaluate decisions, read a decision's rules, and check a model for gaps and overlaps without a human in the loop.
|
Package mcp exposes a Verdict engine as MCP tools, so an agent can evaluate decisions, read a decision's rules, and check a model for gaps and overlaps without a human in the loop. |
|
gosdk
Package gosdk mounts Verdict's MCP tool catalogue onto the official modelcontextprotocol/go-sdk server.
|
Package gosdk mounts Verdict's MCP tool catalogue onto the official modelcontextprotocol/go-sdk server. |
|
Package twirp implements the Verdict RPC surface.
|
Package twirp implements the Verdict RPC surface. |