From da9dd097655086180588cbfa0e79cba2dcf1b866 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Mon, 31 Mar 2025 00:31:28 +0000 Subject: [PATCH 1/4] refactor: Update default ports for MCPI client and MPCP server Changes the default ports used by the MCP Inspector client UI and the MCP Proxy server to avoid conflicts with common development ports and provide a memorable mnemonic based on T9 mapping. --- CONTRIBUTING.md | 2 +- README.md | 2 +- bin/cli.js | 6 +++--- client/bin/cli.js | 2 +- client/src/App.tsx | 2 +- server/src/index.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed28e9d6..72502f96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Thanks for your interest in contributing! This guide explains how to get involve 1. Fork the repository and clone it locally 2. Install dependencies with `npm install` 3. Run `npm run dev` to start both client and server in development mode -4. Use the web UI at http://127.0.0.1:5173 to interact with the inspector +4. Use the web UI at http://127.0.0.1:6274 to interact with the inspector ## Development Process & Pull Requests diff --git a/README.md b/README.md index 5fe36933..01920382 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 node build/inde npx @modelcontextprotocol/inspector -e KEY=$VALUE -- node build/index.js -e server-flag ``` -The inspector runs both a client UI (default port 5173) and an MCP proxy server (default port 3000). Open the client UI in your browser to use the inspector. You can customize the ports if needed: +The inspector runs both an MCP Inspector (MCPI) client UI (default port 6274) and an MCP Proxy (MPCP) server (default port 6727). Open the MCPI client UI in your browser to use the inspector. (These ports are derived from the T9 dialpad mapping of MCPI and MPCP respectively, as a mnemonic). You can customize the ports if needed: ```bash CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js diff --git a/bin/cli.js b/bin/cli.js index 1b744ced..b495f7b4 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -61,8 +61,8 @@ async function main() { "cli.js", ); - const CLIENT_PORT = process.env.CLIENT_PORT ?? "5173"; - const SERVER_PORT = process.env.SERVER_PORT ?? "3000"; + const CLIENT_PORT = process.env.CLIENT_PORT ?? "6274"; + const SERVER_PORT = process.env.SERVER_PORT ?? "6727"; console.log("Starting MCP inspector..."); @@ -100,7 +100,7 @@ async function main() { // Make sure our server/client didn't immediately fail await Promise.any([server, client, delay(2 * 1000)]); - const portParam = SERVER_PORT === "3000" ? "" : `?proxyPort=${SERVER_PORT}`; + const portParam = SERVER_PORT === "6727" ? "" : `?proxyPort=${SERVER_PORT}`; console.log( `\nšŸ” MCP Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} šŸš€`, ); diff --git a/client/bin/cli.js b/client/bin/cli.js index 7dc93eab..81b7bd11 100755 --- a/client/bin/cli.js +++ b/client/bin/cli.js @@ -15,5 +15,5 @@ const server = http.createServer((request, response) => { }); }); -const port = process.env.PORT || 5173; +const port = process.env.PORT || 6274; server.listen(port, () => {}); diff --git a/client/src/App.tsx b/client/src/App.tsx index c29ef71b..f65bdc29 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -49,7 +49,7 @@ import { DEFAULT_INSPECTOR_CONFIG } from "./lib/constants"; import { InspectorConfig } from "./lib/configurationTypes"; const params = new URLSearchParams(window.location.search); -const PROXY_PORT = params.get("proxyPort") ?? "3000"; +const PROXY_PORT = params.get("proxyPort") ?? "6727"; const PROXY_SERVER_URL = `http://${window.location.hostname}:${PROXY_PORT}`; const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1"; diff --git a/server/src/index.ts b/server/src/index.ts index 2a4fe658..7a527fc5 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -182,7 +182,7 @@ app.get("/config", (req, res) => { } }); -const PORT = process.env.PORT || 3000; +const PORT = process.env.PORT || 6727; try { const server = app.listen(PORT); From 80f5ab11369cdabfc4533f016b2625e6cb9420a3 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Mon, 31 Mar 2025 18:28:40 +0000 Subject: [PATCH 2/4] fix: typo --- README.md | 2 +- bin/cli.js | 4 ++-- client/src/App.tsx | 2 +- server/src/index.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 01920382..b0e18deb 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 node build/inde npx @modelcontextprotocol/inspector -e KEY=$VALUE -- node build/index.js -e server-flag ``` -The inspector runs both an MCP Inspector (MCPI) client UI (default port 6274) and an MCP Proxy (MPCP) server (default port 6727). Open the MCPI client UI in your browser to use the inspector. (These ports are derived from the T9 dialpad mapping of MCPI and MPCP respectively, as a mnemonic). You can customize the ports if needed: +The inspector runs both an MCP Inspector (MCPI) client UI (default port 6274) and an MCP Proxy (MCPP) server (default port 6277). Open the MCPI client UI in your browser to use the inspector. (These ports are derived from the T9 dialpad mapping of MCPI and MCPP respectively, as a mnemonic). You can customize the ports if needed: ```bash CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js diff --git a/bin/cli.js b/bin/cli.js index b495f7b4..460ce58e 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -62,7 +62,7 @@ async function main() { ); const CLIENT_PORT = process.env.CLIENT_PORT ?? "6274"; - const SERVER_PORT = process.env.SERVER_PORT ?? "6727"; + const SERVER_PORT = process.env.SERVER_PORT ?? "6277"; console.log("Starting MCP inspector..."); @@ -100,7 +100,7 @@ async function main() { // Make sure our server/client didn't immediately fail await Promise.any([server, client, delay(2 * 1000)]); - const portParam = SERVER_PORT === "6727" ? "" : `?proxyPort=${SERVER_PORT}`; + const portParam = SERVER_PORT === "6277" ? "" : `?proxyPort=${SERVER_PORT}`; console.log( `\nšŸ” MCP Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} šŸš€`, ); diff --git a/client/src/App.tsx b/client/src/App.tsx index f65bdc29..23c508f2 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -49,7 +49,7 @@ import { DEFAULT_INSPECTOR_CONFIG } from "./lib/constants"; import { InspectorConfig } from "./lib/configurationTypes"; const params = new URLSearchParams(window.location.search); -const PROXY_PORT = params.get("proxyPort") ?? "6727"; +const PROXY_PORT = params.get("proxyPort") ?? "6277"; const PROXY_SERVER_URL = `http://${window.location.hostname}:${PROXY_PORT}`; const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1"; diff --git a/server/src/index.ts b/server/src/index.ts index 7a527fc5..fcb82953 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -182,7 +182,7 @@ app.get("/config", (req, res) => { } }); -const PORT = process.env.PORT || 6727; +const PORT = process.env.PORT || 6277; try { const server = app.listen(PORT); From b99cf276ae91db8ee135a443c04b673e608a3b65 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Mon, 31 Mar 2025 18:34:12 +0000 Subject: [PATCH 3/4] fix: linting --- bin/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index ca1958ad..35edf0e9 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -117,4 +117,4 @@ main() .catch((e) => { console.error(e); process.exit(1); - }); \ No newline at end of file + }); From d1746f53a4d5bc5d9f9bba0ae248e33512dd4660 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Mon, 31 Mar 2025 20:11:40 +0000 Subject: [PATCH 4/4] Update package.json --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index c268c339..eb0091fb 100644 --- a/client/package.json +++ b/client/package.json @@ -18,7 +18,7 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", - "preview": "vite preview --port 5173", + "preview": "vite preview --port 6274", "test": "jest --config jest.config.cjs", "test:watch": "jest --config jest.config.cjs --watch" },