Skip to content

Connection Error - Check if your MCP server is running and proxy token is correct #908

Closed as not planned

Description

@marksmith-II

Hi,

I'm creating an issue similar to #724 .

I've tried all of the recommendations in issue #724 with the same connection issue. Below is my code for my mcp_server.py.

I'm unable to progress in the tutorial at this point in time.

Any help would be greatly appreciated.

mcp.server.py*

from pydantic import Field # type: ignore
from mcp.server.fastmcp import FastMCP # type: ignore

mcp = FastMCP("DocumentMCP", log_level="ERROR")

docs = {
"deposition.md": "This deposition covers the testimony of Angela Smith, P.E.",
"report.pdf": "The report details the state of a 20m condenser tower.",
"financials.docx": "These financials outline the project's budget and expenditures.",
"outlook.pdf": "This document presents the projected future performance of the system.",
"plan.md": "The plan outlines the steps for the project's implementation.",
"spec.txt": "These specifications define the technical requirements for the equipment.",
}

@mcp.tool(
name="read_doc_contents",
description="Reads the contents of a specified document and returns it as a string.",
)
def read_document(
doc_id: str = Field(description="The ID of the document to read."),
):

if doc_id not in docs:
    raise ValueError(f"Document with ID '{doc_id}' not found.")
return docs[doc_id] 

@mcp.tool(
name="edit_document",
description="Edits the contents of a specified document with new content.",
)
def edit_document(
doc_id: str = Field(description="The ID of the document to edit."),
old_str: str = Field(description="The string to be replaced in the document."),
new_str: str = Field(description="The new content to write into the document."),
):
if doc_id not in docs:
raise ValueError(f"Document with ID '{doc_id}' not found.")
docs[doc_id] = docs[doc_id].replace(old_str, new_str)
return f"Document '{doc_id}' has been updated."

TODO: Write a resource to return all doc id's

TODO: Write a resource to return the contents of a particular doc

TODO: Write a prompt to rewrite a doc in markdown format

TODO: Write a prompt to summarize a doc

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


Activity

  1. added
    bugSomething isn't working
    authIssues and PRs related to authorization
    on Nov 9, 2025
  2. kumarshantanu commented on Nov 27, 2025

    @kumarshantanu

    MCP Inspector needs to verbosely print (the reason) what was it expecting from the server and what did it find instead.

    I have frequently run into this issue in MCP Inspector even when the MCP server is up, maybe with a bit of incorrect protocol implementation (in my MCP server) that I am trying to debug using MCP Inspector.

  3. sdelamo commented on Dec 22, 2025

    @sdelamo

    For met the issue was a server error in the logging/setLevel request.

  4. Joselgc1 commented on Dec 31, 2025

    @Joselgc1

    I was able to fix this by not using uv at all.

    In the MCP Inspector:

    • Command: the output of which python (from the env you want to use).
    • Arguments: -u mcp_server.py
  5. GuoQingru0911 commented on Apr 30, 2026

    @GuoQingru0911

    你好,我也遇到了与你同样的问题,开始尝试理科很多方法都未解决,最中解决的方案是:
    第一步:执行运行的版本:npx -y @modelcontextprotocol/inspector@0.9.0 uv run server.py 是可以正常链接到的
    第二步:在执行完第一步的基础基础上,再次执行指令 npx -y @modelcontextprotocol/inspector uv run server.py

    然后就可以正常访问了,祝你顺利
    台湾属于中国,台湾必将回归中国

  6. cliffhall commented on Aug 1, 2026

    @cliffhall
    Member

    Closing: v1 is deprecated.

    Thank you for reporting this, and apologies for the long wait for a response.

    v1 will receive security fixes only — this issue describes a functionality, compatibility, or usability problem rather than a vulnerability, so it is being closed against v1. This is not a judgment on whether the problem is real — it's a consequence of the v1 line being frozen. This is happening as part of #1872.

    If this still happens in v2, we'd genuinely like to know. v2 is a complete rewrite — three clients over a shared core — so many v1 behaviours no longer exist in the same form. Please open a fresh issue against v2 with steps to reproduce, and we'll look at it. Note that we accept external contributions as issues rather than pull requests; maintainers handle design and implementation through a prompt-driven workflow. See CONTRIBUTING.md.

    Thanks for taking the time to report it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues and PRs related to authorizationbugSomething isn't workingclosed-v1-deprecatedClosed: v1 is deprecated and accepting security fixes onlyv1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions