ctlclient

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 10 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 ctlclient provides an HTTP client for the openbee /mcp/bee/call endpoint, used by the openbee ctl CLI subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL    string
	APIKey     string
	HTTPClient *http.Client
}

Client calls the openbee /mcp/bee/call endpoint. Construct via NewClient or directly (useful in tests).

func NewClient

func NewClient(cfgPath string) (*Client, error)

NewClient resolves connection config in priority order:

  1. OPENBEE_URL / OPENBEE_API_KEY environment variables
  2. config file at cfgPath: derives base URL and generates a bee JWT from token_secret
  3. defaults: http://localhost:8080, empty API key

func (*Client) Call

func (c *Client) Call(toolName string, args any) (json.RawMessage, error)

Call invokes a named MCP tool and returns the raw JSON result. Returns an error for connection failures, auth errors, and tool execution errors.

Jump to

Keyboard shortcuts

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