Skip to content

Commit ace3220

Browse files
authored
Merge pull request #10 from modelcontextprotocol/e2e-testing
E2E testing
1 parent 6a3130a commit ace3220

28 files changed

+11726
-17
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
cache: 'pnpm'
28+
29+
- name: Install dependencies - root
30+
run: pnpm install
31+
32+
- name: Install dependencies - inspector example
33+
run: pnpm install
34+
working-directory: examples/inspector
35+
36+
# - name: Install dependencies - cf-agents example
37+
# run: pnpm install
38+
# working-directory: examples/servers/cf-agents
39+
40+
- name: Install dependencies - hono-mcp example
41+
run: pnpm install
42+
working-directory: examples/servers/hono-mcp
43+
44+
- name: Install dependencies - test
45+
run: pnpm install && pnpm exec playwright install
46+
working-directory: test
47+
48+
- name: Run tests
49+
run: pnpm test:headless
50+
working-directory: test

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ dist
55
.aider*
66

77
**/.claude/settings.local.json
8-
public

AGENT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
- `pnpm build`: Build the project
66
- `pnpm check`: Run prettier checks and TypeScript type checking
77

8+
### Integration Tests (in /test directory)
9+
- `cd test && pnpm test`: Run integration tests with visible browser
10+
- `cd test && pnpm test:headless`: Run integration tests headlessly
11+
- `cd test && pnpm test:watch`: Run integration tests in watch mode
12+
- `cd test && pnpm test:ui`: Run integration tests with interactive UI
13+
814
## Code Style Guidelines
915

1016
### Imports

examples/inspector/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"react": "^19.0.0",
1818
"react-dom": "^19.0.0",
1919
"react-router-dom": "^7.6.2",
20-
"tailwindcss": "^4.0.14",
21-
"use-mcp": "link:../.."
20+
"tailwindcss": "^4.0.14"
2221
},
2322
"devDependencies": {
2423
"@cloudflare/vite-plugin": "^1.5.0",
@@ -34,6 +33,7 @@
3433
"prettier": "^3.5.3",
3534
"typescript": "~5.7.2",
3635
"typescript-eslint": "^8.24.1",
36+
"use-mcp": "link:../..",
3737
"vite": "^6.2.0",
3838
"wrangler": "^4.19.1"
3939
},

examples/inspector/pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/inspector/src/components/McpServers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function McpConnection({ serverUrl, onConnectionUpdate }: { serverUrl: string; o
1010
debug: true,
1111
autoRetry: false,
1212
popupFeatures: 'width=500,height=600,resizable=yes,scrollbars=yes',
13-
transportType: 'auto'
13+
transportType: 'auto',
1414
})
1515

1616
// Update parent component with connection data

examples/inspector/vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ import tailwindcss from '@tailwindcss/vite'
55
// https://vite.dev/config/
66
export default defineConfig({
77
plugins: [react(), tailwindcss()],
8+
build: {
9+
// @ts-ignore
10+
minify: !process.env.NO_MINIFY,
11+
},
812
})

examples/servers/hono-mcp/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# prod
2+
dist/
3+
4+
# dev
5+
.yarn/
6+
!.yarn/releases
7+
.vscode/*
8+
!.vscode/launch.json
9+
!.vscode/*.code-snippets
10+
.idea/workspace.xml
11+
.idea/usage.statistics.xml
12+
.idea/shelf
13+
14+
# deps
15+
node_modules/
16+
.wrangler
17+
18+
# env
19+
.env
20+
.env.production
21+
.dev.vars
22+
23+
# logs
24+
logs/
25+
*.log
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
pnpm-debug.log*
30+
lerna-debug.log*
31+
32+
# misc
33+
.DS_Store

examples/servers/hono-mcp/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```txt
2+
npm install
3+
npm run dev
4+
```
5+
6+
```txt
7+
npm run deploy
8+
```
9+
10+
[For generating/synchronizing types based on your Worker configuration run](https://developers.cloudflare.com/workers/wrangler/commands/#types):
11+
12+
```txt
13+
npm run cf-typegen
14+
```
15+
16+
Pass the `CloudflareBindings` as generics when instantiation `Hono`:
17+
18+
```ts
19+
// src/index.ts
20+
const app = new Hono<{ Bindings: CloudflareBindings }>()
21+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "vengabus",
3+
"scripts": {
4+
"dev": "wrangler dev",
5+
"deploy": "wrangler deploy --minify",
6+
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
7+
},
8+
"dependencies": {
9+
"hono": "^4.8.2"
10+
},
11+
"devDependencies": {
12+
"@hono/mcp": "^0.1.0",
13+
"@modelcontextprotocol/sdk": "^1.13.1",
14+
"wrangler": "^4.21.0",
15+
"zod": "^3.25.67"
16+
}
17+
}

0 commit comments

Comments
 (0)