Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6e52644
Initial plan
Copilot Dec 20, 2025
9f318c6
Add mcp-gateway command implementation
Copilot Dec 20, 2025
daf61c0
Add tests for mcp-gateway command
Copilot Dec 20, 2025
f61e2d9
Add documentation and integration test for mcp-gateway
Copilot Dec 20, 2025
6e42e2d
Add implementation summary for mcp-gateway
Copilot Dec 20, 2025
8ade5e1
Enable mcp-gateway in smoke-copilot and remove feature flag
Copilot Dec 20, 2025
e8d76c0
Add awmg standalone CLI for MCP gateway
Copilot Dec 20, 2025
739f1ab
Run MCP gateway as CLI command instead of Docker container
Copilot Dec 20, 2025
5bb2099
Add integration test for MCP gateway with mcp inspect
Copilot Dec 20, 2025
940fbfd
Remove gh aw mcp-gateway subcommand, keep only awmg standalone binary
Copilot Dec 20, 2025
1ad37ba
Enable sandbox MCP gateway in dev.md workflow
Copilot Dec 20, 2025
fe83edb
Remove container requirement and gh CLI dependency from MCP gateway
Copilot Dec 20, 2025
e2d5ecb
Merge branch 'main' into copilot/add-mcp-gateway-command
pelikhan Dec 20, 2025
2ee32d7
Build awmg from sources in development mode
Copilot Dec 20, 2025
392a3d3
Fix dev mode logic: prioritize build-from-sources over download
Copilot Dec 20, 2025
a88e1d8
Move development mode detection to compile-time instead of runtime
Copilot Dec 20, 2025
b088215
Move MCP gateway steps after Setup MCPs step
Copilot Dec 20, 2025
9a76c8d
Add comprehensive logging for MCP gateway configuration loading
Copilot Dec 20, 2025
da3317d
Merge branch 'main' into copilot/add-mcp-gateway-command
pelikhan Dec 20, 2025
1963180
Merge remote-tracking branch 'origin/main' into copilot/add-mcp-gatew…
pelikhan Dec 20, 2025
6bf5394
Implement feature X to enhance user experience and optimize performance
pelikhan Dec 20, 2025
f455440
Update dev.md to create issue with poem in staged mode
Copilot Dec 20, 2025
4fc2425
Make CLI fail on missing config or no servers, add extensive logging
Copilot Dec 20, 2025
a370e9b
Add multi-config parsing support to MCP gateway (#7094)
Copilot Dec 21, 2025
4f0f153
Pass MCP config file path to awmg via --config flag
Copilot Dec 21, 2025
bb208bf
Filter out safe-inputs and safe-outputs from MCP gateway
Copilot Dec 21, 2025
6e46b45
Fix server names to filter: use safeinputs/safeoutputs without dashes
Copilot Dec 21, 2025
f516799
Update dev.md to read last issue and write poem about it in staged mode
Copilot Dec 21, 2025
6137e85
Add MCP config rewriting to point servers to gateway
Copilot Dec 21, 2025
e9dab19
Move per-server logs to subfolders under /tmp/gh-aw/mcp-logs/
Copilot Dec 21, 2025
a6bb468
Simplify log directory to flat structure - no subfolders per server
Copilot Dec 21, 2025
7f97d7c
Add MCP config file content logging to gateway health check
Copilot Dec 21, 2025
58aac2a
Merge branch 'main' into copilot/add-mcp-gateway-command
pelikhan Dec 22, 2025
9939374
Keep safeinputs/safeoutputs in rewritten config, remove gateway section
Copilot Dec 22, 2025
4165178
Merge remote-tracking branch 'origin/main' into copilot/add-mcp-gatew…
Copilot Dec 22, 2025
634b70c
Recompile all workflow files
Copilot Dec 22, 2025
2a91f66
Add safeinputs/safeoutputs verification to gateway health check
Copilot Dec 22, 2025
a3b4961
Co-authored-by: pelikhan <[email protected]>
Copilot Dec 22, 2025
2a99fab
Fix awmg to properly write modified config file back
Copilot Dec 22, 2025
1673f57
Add type:http and tools:["*"] to rewritten gateway servers
Copilot Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .github/aw/github-agentic-workflows.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/aw/schemas/agentic-workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,6 @@
"description": "API key for authenticating with the MCP gateway (supports ${{ secrets.* }} syntax)"
}
},
"required": ["container"],
"additionalProperties": false
}
},
Expand Down
1,871 changes: 859 additions & 1,012 deletions .github/workflows/dev.lock.yml

Large diffs are not rendered by default.

42 changes: 25 additions & 17 deletions .github/workflows/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,43 @@
on:
workflow_dispatch:
name: Dev
description: Add a poem to the latest discussion
description: Test MCP gateway with issue creation in staged mode
timeout-minutes: 5
strict: true
engine: copilot

permissions:
contents: read
discussions: read
issues: read

sandbox:
mcp:
port: 8080

tools:
github:
toolsets: [discussions]
toolsets: [issues]
safe-outputs:
create-issue:
title-prefix: "[Poetry Test] "
max: 1
imports:
- shared/gh.md
safe-outputs:
update-discussion:
target: "*"
body:
messages:
footer: "> 📝 Poetry generated by [{workflow_name}]({run_url})"
footer-install: "> Want to add poems to your discussions? Install with `gh aw add {workflow_source}`"
---

Find the latest discussion in this repository and update its body by appending a short, creative poem about GitHub Agentic Workflows.
# Test MCP Gateway: Read Last Issue and Write Poem in Staged Mode

The poem should:
- Be 4-8 lines long
- Mention automation, AI agents, or workflow concepts
- Be uplifting and inspiring
- Be added to the existing discussion body
Read the most recent issue from the repository and write a creative poem about it in a new issue using **staged mode** (preview mode).

You MUST use the update_discussion tool to update a discussion with a poem in the body. This is required.
**Requirements:**
1. Use the GitHub tools to fetch the most recent issue from this repository
2. Read the issue title and body to understand what it's about
3. Write a short, creative poem (4-6 lines) inspired by the content of that issue
4. Create a new issue with:
- Title: Start with the prefix "[Poetry Test]" followed by a creative title that relates to the original issue
- Body: Your poem about the issue, plus a reference to the original issue number
5. **IMPORTANT**: Use staged mode (add `staged: true` to your create-issue call) so the issue is previewed with the 🎭 indicator but not actually created
6. Confirm that:
- You successfully read the last issue
- You created a poem inspired by it
- The new issue was created in staged mode with the 🎭 indicator
79 changes: 78 additions & 1 deletion .github/workflows/smoke-copilot.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .github/workflows/smoke-copilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ network:
- github
sandbox:
agent: awf # Firewall enabled
mcp:
port: 8080
tools:
cache-memory: true
edit:
Expand Down Expand Up @@ -54,7 +56,8 @@ strict: true
3. **Bash Tool Testing**: Execute bash commands to verify file creation was successful (use `cat` to read the file back)
4. **GitHub MCP Default Toolset Testing**: Verify that the `get_me` tool is NOT available with default toolsets. Try to use it and confirm it fails with a tool not found error.
5. **Cache Memory Testing**: Write a test file to `/tmp/gh-aw/cache-memory/smoke-test-${{ github.run_id }}.txt` with content "Cache memory test for run ${{ github.run_id }}" and verify it was created successfully
6. **Available Tools Display**: List all available tools that you have access to in this workflow execution.
6. **MCP Gateway Testing**: Verify that the MCP gateway is running by checking if the container is active and the health endpoint is accessible
7. **Available Tools Display**: List all available tools that you have access to in this workflow execution.

## Output

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Thumbs.db
/gh-aw-darwin-arm64
/gh-aw-linux-amd64
/gh-aw-linux-arm64
/awmg
/awmg-darwin-amd64
/awmg-darwin-arm64
/awmg-linux-amd64
/awmg-linux-arm64
/awmg-windows-amd64.exe

# credentials
.credentials/
Expand Down
7 changes: 7 additions & 0 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ make lint
# Build and test the binary
make build
./gh-aw --help

# Build the awmg (MCP gateway) standalone binary
make build-awmg
./awmg --help

# Build both binaries
make all
```

### 4. Install the Extension Locally for Testing
Expand Down
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

# Variables
BINARY_NAME=gh-aw
AWMG_BINARY_NAME=awmg
VERSION ?= $(shell git describe --tags --always --dirty)

# Build flags
LDFLAGS=-ldflags "-s -w -X main.version=$(VERSION)"

# Default target
.PHONY: all
all: build
all: build build-awmg

# Build the binary, run make deps before this
.PHONY: build
build: sync-templates sync-action-pins
go build $(LDFLAGS) -o $(BINARY_NAME) ./cmd/gh-aw

# Build the awmg (MCP gateway) binary
.PHONY: build-awmg
build-awmg:
go build $(LDFLAGS) -o $(AWMG_BINARY_NAME) ./cmd/awmg

# Build for all platforms
.PHONY: build-all
build-all: build-linux build-darwin build-windows
Expand All @@ -24,15 +30,20 @@ build-all: build-linux build-darwin build-windows
build-linux:
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-linux-amd64 ./cmd/gh-aw
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY_NAME)-linux-arm64 ./cmd/gh-aw
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(AWMG_BINARY_NAME)-linux-amd64 ./cmd/awmg
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(AWMG_BINARY_NAME)-linux-arm64 ./cmd/awmg

.PHONY: build-darwin
build-darwin:
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-darwin-amd64 ./cmd/gh-aw
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY_NAME)-darwin-arm64 ./cmd/gh-aw
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(AWMG_BINARY_NAME)-darwin-amd64 ./cmd/awmg
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(AWMG_BINARY_NAME)-darwin-arm64 ./cmd/awmg

.PHONY: build-windows
build-windows:
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-windows-amd64.exe ./cmd/gh-aw
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(AWMG_BINARY_NAME)-windows-amd64.exe ./cmd/awmg

# Test the code (runs both unit and integration tests)
.PHONY: test
Expand Down Expand Up @@ -170,6 +181,7 @@ clean:
@echo "Cleaning build artifacts..."
@# Remove main binary and platform-specific binaries
rm -f $(BINARY_NAME) $(BINARY_NAME)-*
rm -f $(AWMG_BINARY_NAME) $(AWMG_BINARY_NAME)-*
@# Remove bundle-js binary
rm -f bundle-js
@# Remove coverage files
Expand Down Expand Up @@ -476,7 +488,8 @@ agent-finish: deps-dev fmt lint build test-all fix recompile dependabot generate
help:
@echo "Available targets:"
@echo " build - Build the binary for current platform"
@echo " build-all - Build binaries for all platforms"
@echo " build-awmg - Build the awmg (MCP gateway) binary for current platform"
@echo " build-all - Build binaries for all platforms (gh-aw and awmg)"
@echo " test - Run Go tests (unit + integration)"
@echo " test-unit - Run Go unit tests only (faster)"
@echo " test-security - Run security regression tests"
Expand Down
73 changes: 73 additions & 0 deletions cmd/awmg/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package main

import (
"fmt"
"os"

"github.com/githubnext/gh-aw/pkg/cli"
"github.com/githubnext/gh-aw/pkg/console"
)

// Build-time variables
var (
version = "dev"
)

func main() {
// Set version info
cli.SetVersionInfo(version)

// Create the mcp-gateway command
cmd := cli.NewMCPGatewayCommand()

// Update command usage to reflect standalone binary
cmd.Use = "awmg"
cmd.Short = "MCP Gateway - Aggregate multiple MCP servers into a single HTTP gateway"
cmd.Long = `awmg (Agentic Workflows MCP Gateway) - Aggregate multiple MCP servers into a single HTTP gateway.

The gateway:
- Integrates by default with the sandbox.mcp extension point
- Imports Claude/Copilot/Codex MCP server JSON configuration
- Starts each MCP server and mounts an MCP client on each
- Mounts an HTTP MCP server that acts as a gateway to the MCP clients
- Supports most MCP gestures through the go-MCP SDK
- Provides extensive logging to file in the MCP log folder

Configuration can be provided via:
1. --config flag(s) pointing to JSON config file(s) (can be specified multiple times)
2. stdin (reads JSON configuration from standard input)

Multiple config files are merged in order, with later files overriding earlier ones.

Configuration format:
{
"mcpServers": {
"server-name": {
"command": "command",
"args": ["arg1", "arg2"],
"env": {"KEY": "value"}
}
},
"gateway": {
"port": 8080,
"apiKey": "optional-key"
}
}

Examples:
awmg --config config.json # From single file
awmg --config base.json --config override.json # From multiple files (merged)
awmg --port 8080 # From stdin
echo '{"mcpServers":{...}}' | awmg # Pipe config
awmg --config config.json --log-dir /tmp/logs # Custom log dir`

// Add version flag
cmd.Version = version
cmd.SetVersionTemplate("awmg version {{.Version}}\n")

// Execute command
if err := cmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", console.FormatErrorMessage(err.Error()))
os.Exit(1)
}
}
Loading
Loading