Server.js
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new McpServer({
name: "test",
version: "1.0.0",
capabilities: {
resources: {},
tools: {},
prompts: {},
},
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
}
main();
Package.json
"name": "mcp-server-and-client",
"version": "1.0.0",
"main": "src/server.ts",
"type": "module",
"scripts": {
"server:build": "tsc",
"server:build:watch": "tsc --watch",
"server:dev": "tsx src/server.ts",
"server:inspect": "set DANGEROUSLY_OMIT_AUTH=true && npx @modelcontextprotocol/inspector npm run server:dev",
"client:dev": "tsx src/client.ts"
},
I am running the server using npm run server:inspect
in the Mcp inspector its saying Connection Error - Did you add the proxy session token in Configuration?
here is the ScreenShot
It is very simple to solve. It is just asking for the token and you can find it in terminal logs when you start the server. Copy the MCP_PROXY_AUTH_TOKEN and paste it in UI's Configuration > Proxy Session Token