Documentation
¶
Overview ¶
Package mcpserver is the agent surface: Streamable HTTP MCP.
Official SDK: github.com/modelcontextprotocol/go-sdk/mcp Source: https://github.com/modelcontextprotocol/go-sdk (v1.7.0) Spec: https://modelcontextprotocol.io/specification/2025-03-26/basic/transports
Identity is the Bearer token (Hydra JWT / bound OIDC). The host is not identity. Tools return Use results, never secrets.
Index ¶
- Constants
- func Handler(a *app.App, publicURL string) http.Handler
- func ListenAddr(flag string, explicit bool) string
- func Mux(a *app.App, publicURL, issuer string) http.Handler
- func New(a *app.App) *mcp.Server
- func ResourceURL(listen string) string
- type ApprovalStatusIn
- type ApprovalStatusOut
- type FetchIn
- type FetchOut
- type Laptop
- type ListOut
- type MatchIn
- type Remote
Constants ¶
const ( DefaultAddr = "127.0.0.1:4461" DefaultPublicURL = "https://veil.nyc/mcp" DefaultIssuer = "https://id.veil.nyc" // SelfHostIssuer marks a standalone single-binary origin (--self-host or // VEIL_SELF_HOST=1) where agents authenticate via bound external OIDC // issuers or session leases, with no sibling Hydra process. SelfHostIssuer = "none" Path = "/mcp" )
Variables ¶
This section is empty.
Functions ¶
func ListenAddr ¶
ListenAddr is the TCP address mcp binds. Railway healthchecks $PORT (docs/deployments/healthchecks). Distroless has no shell, so CMD cannot expand $PORT — the binary must. An explicit --listen still wins.
func ResourceURL ¶
Types ¶
type ApprovalStatusIn ¶
type ApprovalStatusIn struct {
RequestID string `json:"request_id" jsonschema:"approval request id from a fetch decision=need_approval"`
}
type ApprovalStatusOut ¶
type ApprovalStatusOut struct {
RequestID string `json:"request_id"`
Status string `json:"status"`
ItemID string `json:"item_id"`
Action string `json:"action"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
// ResolvedAt is set by the resolver/sweeper — a derived "expired" status
// can show a nil ResolvedAt until the sweeper writes the row.
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
}
type FetchIn ¶
type FetchIn struct {
Item string `json:"item" jsonschema:"item name the agent is granted"`
URL string `json:"url" jsonschema:"URL to fetch; host must match the item"`
Method string `json:"method,omitempty" jsonschema:"HTTP method, default GET"`
Headers map[string]string `json:"headers,omitempty" jsonschema:"extra request headers. never the vault secret"`
Body string `json:"body,omitempty" jsonschema:"request body. never the vault secret"`
BodyB64 string `json:"body_b64,omitempty" jsonschema:"base64 request body for binary payloads. never the vault secret"`
}
type FetchOut ¶
type FetchOut struct {
Decision string `json:"decision"`
Reason string `json:"reason,omitempty"`
Status int `json:"status,omitempty"`
Headers http.Header `json:"headers,omitempty"`
Body string `json:"body,omitempty"`
BodyB64 string `json:"body_b64,omitempty"`
RequestID string `json:"request_id,omitempty"`
RequestExpiresAt *time.Time `json:"request_expires_at,omitempty"`
}
type Laptop ¶
type Laptop struct {
Command string `json:"command"`
Args []string `json:"args"`
Env map[string]string `json:"env"`
}
Laptop is the Cursor (and other GUI) MCP block. Dock-launched apps cannot interpolate Bearer or ${file:}. stdio reads VEIL_OIDC_TOKEN_FILE per call. mcp laptop writes the env values that are set (paths), never the JWT.
func LaptopConfig ¶
type MatchIn ¶
type MatchIn struct {
URL string `json:"url" jsonschema:"URL to match against granted item URIs"`
}
type Remote ¶
type Remote struct {
URL string `json:"url"`
Issuer string `json:"issuer,omitempty"`
Headers map[string]string `json:"headers"`
}
Remote is the one MCP block every coding agent pastes. URL plus a Bearer header template. The token is never in this JSON. The host is not identity. Issuer is where the agent mints (Hydra public token+JWKS). Not admin.