Documentation
¶
Overview ¶
Package hosted serves Shipyard's MCP tools over stateless Streamable HTTP for clients that connect with OAuth, instead of over stdio with the CLI's own token.
Each request carries the user's MCP token. The server trades it for a short-lived core API token (RFC 8693) and builds that request's tools with it; the client's token is never sent to the API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Logger is the hosted server's own log, for its operator: one line per tool call, with its outcome, duration and org. The org names a customer, so these logs are customer data, but params and response bodies stay out of them. The tools' request logs follow --verbose: they carry users' params and the API's error bodies.
Functions ¶
func CheckConfig ¶
CheckConfig asks core to exchange a token that can't exist. Core checks this server's client and the API it asks for (the site URL) before the subject token, so it refuses the token itself only when both are right. That doesn't cover core's OAUTH_MCP_RESOURCE. Core being unreachable isn't an error: the server answers with a retry hint until it's back.
Types ¶
type Config ¶
type Config struct {
// ResourceURL is this server's MCP endpoint, the audience of the tokens it
// accepts, e.g. https://mcp.example.com/mcp. Core's OAUTH_MCP_RESOURCE must match.
ResourceURL string
// SiteURL is core's base URL: the authorization server, and /api is the API.
SiteURL string
// ClientID and ClientSecret are this server's confidential client at core
// (OAUTH_MCP_HOST_CLIENT_ID / OAUTH_MCP_HOST_CLIENT_SECRET).
ClientID string
ClientSecret string
// BehindProxy takes each request's client address from the last entry of
// X-Forwarded-For, which the proxy in front (the ingress) appends. Set it
// only behind one: without it a client could name any address it likes.
BehindProxy bool
}
Config is what a hosted server needs. All of it comes from the deployment.