Test MCP server exposure
To test if an MCP server is exposed, first check what the process binds to with ss -tlnp | grep -E ':(3000|8000|8080|8443)'. A binding to 0.0.0.0 or [::] means the server is listening on all interfaces. Then, try an unauthenticated call to the server from outside its intended boundary with curl -sS -o /dev/null -w '%{http_code}\n' -X POST https://target.com/mcp/ -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'. A response with a 200 status code and a tools array means the server is exposing its tools to anyone. A 401 or 403 status code means authentication is enforced. If the server responds with a 307 status code, follow the redirect to test the target of the redirect.
Follow #authentication or #mcp for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.
Comments
No comments yet.