hosted

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func CheckConfig(ctx context.Context, cfg Config) error

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.

func Handler

func Handler(cfg Config) (http.Handler, error)

Handler serves the MCP endpoint at the resource URL's path, its protected resource metadata (RFC 9728), /healthz and /readyz.

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.

Jump to

Keyboard shortcuts

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