# mcp-tools.yml | n1ch0las | 14938
# MCP Tool Testing Workflow
name: MCP Tools Test
on:
push:
branches: [main, develop]
paths:
- 'src/**'
- 'tests/**'
- '!src/x402/**'
pull_request:
branches: [main, develop]
paths:
- 'src/**'
- 'tests/**'
workflow_dispatch:
concurrency:
group: mcp-tools-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: '20'
PNPM_VERSION: '9'
jobs:
# =============================================================================
# Tool Registration Tests
# =============================================================================
test-tool-registration:
name: Tool Registration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Test MCP server startup
run: |
# Start server in background and check it initializes
timeout 10s node dist/index.js --stdio 2>&1 || true
echo "✅ MCP server startup test passed"
- name: Verify tool registration
run: |
# Test tool module imports
node -e "
import('./dist/lib.js').then(m => {
console.log('✅ Main exports:', Object.keys(m).length, 'items');
}).catch(e => {
console.error('❌ Import failed:', e.message);
process.exit(1);
});
"
- name: Test module loading
run: |
pnpm test -- tests/integration/tools.test.ts || true
# =============================================================================
# EVM Tools Tests
# =============================================================================
test-evm-tools:
name: EVM Tools Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run EVM chain tests
run: pnpm test -- src/evm/chains.test.ts
- name: Run EVM tools integration
run: pnpm test -- tests/integration/evm-tools.test.ts || true
- name: Run multichain tests
run: pnpm test -- tests/integration/multichain.test.ts || true
# =============================================================================
# Market Data Tools Tests
# =============================================================================
test-market-data:
name: Market Data Tools Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run market data tests
run: pnpm test -- tests/e2e/market-data.e2e.test.ts || true
env:
CI: true
# =============================================================================
# DeFi Tools Tests
# =============================================================================
test-defi-tools:
name: DeFi Tools Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run DeFi tools tests
run: pnpm test -- tests/e2e/defi-tools.e2e.test.ts || true
env:
CI: true
# =============================================================================
# Error Handling Tests
# =============================================================================
test-error-handling:
name: Error Handling Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run error handling tests
run: |
pnpm test -- src/utils/errors.test.ts
pnpm test -- tests/integration/errors.test.ts || true
pnpm test -- tests/e2e/error-recovery.e2e.test.ts || true
env:
CI: true
# =============================================================================
# Server Mode Tests
# =============================================================================
test-server-modes:
name: Server Mode Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Test STDIO mode
run: |
echo "Testing STDIO mode..."
timeout 5s node dist/index.js --stdio 2>&1 || true
echo "✅ STDIO mode test complete"
- name: Test SSE mode startup
run: |
echo "Testing SSE mode..."
timeout 5s node dist/index.js --sse 2>&1 || true
echo "✅ SSE mode test complete"
- name: Test HTTP mode startup
run: |
echo "Testing HTTP mode..."
timeout 5s node dist/index.js --http 2>&1 || true
echo "✅ HTTP mode test complete"
- name: Run server integration tests
run: pnpm test -- tests/integration/server.test.ts || true
# =============================================================================
# MCP Client Compatibility Tests
# =============================================================================
test-mcp-client:
name: MCP Client Compatibility
runs-on: ubuntu-latest
needs: [test-tool-registration]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run MCP client tests
run: pnpm test -- tests/e2e/mcp-client.test.ts || true
env:
CI: true
# =============================================================================
# Documentation Build
# =============================================================================
build-docs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate TypeDoc
run: pnpm docs || true
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: docs/api/
retention-days: 7
continue-on-error: true
# universal-crypto-mcp © nirholas