Skip to content

Python and Go SDKs

The TypeScript SDK is the best-supported surface (SDKs). Python and Go are preview source packages - install from the repo, same protocol underneath, with cross-SDK signature compatibility verified (TypeScript and Python produce identical signatures for identical inputs).

Python - mapprotocol

Source install while in preview:

bash
git clone https://github.com/SidianLabs/micro-agent-protocol.git
cd micro-agent-protocol/packages/python
pip install -e .
python
from mapprotocol import Client
from mapprotocol.types import DispatchRequest, TaskEnvelope

client = Client(base_url="http://localhost:8787")
client.configure_signing(key_id="your-key-id", secret="your-secret")

result = client.dispatch(DispatchRequest(
    capability="payment.process",
    envelope=TaskEnvelope(
        task_id="task-001",
        requester_identity={"type": "user", "id": "user-123"},
        target_agent="agent-payment",
        intent="Process a payment of $100",
        constraints={"common": {"max_amount": 1000}},
        risk_class="medium",
        delegation_token="tok_xxx",
        requested_output_mode="full",
    ),
))

DispatchRequest fields: capability, envelope, optional requested_schema_version and negotiation. Also available: client.approve(...) for approval references.

154 tests across 8 test files. Coverage: 12/15 API surface (80%) - storage, policy, and observability helpers are the gaps vs TypeScript.

Go - mapproto

Source package while in preview:

bash
go get github.com/SidianLabs/micro-agent-protocol/packages/go/mapproto

Functional-options client with context-first calls:

go
import (
	"context"
	"time"

	"github.com/SidianLabs/micro-agent-protocol/mapproto"
)

signer := mapproto.NewHMACSigner([]byte("your-secret-key"), "key-id")

client, err := mapproto.NewClient(
	mapproto.WithBaseURL("http://localhost:8787"),
	mapproto.WithTimeout(30*time.Second),
	mapproto.WithSigner(signer),
	// also: WithTransport(...), WithHeaderFunc(...)
)
if err != nil {
	log.Fatal(err)
}

result, err := client.Dispatch(context.Background(), &mapproto.DispatchRequest{
	Capability: "payment.process",
	Envelope: mapproto.TaskEnvelope{
		TaskID:      "task-001",
		TargetAgent: "agent-payment",
		Intent:      "Process a payment of $100",
		RiskClass:   "medium",
	},
})

// Health, tasks, agents
health, _ := client.GetHealth(context.Background())
tasks, _ := client.ListTasks(context.Background(), nil)
agents, _ := client.ListAgents(context.Background(), nil)

Coverage: 9/15 API surface (60%). Structurally compatible with TypeScript and Python (Go uses struct field ordering matching alphabetical); signatures verify across all three SDKs.

Choosing

  • Shipping today? TypeScript - full observability, WebSocket streaming, batch.
  • Python shop? mapprotocol covers dispatch, approvals, signing, and validation.
  • Go services? mapproto covers dispatch, approvals, tasks, agents, and health with idiomatic context propagation.

Released under the Apache 2.0 License.