inspector/package.json
cliffhall 0e1bc1d402 fix(server): make the pinned lookup honor Node's all:true callback shape
Addresses the round-1 Copilot review.

- createPinnedAgent: Node's net.connect runs with autoSelectFamily on
  (Node >= 20), so it calls the lookup hook with `{ all: true }` and
  requires an ARRAY of `{ address, family }`. The scalar-only callback
  failed every hostname request with ERR_INVALID_IP_ADDRESS, so /fetch
  could only reach literal-IP targets. Both callback shapes are now
  supported. Reproduced against Node 22/26 before and after.
- Tests: cover the `{ all: true }` shape for IPv4 and IPv6, and add an
  end-to-end request through the agent over the production path
  (node-fetch -> http.Agent -> net.connect) using an unresolvable
  hostname, so the request can only succeed via the pinned IP. Verified
  these three fail without the fix. Replaced the `Function`-typed casts
  with a typed pinnedLookup() helper.
- CI: run the new server suite (.github/workflows/main.yml) and add a
  root `test-server` script, so this regression coverage is enforced.
- package-lock.json: sync the server workspace manifest mirror with the
  added @types/node and vitest devDependencies.
- index.ts: drop the `agent as any` cast and its eslint-disable — the
  node-fetch RequestInit already types `agent`, and tsc is clean without
  the suppression.
- Formatting: prettier-check now passes (it failed on the two new files).

Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-19 16:59:06 -04:00

100 lines
3.5 KiB
JSON

{
"name": "@modelcontextprotocol/inspector",
"version": "1.0.0",
"description": "Model Context Protocol inspector",
"license": "SEE LICENSE IN LICENSE",
"author": "Model Context Protocol a Series of LF Projects, LLC.",
"homepage": "https://modelcontextprotocol.io",
"bugs": "https://github.com/modelcontextprotocol/inspector/issues",
"type": "module",
"bin": {
"mcp-inspector": "cli/build/cli.js"
},
"repository": {
"type": "git",
"url": "https://github.com/modelcontextprotocol/inspector"
},
"files": [
"client/bin",
"client/dist",
"server/build",
"server/static",
"cli/build"
],
"workspaces": [
"client",
"server",
"cli"
],
"scripts": {
"build": "npm run build-server && npm run build-client && npm run build-cli",
"build-server": "cd server && npm run build",
"build-client": "cd client && npm run build",
"build-cli": "cd cli && npm run build",
"clean": "rimraf ./node_modules ./client/node_modules ./cli/node_modules ./build ./client/dist ./server/build ./cli/build ./package-lock.json && npm install",
"dev": "node client/bin/start.js --dev",
"dev:windows": "node client/bin/start.js --dev",
"dev:sdk": "npm run link:sdk && concurrently \"npm run dev\" \"cd sdk && npm run build:esm:w\"",
"link:sdk": "(test -d sdk || ln -sf ${MCP_SDK:-$PWD/../typescript-sdk} sdk) && (cd sdk && npm link && (test -d node_modules || npm i)) && npm link @modelcontextprotocol/sdk",
"unlink:sdk": "(cd sdk && npm unlink -g) && rm sdk && npm unlink @modelcontextprotocol/sdk",
"start": "node client/bin/start.js",
"start-server": "cd server && npm run start",
"start-client": "cd client && npm run preview",
"test": "npm run prettier-check && cd client && npm test",
"test-cli": "cd cli && npm run test",
"test-server": "cd server && npm run test",
"test:e2e": "MCP_AUTO_OPEN_ENABLED=false npm run test:e2e --workspace=client",
"prettier-fix": "prettier --write .",
"prettier-check": "prettier --check .",
"lint": "prettier --check . && cd client && npm run lint",
"prepare": "husky && npm run build",
"publish-all": "npm publish --workspaces --access public && npm publish --access public",
"update-version": "node scripts/update-version.js",
"check-version": "node scripts/check-version-consistency.js"
},
"dependencies": {
"@modelcontextprotocol/inspector-cli": "^1.0.0",
"@modelcontextprotocol/inspector-client": "^1.0.0",
"@modelcontextprotocol/inspector-server": "^1.0.0",
"@modelcontextprotocol/sdk": "^1.25.2",
"concurrently": "^9.2.0",
"node-fetch": "^3.3.2",
"open": "^10.2.0",
"shell-quote": "^1.8.4",
"spawn-rx": "^5.1.2",
"ts-node": "^10.9.2",
"zod": "^3.25.76"
},
"devDependencies": {
"@playwright/test": "^1.54.1",
"@types/jest": "^29.5.14",
"@types/node": "^22.17.0",
"@types/shell-quote": "^1.7.5",
"husky": "^9.1.7",
"jest-fixed-jsdom": "^0.0.9",
"lint-staged": "^16.1.5",
"playwright": "^1.56.1",
"prettier": "3.9.5",
"rimraf": "^6.0.1",
"typescript": "^5.4.2"
},
"overrides": {
"get-intrinsic": "1.3.0",
"shell-quote": "^1.8.4",
"hono": "^4.12.25",
"form-data": "^4.0.6",
"@babel/core@<=7.29.0": "^7.29.6",
"esbuild@<0.28.1": "^0.28.1",
"minimatch@<3.1.4": "3.1.5",
"js-yaml@<4": "3.15.0",
"js-yaml@>=4": "4.2.0"
},
"engines": {
"node": ">=22.7.5"
},
"lint-staged": {
"**/*.{js,ts,jsx,tsx,json,md}": [
"prettier --write"
]
}
}