mcpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 21 Imported by: 0 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 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

View Source
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 Handler

func Handler(a *app.App, publicURL string) http.Handler

func ListenAddr

func ListenAddr(flag string, explicit bool) string

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 Mux

func Mux(a *app.App, publicURL, issuer string) http.Handler

func New

func New(a *app.App) *mcp.Server

func ResourceURL

func ResourceURL(listen string) string

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"`
}

func Fetch

func Fetch(ctx context.Context, a *app.App, agentID string, in FetchIn) (FetchOut, error)

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

func LaptopConfig(origin string) Laptop

type ListOut

type ListOut struct {
	Items []protocol.Item `json:"items"`
}

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.

func Config

func Config(publicURL string) (Remote, error)

Jump to

Keyboard shortcuts

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