Skip to content

Commit 3fcec33

Browse files
committed
feat: proxy support
1 parent 929c97c commit 3fcec33

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"dependencies": {
3434
"express": "^4.21.2",
3535
"open": "^10.1.0",
36-
"strict-url-sanitise": "^0.0.1"
36+
"strict-url-sanitise": "^0.0.1",
37+
"undici": "^7.12.0"
3738
},
3839
"devDependencies": {
3940
"@modelcontextprotocol/sdk": "https://pkg.pr.new/geelen/typescript-sdk/@modelcontextprotocol/sdk@877f4bf",

pnpm-lock.yaml

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

src/lib/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import fs from 'fs'
1414
import { readFile, rm } from 'fs/promises'
1515
import path from 'path'
1616
import { version as MCP_REMOTE_VERSION } from '../../package.json'
17+
import { fetch, setGlobalDispatcher, RequestInit, EnvHttpProxyAgent } from 'undici';
1718

1819
// Global type declaration for typescript
1920
declare global {
@@ -32,6 +33,9 @@ const pid = process.pid
3233
// Global debug flag
3334
export let DEBUG = false
3435

36+
// Use env proxy
37+
setGlobalDispatcher(new EnvHttpProxyAgent());
38+
3539
// Helper function for timestamp formatting
3640
function getTimestamp(): string {
3741
const now = new Date()

0 commit comments

Comments
 (0)