Skip to content
xrmcpPublic

About

GO SDK for xrMCP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

xrMCP Go SDK

Go runtime for xrMCP — install AI tools from JSON manifests without deploying hardcoded MCP servers.

What it does

The SDK provides a ready-to-run MCP server you embed in your own application. It exposes:

  • POST /tools/register — register a tool from a .xrmcp.json manifest at runtime
  • GET /tools/list-installed — list currently installed tools
  • DELETE /tools/{name} — uninstall a tool
  • MCP transport (stdio by default, Streamable HTTP with XRMCP_TRANSPORT=http)

Quick start

go get github.com/xrmcp/go-sdk

See examples/getting-started/ for a minimal host server.

Register a tool

# Using curl
curl -X POST http://localhost:7373/tools/register \
  -H 'authorization: Bearer my-secret-token' \
  -H 'content-type: application/json' \
  -d @examples/getting-started/tools.json

# Using the CLI
XRMCP_API_TOKEN=my-secret-token xrmcp tool install examples/getting-started/tools.json

Tool manifests follow specification/v0.1.0/schema.json.

Configuration

Env var Default Description
XRMCP_TRANSPORT stdio stdio or http
XRMCP_ADDR :7373 HTTP listen address (http transport)
XRMCP_STORE_PATH ./xrmcp_store/tools.json Tool registry persistence path
XRMCP_API_AUTH_MODE none REST management auth mode: none or bearer
XRMCP_API_TOKEN Required when XRMCP_API_AUTH_MODE=bearer

Protected REST management endpoints:

  • POST /tools/register
  • GET /tools/list-installed
  • DELETE /tools/{name}

When XRMCP_API_AUTH_MODE=bearer, these endpoints require:

Authorization: Bearer <token>

If neither XRMCP_API_AUTH_MODE nor XRMCP_API_TOKEN is set, startup logs a warning that the REST API is running in development mode without auth.

Example:

export XRMCP_TRANSPORT=http
export XRMCP_API_AUTH_MODE=bearer
export XRMCP_API_TOKEN=my-secret-token
go run ./examples/getting-started

Current scope

  • api execution type only
  • registry persists to disk (XRMCP_STORE_PATH by default)
  • manifest-native tool exposure through the official MCP Go SDK
  • minimal permission enforcement

Secrets

Secrets referenced in manifests (e.g. {{secrets.MY_TOKEN}}) are resolved via a SecretStore. The default store reads from environment variables. Pass a custom store to use any backend:

import "github.com/xrmcp/go-sdk/xrmcp"

type VaultStore struct{}

func (v VaultStore) Get(name string) (string, bool) {
    val, err := vaultClient.Read(name)
    return val, err == nil
}

xrmcp.NewXRMCPRuntime(xrmcp.WithSecretStore(VaultStore{})).StartServer(ctx)

Limitations

  • permissions.network uses a minimal allowlist check

About

GO SDK for xrMCP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages