a2amcp

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: BSD-2-Clause Imports: 5 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 a2amcp serves the `a2a` MCP tools over HTTP, replacing the per-session stdio shim (a2a-mcp.py) every Claude Code session used to start for itself.

The tools are an A2A *client*: they reach an operator-configured target agent, not this controller's own /a2a surface. The controller only hosts them because it is a long-running KeepAlive process on the operator's machine.

Index

Constants

View Source
const SecurityCommand = "security"

SecurityCommand is the macOS Keychain CLI the local-target branch shells out to.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeychainReader

type KeychainReader interface {
	Read(ctx context.Context, service string, account string) (string, error)
}

KeychainReader reads one generic password from the macOS Keychain.

func NewKeychainReader

func NewKeychainReader() KeychainReader

NewKeychainReader returns the KeychainReader that shells out to `security`.

type TokenConfig

type TokenConfig struct {
	// Token is the explicit value; when non-empty it wins outright.
	Token string
	// TargetURL is the agent the token is presented to. The Keychain branch applies only when
	// it names localhost or 127.0.0.1 — the local worker's token never leaves this machine.
	TargetURL string
	// KeychainService and KeychainAccount name the local worker's Keychain item.
	KeychainService string
	KeychainAccount string
	// TeamVaultKey is the final fallback, resolved through TeamVault.
	TeamVaultKey string
}

TokenConfig is the precedence the stdio shim's wrapper (a2a-mcp-wrapper.sh) applies, carried unchanged so the move is footprint-only.

type TokenSource

type TokenSource interface {
	Token(ctx context.Context) (string, error)
}

TokenSource resolves the bearer token the A2A client presents to the target agent.

The returned value is a secret: it must never be logged, echoed into a tool result, or written to a file.

func NewTokenSource

func NewTokenSource(
	config TokenConfig,
	keychain KeychainReader,
	teamVault pkg.TeamVaultResolver,
) TokenSource

NewTokenSource returns the TokenSource applying config's precedence: explicit token, else (local target only) the Keychain item, else the TeamVault key.

It resolves on every call rather than caching: a rotated token takes effect without a restart, and a2a_send is rare enough that one subprocess per call costs nothing.

Jump to

Keyboard shortcuts

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