streamable-httpMITupdated 1mo ago
A lightweight, drop-in production trace collector for LLM agents ā the Go sibling of the Python mirrorkit and TypeScript mirrorkit (npm) packages.
What can you do with Mirrors?
mirrorkit (Go)
A lightweight, drop-in production trace collector for LLM agents ā the Go
sibling of the Python mirrorkit and
TypeScript mirrorkit (npm) packages.
It does exactly one thing: take traces you hand it and send them to your
Mirrors backend ā batched in the background, non-blocking, and safe (it never
panics into your app after Init). It does not instrument SDKs and does
not run agents; you build the trace, it ships it.
Install
go get github.com/ai-singhal/mirrorkit-go
Requires Go ā„ 1.21. Zero dependencies (standard library only).
Usage
package main
import (
"time"
mirrorkit "github.com/ai-singhal/mirrorkit-go"
)
func main() {
mirrorkit.Init(mirrorkit.Options{APIKey: "mk_live_...", Project: "my-agent"})
defer mirrorkit.Shutdown(5 * time.Second)
mirrorkit.LogTrace([]mirrorkit.Message{
mirrorkit.SystemMessage("You are a helpful assistant."),
mirrorkit.UserMessage("What's the weather in Paris?"),
mirrorkit.AssistantMessage("It's 18C and sunny."),
}, mirrorkit.WithModel("claude-opus-4-8"))
}
Each trace is enqueued and flushed to {endpoint}/api/collect by a background
goroutine (Authorization: Bearer <apiKey>, body {project, traces}).
Tool calls
Build tool-call and tool-result messages with the helpers:
mirrorkit.LogTrace([]mirrorkit.Message{
mirrorkit.UserMessage("Cancel booking BK-4471."),
mirrorkit.AssistantToolCalls(
mirrorkit.NewToolCall("call_1", "cancel_booking", map[string]any{"id": "BK-4471"}),
),
mirrorkit.ToolResult("call_1", `{"status":"cancelled"}`),
mirrorkit.AssistantMessage("Done ā BK-4471 is cancelled."),
})
Options
mirrorkit.Init(mirrorkit.Options{
APIKey: "mk_live_...", // required
Project: "my-agent", // default "default"
Endpoint: "https://api.mirror.dev", // else MIRRORKIT_ENDPOINT / MIRROR_ENDPOINT / prod
FlushInterval: 2 * time.Second, // ms between background flushes
MaxBatch: 50, // max traces per POST
MaxQueue: 10_000, // in-memory cap; oldest dropped past this
Debug: false, // internal debug logs (or MIRRORKIT_DEBUG=1)
})
Endpoint resolution: Options.Endpoint ā MIRRORKIT_ENDPOINT ā MIRROR_ENDPOINT
ā the production default.
Lifecycle
mirrorkit.Flush(5 * time.Second) // block until the queue drains
mirrorkit.Shutdown(5 * time.Second) // stop the background goroutine (flushes first)
Prefer one collector per process via the package-level Init / LogTrace /
Flush / Shutdown. For multiple independent collectors, use NewClient and
call LogTrace / Flush / Shutdown on the returned *Client.
Testing
cd mirrorkit-go && go vet ./... && go test ./...
Install
Add Mirrors to your client. Pick the one you use.
claude mcp add --transport http mirrors https://api.runmirrors.com/mcpcodex mcp add mirrors --url https://api.runmirrors.com/mcp{
"mcpServers": {
"mirrors": {
"url": "https://api.runmirrors.com/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"mirrors": {
"type": "http",
"url": "https://api.runmirrors.com/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"mirrors": {
"url": "https://api.runmirrors.com/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mirrors": {
"serverUrl": "https://api.runmirrors.com/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation17/25
- Maintenance16/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 46 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint ā no local install
Version history
| Versions | Published |
|---|---|
| 1.0.0Latest | Aug 3, 2026 |