Skip to content

E2E testing #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'

- name: Install dependencies - root
run: pnpm install

- name: Install dependencies - inspector example
run: pnpm install
working-directory: examples/inspector

# - name: Install dependencies - cf-agents example
# run: pnpm install
# working-directory: examples/servers/cf-agents

- name: Install dependencies - hono-mcp example
run: pnpm install
working-directory: examples/servers/hono-mcp

- name: Install dependencies - test
run: pnpm install && pnpm exec playwright install
working-directory: test

- name: Run tests
run: pnpm test:headless
working-directory: test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ dist
.aider*

**/.claude/settings.local.json
public
6 changes: 6 additions & 0 deletions AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
- `pnpm build`: Build the project
- `pnpm check`: Run prettier checks and TypeScript type checking

### Integration Tests (in /test directory)
- `cd test && pnpm test`: Run integration tests with visible browser
- `cd test && pnpm test:headless`: Run integration tests headlessly
- `cd test && pnpm test:watch`: Run integration tests in watch mode
- `cd test && pnpm test:ui`: Run integration tests with interactive UI

## Code Style Guidelines

### Imports
Expand Down
4 changes: 2 additions & 2 deletions examples/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^7.6.2",
"tailwindcss": "^4.0.14",
"use-mcp": "link:../.."
"tailwindcss": "^4.0.14"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.5.0",
Expand All @@ -34,6 +33,7 @@
"prettier": "^3.5.3",
"typescript": "~5.7.2",
"typescript-eslint": "^8.24.1",
"use-mcp": "link:../..",
"vite": "^6.2.0",
"wrangler": "^4.19.1"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/inspector/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion examples/inspector/src/components/McpServers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function McpConnection({ serverUrl, onConnectionUpdate }: { serverUrl: string; o
debug: true,
autoRetry: false,
popupFeatures: 'width=500,height=600,resizable=yes,scrollbars=yes',
transportType: 'auto'
transportType: 'auto',
})

// Update parent component with connection data
Expand Down
4 changes: 4 additions & 0 deletions examples/inspector/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
build: {
// @ts-ignore
minify: !process.env.NO_MINIFY,
},
})
33 changes: 33 additions & 0 deletions examples/servers/hono-mcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# prod
dist/

# dev
.yarn/
!.yarn/releases
.vscode/*
!.vscode/launch.json
!.vscode/*.code-snippets
.idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf

# deps
node_modules/
.wrangler

# env
.env
.env.production
.dev.vars

# logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# misc
.DS_Store
21 changes: 21 additions & 0 deletions examples/servers/hono-mcp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```txt
npm install
npm run dev
```

```txt
npm run deploy
```

[For generating/synchronizing types based on your Worker configuration run](https://developers.cloudflare.com/workers/wrangler/commands/#types):

```txt
npm run cf-typegen
```

Pass the `CloudflareBindings` as generics when instantiation `Hono`:

```ts
// src/index.ts
const app = new Hono<{ Bindings: CloudflareBindings }>()
```
17 changes: 17 additions & 0 deletions examples/servers/hono-mcp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "vengabus",
"scripts": {
"dev": "wrangler dev",
"deploy": "wrangler deploy --minify",
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
},
"dependencies": {
"hono": "^4.8.2"
},
"devDependencies": {
"@hono/mcp": "^0.1.0",
"@modelcontextprotocol/sdk": "^1.13.1",
"wrangler": "^4.21.0",
"zod": "^3.25.67"
}
}
Loading
Loading