Skip to content

rauriemo/conduit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conduit

Go License: MIT

Conduit is a reusable Go module providing MCP (Model Context Protocol) substrate: a typed configuration model, a named connection pool, and a .mcp.json bridge writer. It exists so that MCP plumbing is portable across orchestrators -- Anthem today, Anthropic managed agents tomorrow, other runtimes later.

Built on the official Go SDK for MCP.

Quick Start

go get github.com/rauriemo/conduit
import (
    "github.com/rauriemo/conduit/pkg/mcpconfig"
    "github.com/rauriemo/conduit/pkg/mcpclient"
    "github.com/rauriemo/conduit/pkg/mcpbridge"
)

Packages

pkg/mcpconfig -- Configuration Model

Canonical MCP server reference with explicit transport discriminator.

ref := mcpconfig.MCPServerRef{
    Type:    mcpconfig.TransportStdio,
    Command: "node",
    Args:    []string{"path/to/server.js"},
}

if err := ref.Validate(); err != nil {
    log.Fatal(err)
}

Supports two transports per the MCP spec:

  • stdio -- spawn a subprocess (Command, Args, Env)
  • http -- Streamable HTTP (URL, AuthTokenEnv, Headers)

pkg/mcpclient -- Connection Pool

Named connection pool wrapping the official go-sdk. Manages concurrent MCP server sessions.

pool := mcpclient.NewPool()
defer pool.Close()

err := pool.Connect(ctx, "unity-mcp", &ref)

tools, err := pool.ListTools(ctx, "unity-mcp")

result, err := pool.CallTool(ctx, "unity-mcp", "SomeToolName", map[string]any{
    "name": "Player",
    "tag":  "Player",
})

Thread-safe. Transport selected automatically from MCPServerRef.Type. Bearer auth resolved from environment variables at connect time.

pkg/mcpbridge -- .mcp.json Bridge Writer

Writes .mcp.json for Claude Code auto-discovery. Anthem (v1) uses this bridge for guest agents and relies on Claude Code to run MCP tools; the Pool is for programmatic/brokered use when an orchestrator calls tools in-process.

err := mcpbridge.WriteMCPConfig("/path/to/workspace", servers)

Architecture

┌─────────────────────────────────────────────┐
│              Your Orchestrator              │
│         (Anthem, managed agents, …)         │
└──────┬──────────────┬──────────────┬────────┘
       │              │              │
       v              v              v
  mcpconfig      mcpclient      mcpbridge
  (types +       (pool +        (.mcp.json
   validate)      go-sdk)        writer)
       │              │
       │              v
       │     ┌────────────────┐
       └────>│  go-sdk (MCP)  │
             └────────┬───────┘
                      │
              ┌───────┴───────┐
              v               v
         stdio server    HTTP server
         (Unity relay,   (future)
          other CLIs)

Conduit owns the boxes in the middle row. Everything above (orchestration, policy, dispatch) and below (actual MCP servers) belongs to other repos.

What Conduit Does NOT Own

  • Orchestration, dispatch, or execution loops
  • HTTP/API tool brokering (simple REST calls)
  • Shared feature context or artifact management
  • Guest agent definitions or policy enforcement
  • Allowlist logic

These are Anthem's concerns. Conduit is the substrate, not the platform.

Module Layout

conduit/
  go.mod
  pkg/
    mcpconfig/
      config.go          # MCPServerRef, Transport, Validate
      config_test.go
    mcpclient/
      pool.go            # Connection pool wrapping go-sdk
      pool_test.go
    mcpbridge/
      bridge.go          # .mcp.json writer
      bridge_test.go
  CLAUDE.md
  README.md

Development

go build ./...           # Build
go test ./... -race      # Test with race detector
go vet ./...             # Vet

Related Projects

License

MIT

About

Reusable MCP substrate -- config model, connection pool, and .mcp.json bridge for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages