Documentation
¶
Overview ¶
Package httpclient is a client of the HTTP API of the MCP connectors
Index ¶
- type Client
- func (c *Client) Authorize(ctx context.Context, name, redirect string) (*schema.AuthorizeResponse, error)
- func (c *Client) Callback(ctx context.Context, query url.Values) (*schema.Connector, error)
- func (c *Client) CreateConnector(ctx context.Context, connector schema.Connector) (*schema.Connector, error)
- func (c *Client) DeleteConnector(ctx context.Context, name string) (*schema.Connector, error)
- func (c *Client) GetConnector(ctx context.Context, name string) (*schema.Connector, error)
- func (c *Client) ListConnectors(ctx context.Context) (*schema.ConnectorList, error)
- func (c *Client) ListTemplates(ctx context.Context) (*schema.ConnectorTemplateList, error)
- func (c *Client) UpdateConnector(ctx context.Context, name string, meta schema.ConnectorMeta) (*schema.Connector, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a client of the connectors' HTTP API, which wraps the base HTTP client, with typed methods for its requests
func New ¶
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 ¶
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 ¶
DeleteConnector deletes the connector with the name, and returns it, as it was
func (*Client) GetConnector ¶
GetConnector returns the connector with the name, with its status
func (*Client) ListConnectors ¶
ListConnectors returns the connectors, with their status, in order of their names
func (*Client) ListTemplates ¶
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