Go Micro
February 11, 2026 • By the Go Micro Team
We’re excited to announce MCP (Model Context Protocol) support in Go Micro v5.15.0 — making your microservices instantly accessible to AI tools like Claude.
Imagine telling Claude: “Why is user 123’s order stuck?”
Claude responds by:
users service to check the accountorders service to inspect the orderpayments service to verify the transactionNo API wrappers. No manual integrations. Your services just work with AI.
Model Context Protocol is Anthropic’s open standard for connecting AI models to external tools. Think of it like a microservices registry, but for AI.
With MCP, your go-micro services become tools that Claude can discover and call directly.
package main
import (
"go-micro.dev/v5"
"go-micro.dev/v5/gateway/mcp" // ← New package
)
func main() {
service := micro.NewService(micro.Name("users"))
service.Init()
// Add MCP gateway
go mcp.Serve(mcp.Options{
Registry: service.Options().Registry,
Address: ":3000",
})
service.Run()
}
That’s it. Your service is now AI-accessible.
# Development with MCP
micro run --mcp-address :3000
# Production with MCP
micro server --mcp-address :3000
The CLI integration uses the same underlying library, so you get the same functionality either way.
For example, if you have:
type UsersService struct{}
func (u *UsersService) Get(ctx context.Context, req *GetRequest, rsp *GetResponse) error {
// ...
}
func (u *UsersService) Create(ctx context.Context, req *CreateRequest, rsp *CreateResponse) error {
// ...
}
Claude sees:
Tools:
- users.UsersService.Get
- users.UsersService.Create
And can call them with natural language: “Get user 123’s details”
# Claude can help support agents
User: "Why is my order taking so long?"
Claude: Let me check...
→ Calls orders.Orders.Get with user's order ID
→ Calls shipping.Shipping.Track with tracking number
→ Calls inventory.Inventory.Check with product ID
Claude: "Your order is waiting for inventory. The product
is expected to be restocked on Feb 15. Would you like to
switch to an in-stock alternative?"
# Tell Claude the symptoms, it investigates
You: "Users can't log in. Check if it's the auth service."
Claude:
→ Calls health.Check on auth service
→ Calls metrics.Get for error rates
→ Calls logs.Recent for auth failures
→ Calls database.ConnectionPool for connection issues
Claude: "The auth service is healthy but the connection
pool is exhausted. Current: 100/100. Recommend increasing
pool size or checking for connection leaks."
# Claude as an operations assistant
You: "Scale up the worker service"
Claude:
→ Calls infrastructure.Services.List to find workers
→ Calls infrastructure.Services.Scale with new count
→ Calls metrics.Monitor to watch the scale-up
Claude: "Scaled from 3 to 5 workers. All healthy and
processing jobs normally."
# Claude can query your services for insights
You: "Show me revenue trends for the last quarter"
Claude:
→ Calls analytics.Revenue.GetTrends with date range
→ Calls analytics.Revenue.Compare with previous quarter
→ Calls analytics.Revenue.TopProducts
Claude: "Revenue is up 23% vs Q4. Top driver is product X
with 45% growth. However, churn increased 5% — recommend
investigating retention."
Add MCP directly to your services:
func main() {
service := micro.NewService(...)
go mcp.Serve(mcp.Options{
Registry: service.Options().Registry,
Address: ":3000",
})
service.Run()
}
Best for: Simple deployments, quick prototypes
Deploy a dedicated MCP gateway service:
// cmd/mcp-gateway/main.go
package main
import (
"go-micro.dev/v5/gateway/mcp"
"go-micro.dev/v5/registry/consul"
)
func main() {
mcp.ListenAndServe(":3000", mcp.Options{
Registry: consul.NewRegistry(),
})
}
Best for: Production, multiple services, centralized auth
version: '3.8'
services:
users:
build: ./users
environment:
- MICRO_REGISTRY=mdns
orders:
build: ./orders
environment:
- MICRO_REGISTRY=mdns
mcp-gateway:
build: ./mcp-gateway
ports:
- "3000:3000"
environment:
- MICRO_REGISTRY=mdns
Best for: Local development, testing
apiVersion: apps/v1
kind: Deployment
metadata:
name: mcp-gateway
spec:
replicas: 2
template:
spec:
containers:
- name: mcp-gateway
image: myregistry/mcp-gateway:latest
ports:
- containerPort: 3000
env:
- name: MICRO_REGISTRY
value: "consul"
- name: MICRO_REGISTRY_ADDRESS
value: "consul:8500"
Best for: Production at scale
mcp.Serve(mcp.Options{
Registry: registry.DefaultRegistry,
Address: ":3000",
AuthFunc: func(r *http.Request) error {
token := r.Header.Get("Authorization")
if !validateToken(token) {
return errors.New("unauthorized")
}
return nil
},
})
Deploy MCP gateway in a private network:
Internet
│
┌──────▼────────┐
│ micro server │ :8080 (public)
│ + Auth │
└──────┬────────┘
│
┌──────▼────────┐
│ MCP Gateway │ :3000 (private)
└──────┬────────┘
│
┌──────────┼──────────┐
│ │ │
┌───▼───┐ ┌──▼────┐ ┌──▼────┐
│ users │ │ orders│ │payments│
└───────┘ └───────┘ └────────┘
(private) (private) (private)
Only the HTTP gateway is public. MCP gateway and services are internal.
Both approaches use the same underlying library (go-micro.dev/v5/gateway/mcp):
| Approach | Users | Benefits |
|---|---|---|
| Library | Import gateway/mcp package |
Full control, works anywhere (Docker/K8s) |
| CLI | Use --mcp-address flag |
Zero code changes, instant MCP support |
The CLI is just a convenient wrapper around the library.
go get go-micro.dev/v5@v5.15.0
import "go-micro.dev/v5/gateway/mcp"
go mcp.Serve(mcp.Options{
Registry: service.Options().Registry,
Address: ":3000",
})
micro run --mcp-address :3000
# or
micro server --mcp-address :3000
# List available tools
curl http://localhost:3000/mcp/tools
# Call a tool
curl -X POST http://localhost:3000/mcp/call \
-d '{"tool": "users.Users.Get", "input": {"id": "123"}}'
MCP support is just the beginning of making go-micro AI-native. We’re exploring:
Go Micro has always been about composable microservices. MCP extends that philosophy:
AI is becoming infrastructure. Your services should be ready.
# Update to v5.15.0
go get go-micro.dev/v5@v5.15.0
# Add MCP to your service
import "go-micro.dev/v5/gateway/mcp"
go mcp.Serve(mcp.Options{
Registry: service.Options().Registry,
Address: ":3000",
})
# Or use the CLI
micro run --mcp-address :3000
See the MCP Gateway documentation for full details.
Go Micro is an open source framework for distributed systems development in Go. Star us on GitHub.