Installing an MCP server

In the previous lessons, you learned that MCP servers provide tools to AI hosts, and that these servers can be written in different programming languages.

In this lesson, you will learn how to install and configure an MCP server so your AI can access and call the tools it provides.

Creating configuration files

To install an MCP server, you need to tell your AI host where to find the server and how to connect to it.

Configuration files are instruction documents that tell your AI host how to find and start an MCP server.

To install the Neo4j MCP server your configuration file will need to specify:

  • The name of the server and how to run it

  • How to connect to your Neo4j database

  • Your database credentials

MCP Server setup and configuration

In the next lesson you will install, setup, and configure the Neo4j MCP server.

The configuration is specific to the AI host you are using. For example, in Claude Desktop, you could create a file called .claude_desktop_config.json:

json
claude_desktop_config.json
{
  "mcpServers": {
    "neo4j-mcp": { // (1)
      "command": "path/to/neo4j-mcp", // (2)
      "args": [ // (3)
        "--neo4j-read-only",
        "true",
        "--neo4j-transport-mode",
        "http"
      ],
      "env": { // (4)
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_USERNAME": "neo4j",
        "NEO4J_PASSWORD": "<your-password>",
        "NEO4J_DATABASE": "neo4j"
      }
    }
  }
}

This configuration tells Claude Desktop:

  1. Server name: neo4j-mcp - a recognizable name for the Neo4j MCP server

  2. Command: neo4j-mcp - the command to start the server

  3. Arguments: Additional arguments to configure the server, such as making it read-only and setting the transport mode

  4. Database credentials: The connection details for your Neo4j database

Setting environment variables

Environment variables are settings that get passed to the MCP server when it starts up.

For the Neo4j Cypher server, environment variables include your database location, username, and password so the server can access your Neo4j database.

"Think of them as the keys and passwords the server needs to get to work."

The env section in the configuration above sets up:

  • NEO4J_URI: Where to find your Neo4j database (e.g., bolt://localhost:7687)

  • NEO4J_USERNAME and NEO4J_PASSWORD: Your database login credentials

  • NEO4J_DATABASE: Which specific database to connect to (e.g., neo4j)

Command Structure

Always split the command into separate pieces. Instead of providing one long string:

"path/to/neo4-mcp --neo4j-read-only true"

Use separate command and arguments:

{"command": "path/to/neo4-mcp", "args": ["--neo4j-read-only", "true"]}

Where This Fits

Installing MCP servers is the bridge between having an AI assistant and giving it access to your specific data and tools.

For Neo4j databases:

  • Without MCP: Your AI can only discuss Neo4j concepts theoretically

  • With MCP: Your AI can run actual Cypher queries, explore your data, and help you build and debug queries

This setup process happens once per server, then your AI can use those database tools in every conversation.

What’s Next

Now that you understand how MCP server installation works, you’ll create a development environment and connect the agent to an Neo4j database using the Neo4j MCP server.

Lesson Summary

In this lesson, you learned how configuration files and environment variables work together to install MCP servers in AI hosts like Claude Desktop.

In the next lesson, you’ll create a development environment, and connect the Neo4j Cypher MCP server and to a Neo4j database.

Chatbot

How can I help you today?

Data Model

Your data model will appear here.