AIW - AI CLI & MCP Unified Gateway
Unified Router & Proxy for AI CLI Tools and MCP Servers
What is AIW?
AIW is a unified gateway that acts as:
| Layer | Role | What it does |
|---|---|---|
| AI CLI Proxy | Router + Proxy | Route requests to claude/codex/gemini with provider switching, role injection, and transparent parameter forwarding |
| MCP Proxy | Router + Proxy | Route tool calls to multiple MCP servers with intelligent selection, plugin marketplace, and hot-reload |
┌─────────────────────────────────────────────────────────────┐
│ AIW Gateway │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────┐ ┌─────────────────────────────┐ │
│ │ AI CLI Router │ │ MCP Router │ │
│ │ │ │ │ │
│ │ aiw claude ... ───┼───►│ Claude CLI │ │
│ │ aiw codex ... ───┼───►│ Codex CLI │ │
│ │ aiw gemini ... ───┼───►│ Gemini CLI │ │
│ │ │ │ │ │
│ │ + Provider Switch │ │ aiw mcp serve ────────────►│ │
│ │ + Role Injection │ │ ├─► filesystem server │ │
│ │ + Param Forwarding │ │ ├─► git server │ │
│ │ + CWD Control │ │ ├─► database server │ │
│ │ │ │ └─► ... (plugin market) │ │
│ └─────────────────────┘ └─────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Installation
# Install from NPM
# Verify installation
AI CLI Router & Proxy
Basic Usage
# Route to specific AI CLI
# Route to multiple AI CLIs
Provider Switching (-p)
# Switch API provider without changing AI CLI
# Provider config: ~/.aiw/providers.json
Role Injection (-r)
# Inject role prompt before task
# 22 built-in roles + custom roles in ~/.aiw/role/*.md
Working Directory (-C)
# Start AI CLI in specific directory
Transparent Parameter Forwarding
# All unknown flags forwarded to AI CLI
# Order: aiw flags (-r, -p, -C) → AI CLI flags → prompt
Combined Example
# Full example with all options
# ^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
# role provider cwd forwarded prompt
MCP Router & Proxy
Start MCP Server
# Start AIW as MCP server
# Configure in Claude Code (~/.claude/settings.json)
{
}
MCP Server Management
# List configured MCP servers
# Add MCP server
# Enable/disable servers (hot-reload)
# Edit config directly
MCP Registry (Search & Install)
# Browse all available MCP servers (interactive TUI)
# Search across registries (Official + Smithery)
# Get server info
# Install server
Plugin Marketplace
# Browse MCP plugins (interactive TUI)
# Search plugins
# Install plugin
# List/manage installed plugins
# Manage marketplace sources
Task Monitoring
# Show task status
# Wait for all AI CLI tasks to complete
# Wait for specific process
Update
# Update AIW and all AI CLI tools
Configuration Files
| File | Purpose |
|---|---|
~/.aiw/providers.json |
AI provider configurations |
~/.aiw/mcp.json |
MCP server configurations |
~/.aiw/role/*.md |
Custom role prompts |
~/.aiw/settings.json |
Plugin marketplace settings |
~/.aiw/plugins.json |
Installed plugin records |
Quick Reference
# AI CLI routing
# MCP commands
||||
# Plugin commands
||||
# Other commands
License
MIT License - see LICENSE file for details.
AIW - Unified Gateway for AI CLI & MCP | v0.5.35