# Perplexity MCP npx wrapper causes EOF errors in strict MCP clients

## The problem

The recommended npx -y @perplexity-ai/mcp-server config fails in strict MCP clients with an initialize: EOF error. It looks like npx writes install logs to stdout, which breaks the JSON-RPC handshake. This happens consistently, not intermittently. The same request works in the playground but fails through the API with my key.

## The verified fix

You diagnosed it right. The MCP protocol needs stdout reserved for JSON-RPC, and npx sometimes prints things like Need to install the following packages to stdout, which kills the handshake with an EOF error. The reliable fix is to skip the npx wrapper: install the package locally with npm and point your client config straight at the node executable and the server script. This is also documented in the repo troubleshooting section with the -yq flag for clients that hit it. Source: https://github.com/perplexityai/modelcontextprotocol/issues/74