Skip to content

Commit ec71972

Browse files
committed
Generated test setup to cover sanitizeUrl behaviour
1 parent fffd8cc commit ec71972

5 files changed

Lines changed: 579 additions & 10 deletions

File tree

.github/workflows/check.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ jobs:
1818
with:
1919
node-version: 22
2020

21+
- name: Run type checking and formatting
22+
run: pnpm run check
23+
24+
- name: Run unit tests
25+
run: pnpm run test:unit
26+
2127
- name: Build
2228
run: pnpm build
23-
24-
- name: Run checks
25-
run: pnpm run check

AGENT.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# AGENT.md - mcp-remote Development Guide
22

33
## Commands
4+
45
- **Build**: `pnpm build` (or `pnpm build:watch` for development)
56
- **Type check**: `pnpm check` (runs prettier and tsc)
67
- **Lint/Format**: `pnpm lint-fix` (prettier with write)
7-
- **Test**: No tests defined (consider adding)
8+
- **Test**: `pnpm test:unit` (or `pnpm test:unit:watch` for watch mode)
89
- **Run dev**: `npx tsx src/client.ts` or `npx tsx src/proxy.ts`
910

1011
## Architecture
12+
1113
- **Project Type**: TypeScript ESM library for MCP (Model Context Protocol) remote proxy
1214
- **Main Binaries**: `mcp-remote` (proxy.ts), `mcp-remote-client` (client.ts)
1315
- **Core Libraries**: `/src/lib/` contains auth coordination, OAuth client, utils, types
1416
- **Transport**: Supports both HTTP and SSE transports with OAuth authentication
1517
- **Config**: Uses `~/.mcp-auth/` directory for credential storage
1618

1719
## Code Style
20+
1821
- **Formatting**: Prettier with 140 char width, single quotes, no semicolons
1922
- **Types**: Strict TypeScript, ES2022 target with bundler module resolution
2023
- **Imports**: ES modules, use `.js` extensions for SDK imports

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"build": "tsup",
2727
"build:watch": "tsup --watch",
2828
"check": "prettier --check . && tsc",
29-
"lint-fix": "prettier --check . --write"
29+
"lint-fix": "prettier --check . --write",
30+
"test:unit": "vitest run",
31+
"test:unit:watch": "vitest"
3032
},
3133
"dependencies": {
3234
"express": "^4.21.2",
@@ -39,7 +41,8 @@
3941
"prettier": "^3.5.3",
4042
"tsup": "^8.4.0",
4143
"tsx": "^4.19.3",
42-
"typescript": "^5.8.2"
44+
"typescript": "^5.8.2",
45+
"vitest": "^3.2.3"
4346
},
4447
"tsup": {
4548
"entry": [
@@ -54,5 +57,12 @@
5457
"outDir": "dist",
5558
"external": []
5659
},
60+
"vitest": {
61+
"environment": "node",
62+
"globals": true,
63+
"include": [
64+
"src/**/*.test.ts"
65+
]
66+
},
5767
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
5868
}

0 commit comments

Comments
 (0)