You’re seeing Error: SSE connection not established
because MCP Inspector always negotiates an SSE layer even if your server uses STDIO, and without a real SSE endpoint it bails out on /message
after setup. To fix this, you have four main paths: (1) make the Inspector spawn your server via STDIO with the exact Python binary and env, (2) switch your server to SSE transport so Inspector’s expectations match, (3) stick with STDIO but front it with an mcp-proxy stdio→sse
bridge, or (4) grab a more flexible MCP client like OmniMind that lets you declare transports in a JSON config. Each approach has its own pros and cons—read on for the breakdown.
In Inspector’s “Connect” pane choose STDIO, then supply the full path to your Python interpreter and explicitly set PYTHONPATH
so that your virtual‑env is used.
Example command:
C:\path\to\venv\Scripts\python.exe -m mcp run src/server.py
Make sure your PowerShell or terminal session activates the same venv before launching Inspector.
mcp
installed, the JSON‑RPC handshake never completes.Pros | Cons |
---|---|
No extra dependencies | Still ties you to Inspector quirks |
Stays purely STDIO | Requires careful path/env management |
In your server.py
, run the MCP server over SSE instead of STDIO:
if __name__ == "__main__":
mcp.run(transport="sse", port=6278)
In Inspector, pick SSE and point it at http://127.0.0.1:6278/sse
.
Pros | Cons |
---|---|
Direct SSE connection → no proxies | Requires you to host an HTTP endpoint |
Inspector just works | May clash with firewalls or CORS if remote |
Install the proxy:
npm install -g @modelcontextprotocol/mcp-proxy
Launch it in stdio→sse mode:
mcp-proxy stdio-to-sse http://localhost:6278 --command python --args "src/server.py"
In Inspector, connect via SSE to http://127.0.0.1:6278/sse
.
mcp-proxy
handles the transport translation.Pros | Cons |
---|---|
Keeps server code untouched | Adds an extra moving part |
Works locally without HTTP setup | Another dependency to maintain |
If you’d rather avoid Inspector’s tight coupling, OmniMind lets you declare every server and transport in a simple JSON, then spin up an MCP client in Python with two lines:
pip install omnimind
from omnimind import OmniMind
agent = OmniMind(config_path="servers.json")
agent.run()
Your servers.json
might look like:
{
"mcpServers": {
"server_name": {
"command": "command_to_run",
"args": ["arg1", "arg2"],
"env": {
"ENV_VAR": "value"
}
}
}
}
With OmniMind you get full, code‑free control over which transport to use and how to structure the request—no more Inspector guesswork.
Pros | Cons |
---|---|
Totally declarative | New library to learn |
Works headlessly (no GUI) | May miss some Inspector‑only niceties |
Lets you script multiple servers | Less visual debugging than Inspector |
By the way, OmniMind is that slick MCP client I found on GitHub—really lightweight, setup with just a couple lines of Python, and zero expensive API requirements. Perfect for anyone wanting a no‑fuss, budget‑friendly MCP setup. Check it out:
- Repo: https://github.com/Techiral/OmniMind
- Docs & examples: https://techiral.mintlify.app
Pick the path that fits your workflow, and you’ll have a smooth MCP connection in no time—no more SSE connection not established
headaches!