httpclient

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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 httpclient is a client of the HTTP API of the MCP connectors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

Client is a client of the connectors' HTTP API, which wraps the base HTTP client, with typed methods for its requests

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

New returns a client of the connectors' API, at the URL, which is the server's API endpoint, such as http://localhost:8084/api, with the options. Each method adds its own path, such as mcp/connector, as the connectors' handlers register them.

func (*Client) Authorize

func (c *Client) Authorize(ctx context.Context, name, redirect string) (*schema.AuthorizeResponse, error)

Authorize starts signing in to the connector's server, and returns the URL a person signs in at, which redirects to the redirect, once they have, which is the API's callback, of the request's origin, when it's empty

func (*Client) Callback

func (c *Client) Callback(ctx context.Context, query url.Values) (*schema.Connector, error)

Callback passes the query an authorization server redirected to a loopback with, such as its state, and code, or error, on to the API's callback, which exchanges the code for a token, and returns the connector, which is connected with it

func (*Client) CreateConnector

func (c *Client) CreateConnector(ctx context.Context, connector schema.Connector) (*schema.Connector, error)

CreateConnector creates the connector, with its name, and URL, and returns it, with its serial. Its server is connected by the server.

func (*Client) DeleteConnector

func (c *Client) DeleteConnector(ctx context.Context, name string) (*schema.Connector, error)

DeleteConnector deletes the connector with the name, and returns it, as it was

func (*Client) GetConnector

func (c *Client) GetConnector(ctx context.Context, name string) (*schema.Connector, error)

GetConnector returns the connector with the name, with its status

func (*Client) ListConnectors

func (c *Client) ListConnectors(ctx context.Context) (*schema.ConnectorList, error)

ListConnectors returns the connectors, with their status, in order of their names

func (*Client) ListTemplates

func (c *Client) ListTemplates(ctx context.Context) (*schema.ConnectorTemplateList, error)

ListTemplates returns the templates of the remote MCP servers which a connector can be added for, whose credentials the server has, in order of their names

func (*Client) UpdateConnector

func (c *Client) UpdateConnector(ctx context.Context, name string, meta schema.ConnectorMeta) (*schema.Connector, error)

UpdateConnector replaces the fields of the connector with the name, such as its URL, and returns it, with its new serial

Jump to

Keyboard shortcuts

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