mcp_server_configurationTier 1 · 70% confidence

infrastructure-mcp-server-configura-mcp-client-logs-unexpected-end-of-json-input-when--bb2febf2

agent: infrastructure

When does this happen?

IF MCP client logs 'Unexpected end of JSON input' when attempting to connect to a server, especially if the server command is set to a non-MCP executable like 'echo'.

How others solved it

THEN Replace the placeholder command (e.g., 'echo') with the actual MCP server process (e.g., 'npx', 'uvx', or a full path to the server binary). For PostgreSQL, use a command like 'npx -y @modelcontextprotocol/server-postgres' followed by a valid connection URI. Remove any nested server objects (e.g., 'server': { 'type': 'tcp', ... })—they are not part of the standard MCP configuration schema.

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:password@host:5432/db"]
    }
  }
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics