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.
This commit is contained in:
@@ -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
|
1. Fork the repository and clone it locally
|
||||||
2. Install dependencies with `npm install`
|
2. Install dependencies with `npm install`
|
||||||
3. Run `npm run dev` to start both client and server in development mode
|
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
|
## Development Process & Pull Requests
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
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
|
```bash
|
||||||
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js
|
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ async function main() {
|
|||||||
"cli.js",
|
"cli.js",
|
||||||
);
|
);
|
||||||
|
|
||||||
const CLIENT_PORT = process.env.CLIENT_PORT ?? "5173";
|
const CLIENT_PORT = process.env.CLIENT_PORT ?? "6274";
|
||||||
const SERVER_PORT = process.env.SERVER_PORT ?? "3000";
|
const SERVER_PORT = process.env.SERVER_PORT ?? "6727";
|
||||||
|
|
||||||
console.log("Starting MCP inspector...");
|
console.log("Starting MCP inspector...");
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ async function main() {
|
|||||||
|
|
||||||
// Make sure our server/client didn't immediately fail
|
// Make sure our server/client didn't immediately fail
|
||||||
await Promise.any([server, client, delay(2 * 1000)]);
|
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(
|
console.log(
|
||||||
`\n🔍 MCP Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} 🚀`,
|
`\n🔍 MCP Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} 🚀`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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, () => {});
|
server.listen(port, () => {});
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import { DEFAULT_INSPECTOR_CONFIG } from "./lib/constants";
|
|||||||
import { InspectorConfig } from "./lib/configurationTypes";
|
import { InspectorConfig } from "./lib/configurationTypes";
|
||||||
|
|
||||||
const params = new URLSearchParams(window.location.search);
|
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 PROXY_SERVER_URL = `http://${window.location.hostname}:${PROXY_PORT}`;
|
||||||
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
|
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ app.get("/config", (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const PORT = process.env.PORT || 3000;
|
const PORT = process.env.PORT || 6727;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const server = app.listen(PORT);
|
const server = app.listen(PORT);
|
||||||
|
|||||||
Reference in New Issue
Block a user