Documentation
¶
Index ¶
- func ApplyMCPStreamableHTTPAuth(transport *mcp.MCPStreamableHTTP, m *MCPSettings)
- func MCPDefaultServerName(cfg *Config) string
- func MCPLoadTransport(cfg *Config) (mcp.MCPTransportConfig, error)
- func MCPToolFilterFromConfig(cfg *Config) (mcp.MCPToolFilter, error)
- func MCPUsesOAuthFromEnv() bool
- func NewLLMClientFromConfig(cfg *Config) (interfaces.LLMClient, error)
- func NewLoggerFromLogConfig(cfg *Config) logger.Logger
- type Config
- type MCPSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMCPStreamableHTTPAuth ¶ added in v0.1.2
func ApplyMCPStreamableHTTPAuth(transport *mcp.MCPStreamableHTTP, m *MCPSettings)
ApplyMCPStreamableHTTPAuth sets optional auth on transport from m and process env. Unauthenticated MCP (URL only) is valid. When the OAuth trio is set, OAuth is used; otherwise m.BearerToken sets a bearer token when non-empty. MCP_SKIP_TLS_VERIFY=true sets SkipTLSVerify.
func MCPDefaultServerName ¶ added in v0.1.2
MCPDefaultServerName returns MCP_SERVER_NAME or a default from transport (local / remote).
func MCPLoadTransport ¶ added in v0.1.2
func MCPLoadTransport(cfg *Config) (mcp.MCPTransportConfig, error)
MCPLoadTransport builds mcp.MCPStdio or mcp.MCPStreamableHTTP from cfg and process env. streamable_http requires MCP_STREAMABLE_HTTP_URL. stdio requires MCP_STDIO_COMMAND; optional MCP_STDIO_ARGS (JSON array) and MCP_STDIO_ENV (JSON object).
func MCPToolFilterFromConfig ¶ added in v0.1.2
func MCPToolFilterFromConfig(cfg *Config) (mcp.MCPToolFilter, error)
MCPToolFilterFromConfig returns allow/block lists from comma-separated MCP_ALLOW_TOOLS / MCP_BLOCK_TOOLS.
func MCPUsesOAuthFromEnv ¶ added in v0.1.2
func MCPUsesOAuthFromEnv() bool
MCPUsesOAuthFromEnv reports whether OAuth2 client-credentials env vars are all non-empty.
func NewLLMClientFromConfig ¶
func NewLLMClientFromConfig(cfg *Config) (interfaces.LLMClient, error)
NewLLMClientFromConfig creates an LLM client from config using the new llm.Option-based API. BaseURL is applied only for OpenAI; set LLM_BASEURL when using a non-default OpenAI-compatible API.
func NewLoggerFromLogConfig ¶
NewLoggerFromLogConfig returns logger.Logger for use with the agent. Logs to stderr so conversation (stdout) stays separate; set LOG_LEVEL=info or debug to see logs.
Types ¶
type Config ¶
type Config struct {
Host string
Port int
Namespace string
TaskQueue string
LogLevel string
Provider interfaces.LLMProvider
APIKey string
Model string
// BaseURL is optional and only used for the OpenAI client (custom or Azure-compatible endpoints).
// Ignored for Anthropic and Gemini.
BaseURL string
MCP MCPSettings
}
func LoadFromEnv ¶
func LoadFromEnv() *Config
LoadFromEnv loads config from environment variables. .env is loaded on package init if present.
func (*Config) MCPTimeout ¶ added in v0.1.2
MCPTimeout returns cfg.MCP.TimeoutSeconds as a duration, or zero if unset (applies to any MCP transport).
type MCPSettings ¶ added in v0.1.2
type MCPSettings struct {
// Transport is required for MCPLoadTransport: stdio or streamable_http (aliases: local; http, remote, streamable).
Transport string
// StreamableHTTPURL is the remote MCP endpoint when transport is streamable_http.
StreamableHTTPURL string
// StdioCommand is the executable for MCP stdio transport (required when transport is stdio).
StdioCommand string
// StdioArgsRaw is JSON array of strings for subprocess argv, e.g. ["-y","@scope/mcp-server","/data"].
StdioArgsRaw string
// StdioEnvRaw is JSON object of extra env vars for the subprocess, e.g. {"API_KEY":"..."}.
StdioEnvRaw string
// BearerToken is an optional static bearer for MCP HTTP. Ignored when OAuth env trio is all set.
BearerToken string
// Name is the stable server id for this MCP connection (empty defaults to local for stdio, remote for HTTP).
Name string
// RetryAttempts is max connect+RPC attempts per operation when > 0; zero uses SDK default.
RetryAttempts int
// AllowTools is comma-separated tool names to allow-list (optional); mutually exclusive with BlockTools in validation.
AllowTools string
// BlockTools is comma-separated tool names to block-list (optional).
BlockTools string
// TimeoutSeconds caps each MCP connect+RPC attempt when > 0 (seconds). Zero uses SDK defaults.
TimeoutSeconds int
}
MCPSettings holds MCP_* environment values for agent_with_mcp_* examples. This is not github.com/agenticenv/agent-sdk-go/pkg/agent.MCPConfig (per-server agent transport + filter).
Directories
¶
| Path | Synopsis |
|---|---|
|
agent_with_run_async demonstrates RunAsync: result and approval channels without WithApprovalHandler or Stream.
|
agent_with_run_async demonstrates RunAsync: result and approval channels without WithApprovalHandler or Stream. |
|
agent_with_temporal_client demonstrates using WithTemporalClient to pass a pre-configured Temporal client to the agent.
|
agent_with_temporal_client demonstrates using WithTemporalClient to pass a pre-configured Temporal client to the agent. |
|
agent_with_worker
|
|
|
agent
command
Interactive streaming REPL for the agent_with_worker example.
|
Interactive streaming REPL for the agent_with_worker example. |
|
worker
command
|
|