Skip to main content
The Go SDK instruments servers built with mark3labs/mcp-go (v0.49–v0.56) or the official modelcontextprotocol/go-sdk (v1.6+). Go 1.25+.

Install

Set your API key

Create a key in the dashboard, then add it to your deployment secrets. If the key is missing, the SDK quietly no-ops — your server keeps working, and no data is sent.

Instrument your server

Create the server with NewMCPServer and register tools with InstrumentTool:
main.go

Existing servers

Attach a recorder to a server you already construct:
For the official SDK, use official.NewRecorder(config) followed by rec.Install(server).
Running on serverless or stateless HTTP? See Stateless & serverless servers and set Delivery: armatureanalytics.DeliveryAwait.

Configuration

OnError is silent by default in Go. Set it in production — otherwise an invalid key or network failure drops events with no signal.

Flush on shutdown

NewMCPServer returns a Shutdown function that drains pending deliveries — call it with a timeout on exit (as in the quickstart above). With a manual recorder, call rec.Close(ctx).

What’s not captured

The Go SDK records initialize and tools/call. Prompts, resources, and OAuth flows are not captured.

Troubleshooting

With the official SDK adapter, install the analytics middleware before your auth middleware if your ActorSeed reads values that auth injects into the context.
Check ANALYTICS_INGEST_API_KEY is set (missing keys disable delivery silently by design) and set Config.OnError to surface failures.