Documentation
¶
Overview ¶
Package server runs an MCP server the way every katbyte MCP tool serves one: over stdio for a client that starts it, or over Streamable HTTP for an always-on deployment, behind a bearer token and with a health probe a container can ask.
Index ¶
Constants ¶
View Source
const ( // Path is where the MCP endpoint is served over HTTP. Path = "/mcp" // HealthPath answers "ok" to a GET, with no token asked for: a container // with a token configured would otherwise never be healthy. HealthPath = "/healthz" )
Variables ¶
This section is empty.
Functions ¶
func CheckAuth ¶
CheckAuth is what stands between an address to listen on and an open port: with no bearer token it is an error, unless the operator said that no auth is wanted. A blank token in a copied .env used to come up serving every tool to the whole network with one line of warning.
Types ¶
type Options ¶
type Options struct {
// Listen is the address to serve Streamable HTTP on, ":8080" say. Empty
// serves stdio.
Listen string
// AuthToken is the bearer token an HTTP client must send. Empty asks for
// none, which Run refuses without AllowNoAuth.
AuthToken string
// AllowNoAuth is the operator saying, in so many words, that anyone who
// can reach the port may use every tool.
AllowNoAuth bool
// Name is the tool's own name, "abs-mcp" say: the realm a client sent
// away is told.
Name string
// EnvPrefix is what the tool's environment variables begin with, "ABS"
// for ABS_AUTH_TOKEN, so what the operator is told names the variable
// to set.
EnvPrefix string
}
Options says how to serve.
Click to show internal directories.
Click to hide internal directories.