High severity intermediate · Fix: 5-10 min

MCPToolNotFoundError

mcp.exceptions.MCPToolNotFoundError

What this error means
The MCP client failed to find the specified tool in the server list, causing tool discovery to fail.

Stack trace

traceback
Traceback (most recent call last):
  File "app.py", line 42, in <module>
    tool = mcp_client.get_tool("my_tool")  # This line triggers the error
  File "/usr/local/lib/python3.9/site-packages/mcp/client.py", line 88, in get_tool
    raise MCPToolNotFoundError(f"Tool '{tool_name}' not found in server list.")
mcp.exceptions.MCPToolNotFoundError: Tool 'my_tool' not found in server list.
QUICK FIX
Ensure the tool name is correct and the MCP client is configured with the up-to-date server list containing the tool.

Why it happens

This error occurs when the MCP client attempts to retrieve a tool by name but the tool is not registered or available in the current server list configuration. It often happens due to misconfiguration, missing tool deployment, or incorrect tool naming.

Detection

Catch MCPToolNotFoundError exceptions when calling get_tool and log the requested tool name and current server list to detect missing tools before the application crashes.

Causes & fixes

1

The tool name requested does not exist in the MCP server list configuration.

✓ Fix

Verify the tool name spelling and ensure the tool is properly registered in the MCP server list configuration file or service.

2

The MCP server list is outdated or missing the deployed tool due to deployment or sync issues.

✓ Fix

Refresh or reload the MCP server list from the source of truth and confirm the tool is deployed and available.

3

The MCP client is connected to the wrong or an incomplete server list environment (e.g., staging vs production).

✓ Fix

Check the MCP client configuration to ensure it points to the correct server list environment containing the desired tools.

Code: broken vs fixed

Broken - triggers the error
python
from mcp import MCPClient

mcp_client = MCPClient()
tool = mcp_client.get_tool("my_tool")  # This line triggers MCPToolNotFoundError
print(tool.execute())
Fixed - works correctly
python
import os
from mcp import MCPClient, MCPToolNotFoundError

os.environ["MCP_SERVER_LIST_URL"] = "https://prod.mcp.example.com/servers.json"  # Set correct server list URL

mcp_client = MCPClient()
try:
    tool = mcp_client.get_tool("my_tool")  # Fixed: ensure tool exists in server list
    print(tool.execute())
except MCPToolNotFoundError as e:
    print(f"Error: {e}")  # Handle missing tool gracefully
Added environment variable to point MCP client to the correct server list and wrapped get_tool call in try/except to handle missing tool errors gracefully.

Workaround

Wrap the get_tool call in a try/except MCPToolNotFoundError block and provide a fallback tool or notify the user to avoid crashing the application.

Prevention

Implement automated validation of MCP server list configurations during deployment and ensure clients always use the latest server list endpoint to avoid missing tools.

Python 3.9+ · mcp >=1.0.0 · tested on 1.2.3
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.