Install
Set your API key
ANALYTICS_INGEST_URL (the SDK defaults to the US endpoint); EU workspaces must set it to https://eu.armature.tech/api/mcp-analytics/ingest. If the key is missing, the SDK quietly no-ops — your server keeps working, and no data is sent.
Instrument your server
- mark3labs/mcp-go
- Official go-sdk
Create the server with
NewMCPServer and register tools with InstrumentTool:main.go
Existing servers
Attach a recorder to a server you already construct:official.NewRecorder(config) followed by rec.Install(server).
Running on serverless or stateless HTTP? See Stateless & serverless servers and set
Delivery: armatureanalytics.DeliveryAwait.Configuration
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 onesession_init per session and every tools/call. On the classic protocol the session_init comes from the initialize handshake; on the 2026-07-28 stateless protocol there is no handshake, so the SDK emits it when a new session identity first appears on any method. Prompts, resources, and OAuth flows are not captured.
Troubleshooting
Actor always shows as anonymous behind auth middleware
Actor always shows as anonymous behind auth middleware
With the official SDK adapter, install the analytics middleware before your auth middleware if your
ActorSeed reads values that auth injects into the context.No data arrives
No data arrives
Check
ANALYTICS_INGEST_API_KEY is set (missing keys disable delivery silently by design), check ANALYTICS_INGEST_URL matches your workspace region — EU keys are rejected by the US endpoint — and set Config.OnError to surface failures.
