@virtue-ai/gateway-connect
v0.3.9
Published
One-command setup to connect OpenClaw to VirtueAI MCP gateway
Downloads
1,354
Maintainers
Readme
@virtue-ai/gateway-connect
One-command setup to connect OpenClaw to the VirtueAI MCP gateway. Works with any model — Anthropic, OpenAI, Google, LiteLLM, etc.
Quick Start
Step 1: Install OpenClaw
npm install -g openclaw@latestStep 2: Configure Model Auth
Set up API key for your preferred model provider:
openclaw models auth paste-token --provider anthropic
# or
openclaw models auth paste-token --provider openaiStep 3: Connect to VirtueAI MCP Gateway
# Standalone gateway
npx @virtue-ai/gateway-connect --gateway-url https://virtueai-agent-gtw-xxxx.ngrok.io
# Platform-hosted gateway
npx @virtue-ai/gateway-connect --gateway-url https://your-domain.ngrok.app/api/gateways/gtw_xxxxThis will:
- Open your browser for OAuth login
- Fetch all MCP tools from the gateway
- Generate a native OpenClaw plugin wrapping each tool (
~/.openclaw/extensions/virtueai-mcp-tools/) - Patch
~/.openclaw/openclaw.jsonto enable the plugin - Install the trajectory recording plugin
Step 4: Start Using
One-shot mode:
openclaw agent --local --agent main --message "What tools do you have?"Interactive TUI mode:
# Terminal 1: start the OpenClaw gateway
openclaw gateway --allow-unconfigured
# Terminal 2: open the TUI
openclaw tuiTo stop the gateway, press Ctrl+C in Terminal 1, or run:
openclaw gateway stopSwitching Models
In TUI mode, use slash commands to switch models on the fly:
/model openai/gpt-5.2
/model anthropic/claude-opus-4-6
/models # opens model pickerAll gateway tools remain available regardless of which model you use. Any model with a configured API key can be selected.
What It Does
gateway-connect generates a native OpenClaw plugin that registers every MCP gateway tool via api.registerTool(). Each tool call is proxied to the gateway as a JSON-RPC tools/call request with Bearer auth.
This approach works with any embedded model provider (not just Claude CLI), because the tools are part of OpenClaw's plugin system rather than being passed via --mcp-config.
Generated Files
| Path | Purpose |
|------|---------|
| ~/.openclaw/extensions/virtueai-mcp-tools/ | Native plugin with all gateway tools |
| ~/.openclaw/extensions/virtueai-trajectory/ | Trajectory recording plugin |
| ~/.openclaw/mcp-gateway.json | Auth & trajectory config |
| ~/.openclaw/openclaw.json | Patched with plugin entries |
Options
npx @virtue-ai/gateway-connect [options]
Options:
--gateway-url <url> Gateway URL (standalone or platform-hosted)
--api-url <url> Prompt-guard API URL (default: https://agentgateway1.virtueai.io)
--gateway-id <id> Gateway ID for trajectory recording
--model <model> Model to use (e.g. openai/gpt-4o, anthropic/claude-sonnet-4-5)
--guard-uuid <uuid> Guard UUID for trajectory recording (or set VIRTUEAI_GUARD_UUID)
--help Show help messageRe-authentication
If your token expires, just run the command again. It will regenerate the plugin with a fresh token.
License
MIT
