Local MCP Service Fails to Connect in Cursor Despite Being Accessible via curl

Describe the Bug

Hello Cursor Team,

I’m experiencing a persistent issue where a locally running MCP service fails to connect within Cursor, even though it’s fully operational and accessible from the operating system. After extensive debugging, we’ve concluded the issue lies within the Cursor application itself.

My Environment:

  • OS: macOS [Please fill in your macOS version here, e.g., Sonoma 14.5]
  • Cursor Version: 1.1.6
  • MCP Service: Serena (oraios/serena)

Key Findings:

  1. The Serena MCP service runs perfectly when started manually in a terminal. Its own web dashboard confirms it’s active and all tools are loaded.
  2. A curl -v http://127.0.0.1:24282 command successfully connects to the service, proving it’s healthy and accessible at the OS network layer.
  3. My mcp.json is configured to the simplest possible state, using a direct URL: {"mcpServers": {"serena": {"url": "http://127.0.0.1:24282"}}}.
  4. My macOS firewall settings have been verified to allow incoming connections for Cursor Helper (Plugin).app.

Conclusion:
All evidence suggests this is not a user configuration error. The problem seems to stem from Cursor’s sandboxed environment, which appears to be preventing it from making a network request to 127.0.0.1, even when the service is demonstrably available. This could be due to internal security policies like Mixed-Content Blocking or other network restrictions.

Steps to Reproduce

  1. Set up the MCP environment:

    • Create a dedicated Python virtual environment (e.g., using uv venv).
    • Activate the environment.
    • Install the Serena MCP server: uv pip install "serena[default]@git+https://github.com/oraios/serena".
  2. Run the MCP service manually:

    • In a terminal with the environment activated, run the server, pointing it to any local project folder:
    • serena-mcp-server --project /path/to/any/local/project
    • Keep this terminal window open. The server should be logging that it is active.
  3. Verify service accessibility:

    • Open a new terminal window.
    • Run curl -v http://127.0.0.1:24282.
    • Expected curl result: A successful connection (* Connected to localhost...) followed by an HTTP response (e.g., 404 Not Found). This proves the service is running and reachable.
  4. Configure Cursor:

    • Set the content of your mcp.json file to the following:
      {
        "mcpServers": {
          "serena": {
            "url": "http://127.0.0.1:24282"
          }
        }
      }
      
  5. Observe the bug:

    • Completely restart the Cursor application.
    • Go to the AI... > MCP Tools settings page.
    • Result: The serena service will show a red warning dot, indicating a failed connection, despite the service running correctly and being accessible via curl.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

版本: 1.1.6 (Universal)
提交: 1.96.2
日期: 5b19bac7a947f54e4caa3eb7e4c5fbf832389850
Electron: 2025-06-25T02:16:57.571Z
ElectronBuildId: 34.5.1
Chromium: undefined
Node.js: 132.0.6834.210
V8: 20.19.0
OS: 13.2.152.41-electron.0

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.