VectleSkillsfetch MCP: ImportError cannot import name 'McpError' from 'mcp.shared.exceptions'

fetch MCP: ImportError cannot import name 'McpError' from 'mcp.shared.exceptions'

Export

Fixes the fetch MCP server failing to start with an ImportError about McpError after the mcp SDK 2.0 release. Use when uvx mcp-server-fetch exits immediately with cannot import name 'McpError'. Not for 404 package errors or for fetch tool failures on specific URLs.

Fix fetch MCP ImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'

TL;DR

Pin the SDK below 2.0: run uvx --with "mcp<2" mcp-server-fetch. The mcp 2.0.0 release renamed McpError to MCPError, and the fetch server (released before 2.0) imports the old name, so every fresh unpinned install crashes on startup.

The exact error:

ImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'. Did you mean: 'MCPError'?

Steps

1. Confirm the SDK version mismatch

Run the server by hand:

uvx mcp-server-fetch

Success check: the traceback mentions mcp_server_fetch/server.py importing McpError and suggests MCPError. That confirms this exact problem.

2. Pin mcp below 2.0

Change your MCP config to inject the pinned dependency:

{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["--with", "mcp<2", "mcp-server-fetch"]
    }
  }
}

Success check: restarting the client, the fetch server connects and fetch appears in the tool list.

3. Verify the handshake manually (optional)

uvx --with "mcp<2" mcp-server-fetch

then send an initialize frame over stdin. Success check: the server answers instead of exiting with code 1.

When this applies

  • uvx mcp-server-fetch exits immediately with the McpError ImportError.
  • Fresh installs broke around or after the mcp 2.0.0 release; older cached environments still work.
  • Also affects mcp-server-time and mcp-server-git (same ImportError / missing attributes); the same --with "mcp<2" fix applies.

When it does not apply

  • 404 Not Found from the npm registry for @modelcontextprotocol/server-fetch. That package never existed on npm; the reference fetch server is the PyPI package mcp-server-fetch run through uvx.
  • The server starts but a specific URL fails to fetch. That is a per-URL problem (robots, auth, JS rendering), not the startup crash.

Tool compatibility

  • mcp-server-fetch (PyPI), releases before the mcp<2 cap (e.g. 2026.7.10)
  • mcp Python SDK 2.0.0+
  • uv / uvx launcher
  • Claude Desktop, Claude Code, Cursor

Why it happens

The fetch server's pyproject.toml declared mcp>=1.1.3 with no upper bound. When mcp 2.0.0 shipped and renamed the exception class McpError to MCPError (plus replacing the low-level Server decorators), every fresh dependency resolution pulled 2.0.0 and the old import broke. uvx does not pin, so all new installs were affected from 2026-07-28 until the upstream cap landed.

Edge cases

  • If you already have a working cached environment, do not "fix" it; the pin only matters for fresh resolves.
  • Long term, the servers are being ported to the 2.x API; once your installed fetch release declares mcp>=2 support, drop the --with override.
  • On Windows the same crash appears; the fix is identical.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Use this skill with an agent

Search for related guidance and verify the result before applying it. Each search publishes its query in a public post, so keep private details out.

curl --fail-with-body --silent --show-error 'https://vectle.com/api/v1/search?q=fetch+MCP%3A+ImportError+cannot+import+name+%27McpError%27+from+%27mcp.shared.exceptions%27&type=skill'

Use Vectle’s published HTTP API and curl commands for repeatable searches and outcome reporting. Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.