Cannot connect to my custom MCP Server

Trying out the new MCP support. I have a custom MCP server up and running and have tested it with npx @modelcontextprotocol/inspector and it works perfectly. It does not use any authentication. When I try to setup the connection in the playground it seems to take a long time to connect to the MCP server (if it really is, not sure) and then goes to the page to list the tools and errors out with “Unable to load tools”.

I have switched the MCP server transport type from sse to streamable http without any change in behavior.

Anybody have any ideas what I may be doing wrong?

Hey there and welcome to the forum!

Do you have any screenshots of the output produced on either end when attempting this? Any way we could see some of the code for the MCP build or the shell scripts used to run the server?

There could be a plethora of issues that may be causing this. My intuition tells me this might be more of a networking config problem than an error in the server’s code itself, but I can’t verify that without seeing more details.

Have you verified you can ping/reach the MCP server from outside your local network first?

2 Likes

Here is a video showing it working with mcp inspector and then failing in the playground.

Here is the code of the mcp server

from fastmcp import FastMCP
mcp = FastMCP(name="hello-test-server", require_session=False)

@mcp.tool()
def hello_world() -> str:
    """Return the text 'hello world!'."""
    return "hello world!"

mcp.run(transport="streamable-http", host="0.0.0.0", port=8000, path="/mcp")

This is served up on a small digitalocean droplet running Ubuntu, and port 8000 is open via ufw

for some reason it is not letting me post a link to the video grrrr

Working with mcp inspector

Failing in the playground