Ziync.
HomeAbout

Services

Web Design & DevelopmentUI/UX DesignSEO & ContentPaid AdvertisingAI & AutomationDigital StrategyEvent Management

Hire Us

Hire a Next.js DeveloperWeb Development in Chennai

Overview

View All Services

BNex

BNex PlatformBNex Docs
PortfolioBlogsContact
Start a Project
HomeAbout

Services

Web Design & DevelopmentUI/UX DesignSEO & ContentPaid AdvertisingAI & AutomationDigital StrategyEvent Management

Hire Us

Hire a Next.js DeveloperWeb Development in Chennai

Overview

View All Services

BNex

BNex PlatformBNex Docs
PortfolioBlogsContact
Start a Project
Ziync.

We build high-performance digital engines and strategic marketing funnels for mid-size to enterprise growth.

Navigation

  • About
  • Services
  • Portfolio
  • BNex
  • BNex Docs
  • Blogs
  • WhatsApp Guides
  • WhatsApp Templates
  • Free Tools
  • Work With Us
  • Web Development Chennai

Services

  • Web Design & Dev
  • UI/UX Design
  • SEO & Content
  • Paid Advertising
  • Digital Strategy
  • AI & Automation

Popular Articles

  • AI Web Development 2026
  • Firebase Deploy Gap
  • Email Deliverability Guide
  • Autonomous Lead Generation
  • Why Automation Breaks
consult@ziync.com+91 80150 22745WhatsApp
Chennai, India

© 2026 Ziync. All Rights Reserved.

PrivacyTermsGDPR & DPDP
Home/Blogs/MCP
MCP
November 16, 2026
•
7 min read

MCP server not connecting? Six checks, in this order

An MCP server that fails to connect is almost never a broken server. It is writing a log line to stdout, or it is missing an env var your shell had. Here are the six checks I run, in the order that finds it fastest.

Manikandan S
Manikandan S
Founder & Technical Lead at Ziync
#MCP#AI agents#Hermes Agent
An MCP server process failing to connect inside an AI agent's tool list
An MCP server process failing to connect inside an AI agent's tool list
Executive Summary & Key Takeaways

An MCP server that fails to connect is almost never a broken server. It is writing a log line to stdout, or it is missing an env var your shell had. Here are the six checks I run, in the order that finds it fastest. In this deep dive, we explore actionable strategies, real-world engineering blueprints, and future-proof patterns to elevate your digital operations.

Table of Contents
  • Why "not connecting" hides so much
  • Symptom to cause, quickly
  • Check 1: does the command start outside the client?
  • Check 2: is anything else writing to stdout?
  • Check 3: environment variables are not inherited
  • Check 4: the working directory is not what you expect
  • Check 5: version and capability mismatch
  • Check 6: for remote servers, the endpoint and headers
  • Once it connects, the next bottleneck is not technical
  • Related Reading

You add an MCP server to your agent, restart it, and nothing appears — no tools, no error, or a one-line failure with no detail. Your instinct is that the server is broken. It almost never is.

I have wired a lot of these, and the same six things are behind nearly every failed connection. Each one has a distinct symptom, which is why the order below matters: you can skip straight to the right check instead of restarting the client repeatedly and hoping.

Why "not connecting" hides so much

MCP over stdio is simple underneath: the client launches your command as a subprocess, then speaks newline-delimited JSON-RPC over that process's standard input and output. "Connecting" therefore means three separate things worked — the process started, the first message on the pipe was valid JSON, and both sides agreed on a protocol version and capabilities.

Only the middle one is silent. A process that fails to start usually says so. A stream that gets corrupted fails after startup, so the client reports a vague "server disconnected" and you go looking in the wrong place.

Symptom to cause, quickly

What you seeMost likely causeCheck
spawn … ENOENT, or a server that never appearsThe command is not on the client's PATH1
Server shows as connected, zero tools listedIt wrote something to stdout2
Works when you run it by hand, fails in the clientMissing environment variable or wrong working directory3 and 4
UnsupportedProtocolVersionError (-32022)Client and server are on different protocol revisions5
Invalid params (-32602) on every callA required _meta field is missing from the request5
HTTP server returns 401, or the call hangsWrong endpoint path, missing auth header, or wrong Accept header6

Check 1: does the command start outside the client?

Copy the exact command and args from your config and run them in a terminal. If the entry is a bare npx, uvx or node, that is your first suspect: a GUI-launched client does not inherit your shell's PATH the way a terminal does. The same words that resolve in your shell can be genuinely not found by the app.

Use the absolute path to the interpreter or launcher. On Windows that is the difference between node and C:\Program Files\nodejs\node.exe; on macOS, a Homebrew node under /opt/homebrew/bin is invisible to an app started from Finder.

Check 2: is anything else writing to stdout?

This is the one that costs people the most time, so it gets its own section. On the stdio transport, the server's stdout is the protocol channel. One print("Server started"), one banner, one progress bar, and the JSON-RPC stream contains something that is not JSON. The client's parser hits it and drops the connection — after startup succeeded, so nothing reports a start-up problem.

The rule: log to stderr, always. Clients capture stderr and show it in their logs. Python: configure logging to stderr or use print(..., file=sys.stderr). Node: console.error. Anything you would normally print for a human goes there.

To prove it, run the server with stdin closed and capture the streams separately:

node server.js < /dev/null > out.txt 2> err.txt

out.txt should contain nothing, or only JSON-RPC messages. If it contains prose, you found the bug. Vendor SDKs are not exempt — some print a version banner on import, so check before assuming your own code is clean.

Check 3: environment variables are not inherited

Clients launch stdio servers with only a limited subset of the environment, and the subset is platform-dependent. A token you exported in your shell, or that lives in a .env your terminal picks up, is simply not there. The server then fails on its first API call — or exits during startup with a stack trace that lands in a log file you have not opened yet.

Pass values explicitly in the server's env block:

{
  "mcpServers": {
    "my-reports": {
      "command": "/usr/local/bin/node",
      "args": ["/Users/me/mcp/reports/build/index.js"],
      "env": { "MYAPP_API_KEY": "the-actual-key" }
    }
  }
}

Do not assume $VAR interpolation works in that block. Many clients pass the string through literally, so "${MYAPP_API_KEY}" arrives as those exact characters and the server authenticates with a variable name. Put the literal value in, and only use interpolation if the client's own documentation says it expands.

Check 4: the working directory is not what you expect

A stdio server launched by a client may start with a working directory of / on macOS, because the client itself was started from anywhere. Any relative path — a ./data argument, a .env the server reads on import, a SQLite file — resolves against that.

The fix is boring and total: absolute paths in args, and absolute paths inside whatever config file the server reads. Once I stopped shipping relative paths, this category of failure disappeared entirely.

Check 5: version and capability mismatch

Recent MCP revisions carry protocol metadata per request, not only in a one-time handshake: every request must include io.modelcontextprotocol/protocolVersion and io.modelcontextprotocol/clientCapabilities inside _meta. Leave either out and the server rejects the request with -32602 (Invalid params) — the same code used for other malformed input, which is why it reads like a schema bug in your tool definition rather than a protocol problem.

Two more codes worth recognising:

  • -32022, UnsupportedProtocolVersionError: the server's data field lists the versions it does support. Compare that against your client's version.
  • -32021, MissingRequiredClientCapabilityError: the server needs a capability your client did not declare. It names the missing one.

Older revisions used an initialize handshake instead. Clients and servers from different eras are supposed to detect each other and fall back, and mostly they do — but a pre-release SDK against a released client is where that fallback gets tested in public. Pin your SDK rather than chasing it.

Check 6: for remote servers, the endpoint and headers

Streamable HTTP servers take every message as a POST to a single MCP endpoint. The reply is either a JSON object or a request-scoped SSE stream. So the mistakes are structural, not network-level:

  • Wrong path. /sse, /messages and /mcp are not interchangeable. A wrong path returns 404, or hangs waiting for a stream that will never open.
  • Missing auth. The server logs a 401 while the client shows a generic connection failure. Read the server's log, not the client's status dot.
  • Wrong Accept header. The spec requires clients to send Accept: application/json, text/event-stream, and some servers enforce it. A hand-written curl with only application/json gets rejected, which is how people conclude the server is down.

Test with curl against the endpoint before touching client configuration. If you cannot get a sane JSON-RPC error back from curl, no client setting will fix it.

Once it connects, the next bottleneck is not technical

Every one of these six checks is about getting an agent to reliably use your systems. When they are all green, the interesting failure has already moved: the agent can do things, but the customer is still waiting on a channel it cannot reach.

For most small and mid-sized businesses, that channel is WhatsApp — and the hard part there is not the API call, it is templates, the 24-hour service window, and who owns the number. BNex is the product I build for exactly that layer, and if you are starting from an unverified business, the WhatsApp Business API access guide walks the onboarding in the order that avoids rework. When the question is whether to wire a conversation with a flow builder or from code, this comparison covers the trade-off honestly.

One thing I would say from experience: start the automation small. A single tool that answers one real question beats a platform diagram, and it is far easier to tell whether it connected for the right reason.

Stuck on a specific error right now? Send me the exact message on WhatsApp at +91 73587 22745 and I will tell you which of the six it is. If you want the longer version of how agents find and read your site in the first place, this post on making your website readable by AI agents is the companion piece.

Related Reading

  • Why your first automation should be small
  • Why automation breaks at one point, not everywhere
  • Making your website readable by AI agents

Get more insights like this

Join our list for practical automation, web engineering, and growth strategy — written by builders, for builders.

Manikandan S

Manikandan S

Founder & Technical Lead at Ziync

Founder and technical lead at Ziync. I build high-performance websites and web applications for startups and mid-market teams: React, Next.js, Firebase. Based in Chennai, working with clients worldwide.

Learn more about our team
Previous Post

Migrating a WhatsApp number between providers without losing the conversation

Next Post

Mauritius TINS scheme: the government may co-fund your CRM

Back to All Articles