refactor: deduplicate URL generation and standardize on localhost

- Extract duplicated URL generation code into getClientUrl() helper function in start.js
- Replace all 127.0.0.1 references with localhost for consistency across codebase
- Update server to respect HOST environment variable for URL generation
- Remove 127.0.0.1 from default allowed origins in CORS configuration
- Update documentation to use localhost instead of 127.0.0.1

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felix Weinberger 2025-06-19 11:47:04 +01:00
commit fe2c5c767d
No known key found for this signature in database

View file

@ -40,7 +40,7 @@ const server = http.createServer((request, response) => {
});
const port = process.env.PORT || 6274;
const host = process.env.HOST || "127.0.0.1";
const host = process.env.HOST || "localhost";
server.on("listening", () => {
console.log(
`🔍 MCP Inspector is up and running at http://${host}:${port} 🚀`,