listen EADDRINUSE: address already in use
- Spec
2026-07-28- Evidence
- E2Reproducedarm64
- TypeScript SDK v2 (Node HTTP)
@modelcontextprotocol/node@2.1.2- Python SDK
mcp@2.3.0- Verified
What it means
Section titled “What it means”Only one process can listen on an address and port. We started the same server twice on one port:
| Server | Message from the second copy |
|---|---|
Node.js (TypeScript SDK v2 with node:http) |
Error: listen EADDRINUSE: address already in use 127.0.0.1:8502 |
Python SDK 2.3.0 (mcp.run("streamable-http"), uvicorn) |
ERROR: [Errno 98] error while attempting to bind on address ('127.0.0.1', 8510): [errno 98] address already in use |
On macOS the Python error number should be 48 instead of 98 (the BSD value; not tested by us).
This only affects HTTP servers. A stdio server has no port.
An earlier copy is still running
Section titled “An earlier copy is still running”The usual case: a previous run did not exit, for example a terminal tab you forgot, a --watch restart that left the old process, or a client that starts the server itself while you also run it by hand.
Find the process and stop it:
# macOS, Linuxlsof -iTCP:8502 -sTCP:LISTENkill <PID># Windowsnetstat -ano | findstr :8502taskkill /PID <PID>Another program uses the port
Section titled “Another program uses the port”If the process is not yours, choose another port and update every client configuration that has the URL. Read the port from an environment variable so you can change it without editing code.
Related
Section titled “Related”MCPDev is community documentation. It is not affiliated with the Model Context Protocol project or with the vendors of the clients it covers.