Skip to content

Tools Disappear in Claude When Importing Libraries Like pandas #14

@ahmadsyria

Description

@ahmadsyria

I'm building an MCP server with simple tools that work perfectly with Claude. For example, a basic tool like say_hello runs fine and is recognized inside Claude.

However, as soon as I import an external library like pandas (even without using it in any tool), the following happens:

All tools disappear in Claude.

I get a Server disconnected message inside Claude.

Claude no longer recognizes any registered tools, including the simple ones

`from mcp.server.fastmcp import FastMCP
from typing import Optional, Union
import pandas as pd

mcp = FastMCP("DemoServer")

Simple tool

@mcp.tool()
def say_hello(name: str) -> str:
"""Say hello to someone

Args:
    name: The person's name to greet
"""
return f"Hello, {name}! Nice to meet you."

if name == "main":
mcp.run()

`

This issue happens even if pandas is only imported and not used.

Removing the pandas import line resolves the issue immediately.

Note: even with numpy same issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions