---
title: "Building the AI-Native Future of Go Micro with Claude"
linkTitle: "Building with Claude"
date: 2026-03-04
description: "How Anthropic's Claude Max sponsorship accelerated Go Micro's MCP integration — WebSocket transport, OpenTelemetry, agent SDKs, and what's next"
aliases:
  - /blog/3
---
> Go Micro was recently given access to **Claude Max** through Anthropic's open source sponsorship program. We wanted to share what we've built with it, why it matters, and where we're headed.

## The Sponsorship

Anthropic offers Claude Max access to open source projects. Go Micro applied because our MCP integration — making every microservice an AI tool — aligns directly with Anthropic's Model Context Protocol. They agreed, and we got to work.

The result: **three major features shipped in a single sprint**, taking our Q2 2026 roadmap from 85% to 95% complete.

## What We Built

### 1. WebSocket Transport for Real-Time Agents

The MCP gateway previously supported HTTP/SSE and stdio transports. These work well for request/response patterns, but real-time AI agents need persistent, bidirectional connections.

We added a full **WebSocket transport** implementing JSON-RPC 2.0:

```go
// Connect via WebSocket for bidirectional streaming
ws://localhost:3000/mcp/ws
```

What this enables:
- **Persistent connections** — No HTTP overhead per tool call
- **Bidirectional streaming** — Server can push updates to agents
- **Connection-level auth** — Authenticate once on connect, not per request
- **Concurrent requests** — Multiple tool calls over a single connection

The WebSocket transport supports the same JSON-RPC 2.0 protocol as stdio (`initialize`, `tools/list`, `tools/call`), so any MCP client that speaks WebSocket can connect.

```javascript
// Agent connects and discovers tools
const ws = new WebSocket("ws://localhost:3000/mcp/ws", {
  headers: { "Authorization": "Bearer my-token" }
});

// Initialize
ws.send(JSON.stringify({
  jsonrpc: "2.0", id: 1,
  method: "initialize",
  params: { protocolVersion: "2024-11-05" }
}));

// List tools
ws.send(JSON.stringify({
  jsonrpc: "2.0", id: 2,
  method: "tools/list"
}));

// Call a tool
ws.send(JSON.stringify({
  jsonrpc: "2.0", id: 3,
  method: "tools/call",
  params: {
    name: "users.Users.Get",
    arguments: { "id": "user-123" }
  }
}));
```

This is particularly useful for the agent playground in `micro run`, where the browser maintains a persistent WebSocket connection for interactive AI conversations.

### 2. OpenTelemetry Integration

Production deployments need observability. We added **full OpenTelemetry span instrumentation** across all three MCP transports (HTTP, stdio, WebSocket).

```go
import "go.opentelemetry.io/otel/sdk/trace"

// Add tracing to your MCP gateway
mcp.Serve(mcp.Options{
    Registry:      service.Options().Registry,
    Address:       ":3000",
    TraceProvider: traceProvider, // Your OTel trace provider
})
```

Every tool call now creates a span with rich attributes:

```
Span: mcp.tool.call
  mcp.tool.name: users.Users.Get
  mcp.transport: websocket
  mcp.account.id: agent-001
  mcp.auth.status: allowed
  mcp.rate_limit.allowed: true
```

This connects to your existing observability stack — Jaeger, Grafana, Datadog, whatever you use. You can now trace an AI agent's tool calls through your entire service mesh.

The integration is backward compatible: if you don't set a `TraceProvider`, spans are no-ops with zero overhead.

### 3. LlamaIndex SDK

With the [LangChain SDK](https://github.com/micro/go-micro/tree/master/contrib/langchain-go-micro) already shipped, we built the **LlamaIndex integration** — enabling RAG (Retrieval-Augmented Generation) workflows with Go Micro services.

```python
from go_micro_llamaindex import GoMicroToolkit
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI

# Connect to your services
toolkit = GoMicroToolkit.from_gateway("http://localhost:3000")

# Create a ReAct agent with your service tools
agent = ReActAgent.from_tools(
    toolkit.get_tools(),
    llm=OpenAI(model="gpt-4"),
    verbose=True
)

# The agent can now call your microservices
response = agent.chat("Get the profile for user-123")
```

The LlamaIndex SDK supports the same filtering as LangChain:

```python
# Filter by service
user_tools = toolkit.get_tools(service_filter="users")

# Filter by pattern
blog_tools = toolkit.get_tools(name_pattern="blog.*")

# Combine with RAG
from llama_index.core import VectorStoreIndex
from llama_index.core.tools import QueryEngineTool

index = VectorStoreIndex.from_documents(documents)
rag_tool = QueryEngineTool(query_engine=index.as_query_engine(), ...)

# Agent has both document search AND service access
all_tools = [rag_tool] + toolkit.get_tools()
agent = ReActAgent.from_tools(all_tools, llm=llm)
```

This is powerful: an agent can search your documentation AND call your services in the same conversation.

## By The Numbers

Here's where Go Micro's MCP integration stands today:

| Metric | Value |
|--------|-------|
| **MCP Gateway Code** | 2,500+ lines |
| **Test Coverage** | 1,000+ lines, 35+ tests |
| **Transports** | 3 (HTTP/SSE, Stdio, WebSocket) |
| **Agent SDKs** | 2 (LangChain, LlamaIndex) |
| **Model Providers** | 2 (Anthropic Claude, OpenAI GPT) |
| **Security** | Auth, scopes, rate limiting, audit, OTel |

The Q1 2026 foundation is complete, Q2 is at 95%, and we've already delivered 50% of Q3's production features ahead of schedule.

## What This Means for You

If you're building microservices with Go Micro, your services are already AI-ready. Here's what you can do today:

### Add MCP to an existing service (3 lines)

```go
go mcp.Serve(mcp.Options{
    Registry: service.Options().Registry,
    Address:  ":3000",
})
```

### Use it with Claude Code

```json
{
  "mcpServers": {
    "my-services": {
      "command": "micro",
      "args": ["mcp", "serve"]
    }
  }
}
```

### Connect LangChain or LlamaIndex agents

```python
toolkit = GoMicroToolkit.from_gateway("http://localhost:3000")
tools = toolkit.get_tools()
```

### Monitor with OpenTelemetry

```go
mcp.Serve(mcp.Options{
    Registry:      registry,
    TraceProvider: otelProvider,
    AuditFunc:     func(r mcp.AuditRecord) { /* log it */ },
})
```

## Working with Claude

A note on the development process itself: we used Claude (via Claude Code) to implement these features. It wrote production Go code, ran the tests, fixed compilation errors, and iterated on the implementation. The WebSocket transport went from zero to 14 passing tests in a single session. The OpenTelemetry integration was designed, implemented, and tested in another.

This is exactly the kind of workflow that MCP enables. An AI agent that understands your codebase, calls your tools, and ships features. Go Micro is both the framework for building this and a beneficiary of it.

## What's Next

With Q2 nearly wrapped, we're focused on:

1. **Agent Playground polish** — The `/agent` chat UI in `micro run` needs refinement for demos and daily development
2. **Standalone gateway binary** — `micro-mcp-gateway` as a production-grade, independently deployable binary
3. **More examples** — Real-world services that demonstrate the full AI-native workflow

The MCP ecosystem is growing fast. We think every microservices framework will have MCP support eventually — Go Micro just got there first.

## Try It

```bash
# Install or update
go install go-micro.dev/v5/cmd/micro@latest

# Create a service
micro new myservice
cd myservice

# Run with MCP and the agent playground
micro run --mcp-address :3000

# Open http://localhost:8080/agent and chat with your service
```

See the [MCP documentation](/docs/mcp.html) and [AI-native services guide](/docs/guides/ai-native-services.html) for the full walkthrough.

---

*Go Micro is an open source framework for distributed systems development. [Star us on GitHub](https://github.com/micro/go-micro) — we're at 21K stars and growing.*

*Thanks to Anthropic for the Claude Max sponsorship through their open source program.*
