iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📕

🤯 MCP Server Implementation Log: The Ultimate Debugging Experience of Connecting Multiple Third-Party Servers to Claude Desktop

に公開

Introduction

Hello.
Previously, we learned the basic structure of the JSON for listing multiple MCP servers in Claude Desktop.
This time, as an application, this is a record of my challenge to simultaneously connect three different functions: File System (Node.js), Web Fetch (Python), and a third-party Neo4j Cypher server (Python) to Claude Desktop.
In conclusion, this challenge turned out to be the ultimate debugging experience, testing all my knowledge of Node.js, Python path structures, and strict JSON syntax.
In this article, I will share the problems faced specifically when connecting third-party servers and their concrete solutions (specifying full paths).

1. Connection Goal: Integrating Three Different Functions

The advantage of MCP is that you can infinitely expand your AI app's capabilities by leveraging public SDKs and servers. The AI agent I ultimately aimed to connect this time has the following three capabilities.

Server Name Technology Function Overview
filesystem Node.js (npx) File and folder operations within the PC
fetch Python (python -m) Reading and summarizing content when given a URL
movies-neo4j Python/Cypher Executing Cypher read queries against a knowledge graph database

Neo4j MCP Server

mcp name: io.github.neo4j-contrib/mcp-neo4j-cypher
🌟 Overview
An MCP server implementation that provides database integration and realizes graph exploration capabilities via Neo4j. This server enables Cypher graph query execution, analysis of complex domain data, and automatic generation of business insights that can be further enhanced with application analysis tools.
This MCP server facilitates the Text2Cypher workflow detailed below.
o Blue steps are handled by the agent
o Purple by Cypher or other MCP servers
o Green by the user
User questions are input into the process, and answers generated by the agent are output.

🛠️ Utilizing SDKs and Server Lists

The official MCP repository provides SDKs for each language to facilitate development, as well as server lists (the servers repository) published by companies and the community.
The Neo4j server used this time is a third-party server, so security and other considerations are necessary when connecting.


2. The "Command Not Found" Barrier Faced When Adding Servers

While the JSON configuration listing both filesystem and fetch was successful, as soon as I added the movies-neo4j server, the connection failed.

Error Progression and Path to Resolution

Attempted Setting Core Error Lesson Learned
1. command: "uvx" 'uvx' is not recognized... Lesson: uvx does not exist in the Windows path. For the command, you must specify an executable file that the OS can recognize.
2. command: "python", args: ["-m", "mcp_neo4j_cypher"] No module named mcp_neo4j_cypher.main Lesson: The server package was not designed to be run in the python -m format. Since it depends on the Python package structure, this method is not reliable.
3. command: "mcp-neo4j-cypher.exe" (full path) mcp-neo4j-cypher: error: unrecognized arguments Lesson: Command identification was successful. However, unnecessary information such as the server name or version info was automatically added to the argument list, causing the server to reject it and crash.

Final Solution: Full Paths and Clean Arguments

The final method that succeeded was to completely break the dependency on the system path (environment variables) which was the source of errors.

  • Fixing the startup file with a full path: Write the complete path to the executable file installed by pip in the command field.
  • Example: "command": "C:\Users\Koga Hiroaki\AppData\Roaming\Python\...\mcp-neo4j-cypher.exe"
  • Cleanup arguments: Pass only the options and values required by the server (--db-url, --user, etc.) to args to prevent unnecessary arguments from being mixed in.

Application of MCP Server Settings: Record of Full Path Specification and DXT File Installation

  1. The Ultimate Solution: Specifying the Full Path of the Executable File
    In standard MCP server settings, commands like npx or uvx are used, but in Windows environments, these commands may not run correctly from Claude Desktop due to path issues or environment variable mismatches, causing the server to fail to start.

To avoid this problem, I directly wrote the full path of the executable file in the JSON as shown below.

Goal: Succeed in starting the third-party server (movies-neo4j).

Steps:

Identify the Scripts folder of the Python environment installed via pip (e.g., C:\Users\[Username]\AppData\Roaming\Python\[Version]\Scripts\).

Copy the full path of the executable file (e.g., mcp-neo4j-cypher.exe) within the folder.

Open the Claude Desktop configuration JSON and write that full path as the value for "command".

"movies-neo4j": {
  "command": "C:\\Users\\Koga Hiroaki\\AppData\\Roaming\\Python\\Python311\\Scripts\\mcp-neo4j-cypher.exe", 
  "args": [ ... ] 
}
  • (Note: In JSON, backslashes must be written as double \.)
  1. Record of Struggles Installing DXT Files
    Official documentation explains that Desktop Extensions (DXT/mcpb files) solve dependency issues by bundling the entire server into a single package. However, a one-click installation was not possible.

Correct installation method: Since double-clicking the DXT file resulted in a "Preview Failed" error, the following steps had to be taken manually.

Download the .DXT file.

From the Claude Desktop settings menu (Claude Desktop > Settings > Extensions > Advanced Settings > Install Extension).

After moving the file to the Claude Extension folder, execute "Install Extension".
※Note: It was necessary to move the DXT file to the Claude Extension folder beforehand.
This record shows that while DXT files are recommended to avoid complex environment setups, their installation itself requires specific operations.

4. Successful Final Multi-Server Configuration (JSON)

With this configuration, Node.js, Python, and the Neo4j server all start simultaneously in Claude Desktop and are ready for use.

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "c:\\Users\\Public\\Documents",
        "c:\\Users\\Public\\Downloads"
      ]
    },
    "fetch": {
      "command": "python",
      "args": ["-m", "mcp_server_fetch"],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    },
      "movies-neo4j": {
      "command": "C:\\Users\\Koga Hiroaki\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\Scripts\\mcp-neo4j-cypher.exe",
       "args": [ "--db-url", "neo4j+s://demo.neo4jlabs.com",
        "--user", "recommendations",
        "--password", "recommendations"  ],
      "env": {
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_USERNAME": "neo4j",
        "NEO4J_PASSWORD": "recommendations",
        "NEO4J_DATABASE": "neo4j"                          
    }
  }
 }
}

5. Conclusion: Mastering the Environment is Mastering MCP

From this series of setup experiences, I've realized that implementing MCP servers isn't just about AI knowledge, but that low-level knowledge such as OS paths, Python package structures, and JSON escape rules is extremely important.

Moving forward, I want to take on more complex tasks as an AI agent integrating these three servers, utilizing diverse information sources such as file operations, web access, and knowledge graphs.

By overcoming this hurdle, our AI agent has simultaneously acquired the following three capabilities:

File operations (filesystem)

Web information retrieval (fetch)

Structured data search (movies-neo4j)

I truly feel the potential of MCP, which allows you to infinitely expand an AI agent's capabilities simply by editing JSON.

References

"Introduction to Friendly MCP" (by Minoru Mita, Yu Otsubo)
https://www.shuwasystem.co.jp/book/9784798075730.html
https://neo4j.com/blog/developer/claude-converses-neo4j-via-mcp/
https://www.anthropic.com/engineering/desktop-extensions
https://github.com/neo4j-contrib/mcp-neo4j/blob/main/servers/mcp-neo4j-cypher/README.md

Discussion