|
| 1 | +# awmg - Agentic Workflows MCP Gateway |
| 2 | + |
| 3 | +`awmg` is a standalone binary that implements an MCP (Model Context Protocol) gateway for aggregating multiple MCP servers into a single HTTP endpoint. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +### From Source |
| 8 | + |
| 9 | +```bash |
| 10 | +# Clone the repository |
| 11 | +git clone https://github.com/githubnext/gh-aw.git |
| 12 | +cd gh-aw |
| 13 | + |
| 14 | +# Build the binary |
| 15 | +make build-awmg |
| 16 | + |
| 17 | +# The binary will be created as ./awmg |
| 18 | +``` |
| 19 | + |
| 20 | +### Pre-built Binaries |
| 21 | + |
| 22 | +Download the latest release from the [GitHub releases page](https://github.com/githubnext/gh-aw/releases). |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +```bash |
| 27 | +# Start gateway with config file |
| 28 | +awmg --config config.json |
| 29 | + |
| 30 | +# Start gateway reading from stdin |
| 31 | +echo '{"mcpServers":{...}}' | awmg --port 8080 |
| 32 | + |
| 33 | +# Custom log directory |
| 34 | +awmg --config config.json --log-dir /var/log/mcp-gateway |
| 35 | +``` |
| 36 | + |
| 37 | +## Configuration |
| 38 | + |
| 39 | +The gateway accepts JSON configuration with the following format: |
| 40 | + |
| 41 | +```json |
| 42 | +{ |
| 43 | + "mcpServers": { |
| 44 | + "server-name": { |
| 45 | + "command": "command-to-run", |
| 46 | + "args": ["arg1", "arg2"], |
| 47 | + "env": { |
| 48 | + "ENV_VAR": "value" |
| 49 | + } |
| 50 | + }, |
| 51 | + "another-server": { |
| 52 | + "url": "http://localhost:3000" |
| 53 | + } |
| 54 | + }, |
| 55 | + "gateway": { |
| 56 | + "port": 8080, |
| 57 | + "apiKey": "optional-api-key" |
| 58 | + } |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +### Configuration Fields |
| 63 | + |
| 64 | +- `mcpServers`: Map of MCP server configurations |
| 65 | + - Each server can be configured with: |
| 66 | + - `command`: Command to execute (for stdio transport) |
| 67 | + - `args`: Command arguments |
| 68 | + - `env`: Environment variables |
| 69 | + - `url`: HTTP URL (for HTTP transport) |
| 70 | +- `gateway`: Gateway-specific settings |
| 71 | + - `port`: HTTP port (default: 8080) |
| 72 | + - `apiKey`: Optional API key for authentication |
| 73 | + |
| 74 | +## Endpoints |
| 75 | + |
| 76 | +Once running, the gateway exposes the following HTTP endpoints: |
| 77 | + |
| 78 | +- `GET /health` - Health check endpoint |
| 79 | +- `GET /servers` - List all configured MCP servers |
| 80 | +- `POST /mcp/{server}` - Proxy MCP requests to a specific server |
| 81 | + |
| 82 | +## Examples |
| 83 | + |
| 84 | +### Example 1: Single gh-aw MCP Server |
| 85 | + |
| 86 | +```json |
| 87 | +{ |
| 88 | + "mcpServers": { |
| 89 | + "gh-aw": { |
| 90 | + "command": "gh", |
| 91 | + "args": ["aw", "mcp-server"] |
| 92 | + } |
| 93 | + }, |
| 94 | + "gateway": { |
| 95 | + "port": 8088 |
| 96 | + } |
| 97 | +} |
| 98 | +``` |
| 99 | + |
| 100 | +### Example 2: Multiple Servers |
| 101 | + |
| 102 | +```json |
| 103 | +{ |
| 104 | + "mcpServers": { |
| 105 | + "gh-aw": { |
| 106 | + "command": "gh", |
| 107 | + "args": ["aw", "mcp-server"], |
| 108 | + "env": { |
| 109 | + "DEBUG": "cli:*" |
| 110 | + } |
| 111 | + }, |
| 112 | + "remote-server": { |
| 113 | + "url": "http://localhost:3000" |
| 114 | + } |
| 115 | + }, |
| 116 | + "gateway": { |
| 117 | + "port": 8088 |
| 118 | + } |
| 119 | +} |
| 120 | +``` |
| 121 | + |
| 122 | +## Integration with GitHub Agentic Workflows |
| 123 | + |
| 124 | +The awmg binary is designed to work seamlessly with GitHub Agentic Workflows. When you configure `sandbox.mcp` in your workflow, the system automatically sets up the MCP gateway: |
| 125 | + |
| 126 | +```yaml |
| 127 | +--- |
| 128 | +sandbox: |
| 129 | + mcp: |
| 130 | + container: ghcr.io/githubnext/mcp-gateway |
| 131 | + port: 8080 |
| 132 | +--- |
| 133 | +``` |
| 134 | + |
| 135 | +## Features |
| 136 | + |
| 137 | +- ✅ **Multiple MCP Servers**: Connect to and manage multiple MCP servers |
| 138 | +- ✅ **HTTP Gateway**: Expose all servers through a unified HTTP interface |
| 139 | +- ✅ **Protocol Support**: Supports initialize, list_tools, call_tool, list_resources, list_prompts |
| 140 | +- ✅ **Comprehensive Logging**: Per-server log files with detailed operation logs |
| 141 | +- ✅ **Command Transport**: Subprocess-based MCP servers via stdio |
| 142 | +- ⏳ **HTTP Transport**: HTTP/SSE transport (planned) |
| 143 | +- ⏳ **Docker Support**: Container-based MCP servers (planned) |
| 144 | + |
| 145 | +## Development |
| 146 | + |
| 147 | +```bash |
| 148 | +# Run tests |
| 149 | +make test |
| 150 | + |
| 151 | +# Build for all platforms |
| 152 | +make build-all |
| 153 | + |
| 154 | +# Clean build artifacts |
| 155 | +make clean |
| 156 | +``` |
| 157 | + |
| 158 | +## See Also |
| 159 | + |
| 160 | +- [MCP Gateway Specification](../specs/mcp-gateway.md) |
| 161 | +- [MCP Gateway Usage Guide](mcp-gateway.md) |
| 162 | +- [GitHub Agentic Workflows Documentation](https://github.com/githubnext/gh-aw) |
0 commit comments