git clone https://github.com/barrersoftware/copilot-plugin-mcp-server
cd copilot-plugin-mcp-server
npm installcd ~
git clone https://github.com/barrersoftware/github-mcp-server
cd github-mcp-server
go build -o github-mcp-server ./cmd/github-mcp-server/Edit proxy-server.js to point to your GitHub MCP binary:
const GITHUB_MCP_BIN = path.join(process.env.HOME, 'github-mcp-server/github-mcp-server');Option A: Global Configuration (replaces GitHub MCP)
Edit or create ~/.copilot/mcp-config.json:
{
"mcpServers": {
"github": {
"command": "node",
"args": [
"/home/ubuntu/copilot-plugin-mcp-server/proxy-server.js"
],
"env": {},
"disabled": false
}
}
}Option B: Additional Configuration (keeps existing MCP configs)
Create a separate config file:
{
"mcpServers": {
"github-optimized": {
"command": "node",
"args": [
"/home/ubuntu/copilot-plugin-mcp-server/proxy-server.js"
],
"env": {},
"disabled": false
}
}
}Then run CLI with:
copilot --additional-mcp-config ~/copilot-plugin-mcp-server/mcp-config-cli.json# Start Copilot CLI
copilot
# Then ask:
> List available tools
# You should see:
# - plugin_list (our tool)
# - plugin_info (our tool)
# - plugin_test (our tool)
# - create_issue (GitHub, optimized)
# - search_code (GitHub, optimized)
# - ... etc┌─────────────────────────────────────┐
│ You run: copilot │
└──────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Copilot CLI │
│ - Reads ~/.copilot/mcp-config.json │
│ - Spawns: node proxy-server.js │
└──────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Our Proxy (proxy-server.js) │
│ - Spawns: github-mcp-server │
│ - Queries GitHub MCP tools │
│ - OPTIMIZES them (67% reduction) │
│ - Adds plugin tools │
│ - Returns to CLI │
└──────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ GitHub MCP Server │
│ - Runs as child process │
│ - Proxy calls it when needed │
└─────────────────────────────────────┘
When proxy starts, you should see in stderr:
[Proxy] Starting GitHub MCP server...
[Proxy] GitHub MCP ready with 47 tools
[Proxy] Token optimization: 23847 → 7923 bytes (66.8% reduction)
[Proxy] Listing 50 tools (3 plugin + 47 GitHub optimized)
# In Copilot CLI:
> List available Copilot plugins
# AI will call plugin_list and show:
# Found 4 plugins:
# 1. message-repair - Fixes orphaned tool_calls
# 2. debug-logger - Enhanced debug logging
# 3. retry - Adds /retry command
# 4. session-lifecycle - Session tracking# In Copilot CLI:
> Search for "extension API" in github/copilot-cli
# AI will use search_code tool (proxied through our server)
# GitHub MCP handles the actual search
# Results returned normally{
"mcpServers": {
"github": {
"command": "node",
"args": [
"/home/ubuntu/copilot-plugin-mcp-server/proxy-server.js"
],
"env": {
"NODE_ENV": "production"
},
"disabled": false
}
}
}{
"mcpServers": {
"github-original": {
"command": "/home/ubuntu/github-mcp-server/github-mcp-server",
"args": ["stdio", "--toolsets=default"],
"disabled": true
},
"github-proxy": {
"command": "node",
"args": [
"/home/ubuntu/copilot-plugin-mcp-server/proxy-server.js"
],
"disabled": false
}
}
}This lets you toggle between original and optimized by changing disabled flags.
- ✅ Node.js 18+
- ✅ Go 1.21+ (to build github-mcp-server)
- ✅ GitHub CLI (
gh) authenticated - ✅ Copilot CLI v0.0.384+
Cause: Not authenticated with GitHub
Fix:
gh auth login
gh auth statusCause: npm dependencies not installed
Fix:
cd ~/copilot-plugin-mcp-server
npm installCause: GitHub MCP binary path wrong in proxy-server.js
Fix: Edit GITHUB_MCP_BIN constant to match your installation:
const GITHUB_MCP_BIN = path.join(process.env.HOME, 'github-mcp-server/github-mcp-server');Cause: Plugin registry path not found
Fix: Either:
- Clone the plugin registry:
git clone https://github.com/barrersoftware/copilot-plugins-registry
- Or create empty directory:
mkdir -p ~/copilot-plugins-registry/plugins
Tool list request: ~24,150 tokens
Response time: ~2-3 seconds
Context window used: 24,150 tokens
Tool list request: ~8,000 tokens (67% reduction!)
Response time: ~1-2 seconds (faster parsing)
Context window used: 8,000 tokens (16,150 saved!)
Result: More conversation before hitting limits, faster responses, lower costs!
Want to tune the optimization? Edit proxy-server.js:
compressDescription(desc) {
// Add your own compression rules
return desc
.replace(/your pattern/gi, 'replacement')
.substring(0, YOUR_MAX_LENGTH);
}To go back to direct GitHub MCP:
- Remove our proxy from
~/.copilot/mcp-config.json - Add back GitHub MCP directly:
{ "mcpServers": { "github": { "command": "github-mcp-server", "args": ["stdio", "--toolsets=default"] } } }
- Test with real Copilot CLI workflows
- Measure actual token savings in production
- Implement plugin_test to spawn real SDK sessions
- Add more optimization strategies
- Share results with community
Questions? Issues?
https://github.com/barrersoftware/copilot-plugin-mcp-server/issues
Built by: Captain CP & Daniel Elliott
License: MIT