Skip to content

Commit 1f1c24d

Browse files
committed
feat: Initial implementation of Eliza MCP Gateway
πŸš€ Complete MCP Gateway implementation with multi-transport support Core Features: - πŸ”„ Multi-server gateway connecting multiple MCP servers - πŸš€ Full transport support: STDIO, HTTP, SSE, WebSocket - 🏷️ Namespace support with conflict resolution - πŸ“‹ YAML/JSON configuration with environment variable fallback - πŸ’ͺ Health monitoring and connection management - ⚑ Real-time capability discovery and registry updates Architecture: - Gateway server (aggregator-server.ts) - Transport factory with 4 transport types - Server manager for connection lifecycle - Unified registry for tools/resources/prompts - Configuration management with validation Testing: - Comprehensive E2E test suite (100% pass rate) - Quick and full test runners - Multiple test configurations - CI/CD integration with GitHub Actions - Interactive testing with MCP Inspector Examples: - Mixed transport configurations - HTTP remote server examples - Namespace and multi-server setups - Error handling test cases Updated to elizaOS organization and proper branding throughout.
0 parents  commit 1f1c24d

28 files changed

+3454
-0
lines changed

β€Ž.github/workflows/test.ymlβ€Ž

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI/CD Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
name: E2E Tests
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 20.x, 22.x]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Type check
32+
run: npm run type-check
33+
34+
- name: Lint
35+
run: npm run lint
36+
37+
- name: Build project
38+
run: npm run build
39+
40+
- name: Run E2E tests
41+
run: npm run test:quick
42+
43+
- name: Test configuration loading
44+
run: |
45+
echo "Testing basic configuration..."
46+
timeout 10s node build/index.js --config=tests/configs/basic.yaml || true
47+
echo "Testing JSON configuration..."
48+
timeout 10s node build/index.js --config=tests/configs/basic.json || true
49+
50+
- name: Test environment configuration
51+
run: |
52+
echo "Testing environment variables..."
53+
timeout 10s env MCP_SERVERS="test:npx:user-review-mcp" node build/index.js || true
54+
55+
- name: Upload test results
56+
if: failure()
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: test-results-${{ matrix.node-version }}
60+
path: |
61+
build/
62+
tests/
63+
retention-days: 7
64+
65+
build-check:
66+
name: Build Verification
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout repository
71+
uses: actions/checkout@v4
72+
73+
- name: Setup Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: '20.x'
77+
cache: 'npm'
78+
79+
- name: Install dependencies
80+
run: npm ci
81+
82+
- name: Build project
83+
run: npm run build
84+
85+
- name: Verify build artifacts
86+
run: |
87+
ls -la build/
88+
[ -f "build/index.js" ] || { echo "Missing index.js"; exit 1; }
89+
[ -f "build/aggregator-server.js" ] || { echo "Missing aggregator-server.js"; exit 1; }
90+
[ -f "build/config.js" ] || { echo "Missing config.js"; exit 1; }
91+
echo "All build artifacts present βœ…"
92+
93+
- name: Test package installation
94+
run: |
95+
npm pack
96+
npm install -g ./mcp-gateway-*.tgz
97+
echo "Package installation successful βœ…"

β€Ž.gitignoreβ€Ž

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build output
8+
build/
9+
dist/
10+
11+
# Environment variables
12+
.env
13+
.env.local
14+
.env.production
15+
16+
# IDE and editor files
17+
.vscode/
18+
.idea/
19+
*.swp
20+
*.swo
21+
*~
22+
23+
# OS generated files
24+
.DS_Store
25+
.DS_Store?
26+
._*
27+
.Spotlight-V100
28+
.Trashes
29+
ehthumbs.db
30+
Thumbs.db
31+
32+
# Test files (keep examples/)
33+
test-*.yaml
34+
test-*.js
35+
test-*.json
36+
37+
# Logs
38+
*.log
39+
logs/
40+
41+
# Runtime data
42+
pids/
43+
*.pid
44+
*.seed
45+
*.pid.lock
46+
47+
# Coverage directory used by tools like istanbul
48+
coverage/
49+
50+
# Dependency directories
51+
jspm_packages/
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity

β€ŽLICENSEβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 MCP Gateway
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
Β (0)