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 use it.
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 Cypher server, a server that provides access to inspect and query Neo4j databases, your configuration file will need to specify:
-
Which Neo4j server package to install
-
How to connect to your Neo4j database
-
Your database credentials
{
"mcpServers": {
"neo4j-cypher": { // (1)
"command": "uvx", // (2)
"args": [ // (3)
"mcp-neo4j-cypher@0.2.3",
"--transport",
"stdio"
],
"env": { // (4)
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "<your-password>",
"NEO4J_DATABASE": "neo4j"
}
}
}
}
This configuration tells Claude Desktop:
-
Server name:
neo4j-cypher
- a recognizable name for the Neo4j database server -
Installation command:
uvx
- the tool that downloads and runs the Python server -
Server details: Which specific server package to install and how to communicate with it
-
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.
It’s like giving a new employee their office key, computer password, and building access card - they need these credentials to do their job.
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
andNEO4J_PASSWORD
: Your database login credentials -
NEO4J_DATABASE
: Which specific database to connect to (e.g.,neo4j
)
Command Structure
Always split commands into separate pieces. Instead of one long string:
"uvx mcp-neo4j-cypher --transport stdio"
Use separate command and arguments:
{"command": "uvx", "args": ["mcp-neo4j-cypher@0.2.3", "--transport", "stdio"]}
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 install the Neo4j Cypher MCP server in Claude Desktop and connect it to a Neo4j database.
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 install the Neo4j Cypher MCP server and configure it to connect to your Neo4j database.