Skip to content

Commit 2a250fa

Browse files
max-stytchgeelen
authored andcommitted
Merge remote-tracking branch 'origin/main' into max/chore-remove-debug-checks
2 parents 8cb3623 + c71e693 commit 2a250fa

13 files changed

+1991
-42
lines changed

.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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# AGENT.md - mcp-remote Development Guide
2+
3+
## Commands
4+
5+
- **Build**: `pnpm build` (or `pnpm build:watch` for development)
6+
- **Type check**: `pnpm check` (runs prettier and tsc)
7+
- **Lint/Format**: `pnpm lint-fix` (prettier with write)
8+
- **Test**: `pnpm test:unit` (or `pnpm test:unit:watch` for watch mode)
9+
- **Run dev**: `npx tsx src/client.ts` or `npx tsx src/proxy.ts`
10+
11+
## Architecture
12+
13+
- **Project Type**: TypeScript ESM library for MCP (Model Context Protocol) remote proxy
14+
- **Main Binaries**: `mcp-remote` (proxy.ts), `mcp-remote-client` (client.ts)
15+
- **Core Libraries**: `/src/lib/` contains auth coordination, OAuth client, utils, types
16+
- **Transport**: Supports both HTTP and SSE transports with OAuth authentication
17+
- **Config**: Uses `~/.mcp-auth/` directory for credential storage
18+
19+
## Code Style
20+
21+
- **Formatting**: Prettier with 140 char width, single quotes, no semicolons
22+
- **Types**: Strict TypeScript, ES2022 target with bundler module resolution
23+
- **Imports**: ES modules, use `.js` extensions for SDK imports
24+
- **Error Handling**: EventEmitter pattern for auth flow coordination
25+
- **Naming**: kebab-case for files, camelCase for variables/functions
26+
- **Comments**: JSDoc for main functions, inline for complex auth flows

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,35 @@ To bypass authentication, or to emit custom headers on all requests to your remo
135135
]
136136
```
137137

138+
* To ignore specific tools from the remote server, add the `--ignore-tool` flag. This will filter out tools matching the specified patterns from both `tools/list` responses and block `tools/call` requests. Supports wildcard patterns with `*`.
139+
140+
```json
141+
"args": [
142+
"mcp-remote",
143+
"https://remote.mcp.server/sse",
144+
"--ignore-tool",
145+
"delete*",
146+
"--ignore-tool",
147+
"remove*"
148+
]
149+
```
150+
151+
You can specify multiple `--ignore-tool` flags to ignore different patterns. Examples:
152+
- `delete*` - ignores all tools starting with "delete" (e.g., `deleteTask`, `deleteUser`)
153+
- `*account` - ignores all tools ending with "account" (e.g., `getAccount`, `updateAccount`)
154+
- `exactTool` - ignores only the tool named exactly "exactTool"
155+
156+
* To change the timeout for the OAuth callback (by default `30` seconds), add the `--auth-timeout` flag with a value in seconds. This is useful if the authentication process on the server side takes a long time.
157+
158+
```json
159+
"args": [
160+
"mcp-remote",
161+
"https://remote.mcp.server/sse",
162+
"--auth-timeout",
163+
"60"
164+
]
165+
```
166+
138167
### Transport Strategies
139168

140169
MCP Remote supports different transport strategies when connecting to an MCP server. This allows you to control whether it uses Server-Sent Events (SSE) or HTTP transport, and in what order it tries them.

package.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcp-remote",
3-
"version": "0.1.14",
3+
"version": "0.1.24",
44
"description": "Remote proxy for Model Context Protocol, allowing local-only clients to connect to remote servers using oAuth",
55
"keywords": [
66
"mcp",
@@ -9,7 +9,7 @@
99
"remote",
1010
"oauth"
1111
],
12-
"author": "Glen Maddern <glen@cloudflare.com>",
12+
"author": "Glen Maddern <glen@glenmaddern.com>",
1313
"repository": "https://github.com/geelen/mcp-remote",
1414
"type": "module",
1515
"files": [
@@ -26,20 +26,24 @@
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",
33-
"open": "^10.1.0"
35+
"open": "^10.1.0",
36+
"strict-url-sanitise": "^0.0.1"
3437
},
3538
"devDependencies": {
36-
"@modelcontextprotocol/sdk": "https://pkg.pr.new/geelen/typescript-sdk/@modelcontextprotocol/sdk@cdf3508",
39+
"@modelcontextprotocol/sdk": "^1.17.3",
3740
"@types/express": "^5.0.0",
3841
"@types/node": "^22.13.10",
3942
"prettier": "^3.5.3",
4043
"tsup": "^8.4.0",
4144
"tsx": "^4.19.3",
42-
"typescript": "^5.8.2"
45+
"typescript": "^5.8.2",
46+
"vitest": "^3.2.3"
4347
},
4448
"tsup": {
4549
"entry": [
@@ -54,5 +58,12 @@
5458
"outDir": "dist",
5559
"external": []
5660
},
61+
"vitest": {
62+
"environment": "node",
63+
"globals": true,
64+
"include": [
65+
"src/**/*.test.ts"
66+
]
67+
},
5768
"packageManager": "[email protected]+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
5869
}

0 commit comments

Comments
 (0)