Documentation
¶
Index ¶
- Variables
- func AdminRequest(ctx context.Context, store *Store, name string, opts AdminRequestOptions) error
- func AuthorizeClient(ctx context.Context, store *Store, name string, opts ClientOptions) (configstore.ClientGrant, error)
- func BrokerControl(ctx context.Context, store *Store, operation string) (int, error)
- func Connect(ctx context.Context, store *Store, name string, opts ConnectOptions) error
- func ConnectBroker(ctx context.Context, store *Store, name, id string, opts ConnectOptions) error
- func ConnectInteractive(ctx context.Context, store *Store, opts PairOptions, connection ConnectOptions) error
- func Login(ctx context.Context, store *Store, opts LoginOptions) error
- func Logout(ctx context.Context, store *Store, name string, base *http.Client) (bool, error)
- func RevokeClient(ctx context.Context, store *Store, name, id string, base *http.Client) error
- func RunBroker(ctx context.Context, store *Store, base *http.Client) error
- func Setup(ctx context.Context, store *Store, name string, opts SetupOptions) error
- type AdminRequestOptions
- type ClientOptions
- type ClientStatus
- type ConnectOptions
- type DiagnosticCheck
- type DoctorOptions
- type DoctorReport
- type LoginOptions
- type PairOptions
- type PairStatus
- type SetupOptions
- type Status
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( ErrLoginRequired = errors.New("login required; run mcpbridge login for this profile") ErrProfileChanged = errors.New("profile was logged in again; restart the MCP connection") )
Functions ¶
func AdminRequest ¶
AdminRequest sends one management operation. Only a 401 can cause one retry; network failures never replay writes. ETags are emitted separately to stderr.
func AuthorizeClient ¶
func AuthorizeClient(ctx context.Context, store *Store, name string, opts ClientOptions) (configstore.ClientGrant, error)
func BrokerControl ¶
func ConnectBroker ¶
func ConnectInteractive ¶ added in v2.3.0
func ConnectInteractive(ctx context.Context, store *Store, opts PairOptions, connection ConnectOptions) error
ConnectInteractive initializes the local MCP session before contacting the gateway. Authentication is explicit; business calls are never queued or replayed.
func Logout ¶
Logout clears local access before any network I/O. An offline revocation leaves only the non-secret session reference for review in the user portal.
func RevokeClient ¶
Types ¶
type AdminRequestOptions ¶
type ClientOptions ¶
type ClientOptions struct {
ID string `json:"client_instance_id"`
Name string `json:"client_name"`
Endpoint string `json:"endpoint_id"`
Scopes []string `json:"allowed_scopes"`
Tools []string `json:"allowed_tools"`
ResourceRules []config.ResourceRule `json:"resource_rules"`
AllowWrite bool `json:"allow_write_requests"`
Capabilities configstore.GrantCapabilities `json:"capabilities"`
TTLSeconds int64 `json:"ttl_seconds"`
Changed []string `json:"-"`
HTTPClient *http.Client `json:"-"`
OpenBrowser func(string) error `json:"-"`
Output io.Writer `json:"-"`
}
type ClientStatus ¶
type ClientStatus struct {
configstore.ClientGrant
EffectiveScopes []string
AuthorizationError string
}
type ConnectOptions ¶
type ConnectOptions struct {
Input io.ReadCloser
Output io.WriteCloser
HTTPClient *http.Client
// contains filtered or unexported fields
}
type DiagnosticCheck ¶
type DoctorOptions ¶
type DoctorReport ¶
type DoctorReport struct {
Profile string `json:"profile"`
ClientID string `json:"client_id,omitempty"`
Server string `json:"server,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Healthy bool `json:"healthy"`
Checks []DiagnosticCheck `json:"checks"`
EffectiveScopes []string `json:"effective_scopes,omitempty"`
Tools []string `json:"tools,omitempty"`
MoreTools bool `json:"more_tools"`
}
func Doctor ¶
func Doctor(ctx context.Context, store *Store, name string, opts DoctorOptions) DoctorReport
Doctor uses the connector's credential path and read-only MCP initialization and discovery. It may refresh a token, but never opens a browser, starts a Broker, creates an authorization, or calls a tool.
type LoginOptions ¶
type PairOptions ¶ added in v2.3.0
type PairOptions struct {
Server string
Profile string
ClientID string
ClientOptions
}
type PairStatus ¶ added in v2.3.0
type PairStatus struct {
Status string `json:"status"`
RequestID string `json:"request_id"`
UserCode string `json:"user_code,omitempty"`
VerificationURI string `json:"verification_uri,omitempty"`
VerificationURIComplete string `json:"verification_uri_complete,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
Interval int64 `json:"interval,omitempty"`
Profile string `json:"profile"`
ClientID string `json:"client_instance_id"`
Server string `json:"server"`
Endpoint string `json:"endpoint_id,omitempty"`
NextStep string `json:"next_step"`
}
PairStatus is safe to pass to an Agent. It intentionally has no credential fields.
func PairFinish ¶ added in v2.3.0
func PairStart ¶ added in v2.3.0
func PairStart(ctx context.Context, store *Store, opts PairOptions) (PairStatus, error)