Skip to content

Example server and client not working #78

Closed
@p13rr0m

Description

@p13rr0m

Describe the bug
The example servers, in the folder examples/servers, in combination with the clients from README.md do not work.

  1. Using mcp_simple_tool as an example, starting the servers with the command mcp-simple-tool or mcp-simple-tool --transport sse --port 8000 is not correct. I believe that should be uv run mcp-simple-tool or uv run mcp-simple-tool --transport sse --port 8000 respectively.

  2. The client code is not able to talk to the server. I am not sure which method (stdio vs sse) the example should be using. Additionally, the import for the client does not exist.

from mcp.client import ClientSession

# ClientSession
async with ClientSession() as session:
    await session.initialize()

    # List available tools
    tools = await session.list_tools()
    print(tools)

    # Call the fetch tool
    result = await session.call_tool("fetch", {
        "url": "https://example.com"
    })
    print(result) 

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions