Files
mcp-use__mcp-use/.github/workflows/inspector-e2e-sequential.yml
Enrico Toniato 8d55603972 Canary (#1166)
* feat(python): add E2E testing for Python server in CI workflow

- Introduced a new job in the GitHub Actions workflow to run end-to-end tests against the Python MCP server.
- Updated the inspector.py to allow overriding the CDN base URL via an environment variable.
- Added a new script command for running Python E2E tests in the package.json.
- Enhanced documentation to include instructions for running Python server E2E tests.

* fix(inspector): skip proxy when inspector is served from the MCP server itself

When the inspector is embedded in a Python (or other) MCP server, the
window.location.origin matches the MCP server's origin, so
/inspector/api/proxy doesn't exist there. Routing auto-connect through
that missing proxy caused silent connection failures.

Now proxyAddress is only set when the inspector origin differs from the
target URL's origin (i.e. the inspector has its own server running).

Also add echo tool to server_example.py so python.test.ts can pass.

* fix(inspector): detect proxy availability via runtime config injection

Inject window.__MCP_PROXY_URL__ from the inspector server when it serves
the HTML. When served from a Python/custom MCP server (same origin), the
flag is absent and autoProxyFallback is disabled so no proxy is used.

- Add proxyUrl to RuntimeConfig in shared-static.ts
- Default to /inspector/api/proxy when inspector server serves
- Read __MCP_PROXY_URL__ in App.tsx and configure defaultAutoProxyFallback
- Disable autoProxyFallback when no proxy is available (no hosted fallback)

* ci: trigger inspector E2E workflow on PRs to canary/main

* ci: temporarily disable mix/prod/builtin E2E jobs for Python testing

* ci: re-enable all E2E jobs, workflow_dispatch only

* ci: re-enable E2E jobs for Python testing in CI workflow

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* fix(inspector): resolve auto-connect issues for embedded servers

This patch release addresses the auto-connect functionality of the inspector when served from an MCP server. Key changes include skipping the proxy when the inspector's origin matches the MCP server's origin and detecting proxy availability through runtime configuration. Additionally, the mcp-use package has been updated to version 1.21.2.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-06 17:24:26 +01:00

284 lines
8.3 KiB
YAML

name: Inspector E2E Tests (Sequential)
permissions:
contents: read
# ============================================================================
# Inspector E2E Tests - Sequential
# ============================================================================
#
# Runs Playwright E2E tests for the Inspector package across all test modes
# sequentially: mix -> prod -> builtin. Each mode runs to completion even if
# a previous mode fails.
#
# Modes:
# - mix: Built server :3002, dev inspector :3000 (most common dev setup)
# - prod: Built server :3002, built inspector :3000 (production simulation)
# - builtin: Dev server with built-in inspector :3000 (HMR tests)
#
# Triggered on: Manual dispatch only (workflow_dispatch)
#
on:
workflow_dispatch:
jobs:
# ── Job 1: Mix mode ──────────────────────────────────────────────────────
e2e-mix:
name: "E2E (mix)"
runs-on: ubuntu-latest
defaults:
run:
working-directory: libraries/typescript
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10.6.1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: libraries/typescript/pnpm-lock.yaml
- name: Install Dependencies
run: pnpm install --no-frozen-lockfile
- name: Build Packages
run: pnpm build
- name: Link CLI Binaries
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm --filter @mcp-use/inspector exec playwright install --with-deps chromium
- name: Run E2E Tests (mix mode)
env:
MCP_USE_ANONYMIZED_TELEMETRY: "false"
NODE_ENV: test
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
cd packages/inspector
node tests/e2e/scripts/run-test-matrix.mjs mix
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-mix
path: libraries/typescript/packages/inspector/playwright-report/
retention-days: 30
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-mix
path: libraries/typescript/packages/inspector/test-results/
retention-days: 7
# ── Job 2: Prod mode ─────────────────────────────────────────────────────
e2e-prod:
name: "E2E (prod)"
needs: e2e-mix
if: always()
runs-on: ubuntu-latest
defaults:
run:
working-directory: libraries/typescript
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10.6.1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: libraries/typescript/pnpm-lock.yaml
- name: Install Dependencies
run: pnpm install --no-frozen-lockfile
- name: Build Packages
run: pnpm build
- name: Link CLI Binaries
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm --filter @mcp-use/inspector exec playwright install --with-deps chromium
- name: Run E2E Tests (prod mode)
env:
MCP_USE_ANONYMIZED_TELEMETRY: "false"
NODE_ENV: test
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
cd packages/inspector
node tests/e2e/scripts/run-test-matrix.mjs prod
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-prod
path: libraries/typescript/packages/inspector/playwright-report/
retention-days: 30
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-prod
path: libraries/typescript/packages/inspector/test-results/
retention-days: 7
# ── Job 3: Builtin mode ──────────────────────────────────────────────────
e2e-builtin:
name: "E2E (builtin)"
needs: e2e-prod
if: always()
runs-on: ubuntu-latest
defaults:
run:
working-directory: libraries/typescript
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10.6.1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: libraries/typescript/pnpm-lock.yaml
- name: Install Dependencies
run: pnpm install --no-frozen-lockfile
- name: Build Packages
run: pnpm build
- name: Link CLI Binaries
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm --filter @mcp-use/inspector exec playwright install --with-deps chromium
- name: Run E2E Tests (builtin mode)
env:
MCP_USE_ANONYMIZED_TELEMETRY: "false"
NODE_ENV: test
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
cd packages/inspector
node tests/e2e/scripts/run-test-matrix.mjs builtin
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-builtin
path: libraries/typescript/packages/inspector/playwright-report/
retention-days: 30
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-builtin
path: libraries/typescript/packages/inspector/test-results/
retention-days: 7
# ── Job 4: Python server ─────────────────────────────────────────────────
e2e-python:
name: "E2E (python)"
needs: e2e-builtin
if: always()
runs-on: ubuntu-latest
defaults:
run:
working-directory: libraries/typescript
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10.6.1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: libraries/typescript/pnpm-lock.yaml
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Dependencies
run: pnpm install --no-frozen-lockfile
- name: Build Packages
run: pnpm build
- name: Link CLI Binaries
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm --filter @mcp-use/inspector exec playwright install --with-deps chromium
- name: Install Python mcp-use
working-directory: libraries/python
run: |
uv venv
uv pip install -e ".[dev]"
- name: Run Python E2E Tests
working-directory: libraries/typescript/packages/inspector
env:
MCP_USE_ANONYMIZED_TELEMETRY: "false"
NODE_ENV: test
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: pnpm test:e2e:python
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-python
path: libraries/typescript/packages/inspector/playwright-report/
retention-days: 30
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-python
path: libraries/typescript/packages/inspector/test-results/
retention-days: 7