MCP server for an ecommerce store backed by Neo4j
Project description
Neo4j MCP Ecommerce Server (Python)
An MCP server that exposes two tools backed by Neo4j:
search_customer(q: str)— search customers by name or emailrecommend_product(customer_id: str, limit: int = 5)— recommend products via co-purchase
This project uses uv for dependency and runtime management and the official Python MCP SDK.
Prerequisites
- Python 3.10+
uvinstalled (see docs: https://docs.astral.sh/uv/)- A running Neo4j database
Setup
cd python
# (optional) create and activate a project venv
uv venv && source .venv/bin/activate
# install dependencies
uv sync
# configure environment
cp env.example .env
# edit .env with your credentials
Required environment variables:
NEO4J_URI(e.g.bolt://localhost:7687)NEO4J_USERNAMENEO4J_PASSWORDNEO4J_DATABASE(optional; defaults to Neo4j driver default)
Run the MCP server
The server runs with stdio transport (standard for MCP servers):
uv run neo4j-mcp-ecommerce
The server communicates over stdio and can be used with MCP clients like Claude Desktop or the MCP Inspector.
Testing with MCP Inspector
You can test the server using the MCP Inspector, a web-based tool for debugging MCP servers:
- Run the MCP Inspector:
npx @modelcontextprotocol/inspector
-
In the inspector interface:
- Click "Add Server"
- Choose "Command" as the transport
- Set the command to:
uv run neo4j-mcp-ecommerce - Set the working directory to:
/path/to/your/python/directory - Click "Connect"
-
Once connected, you can:
- View available tools (
search_customerandrecommend_product) - Test tool calls with sample parameters
- Inspect responses and debug any issues
- View available tools (
The inspector provides a convenient way to test your MCP server without needing a full MCP client setup.
Tools
search_customer
- Input:
q— substring to match name or email (case-insensitive) - Output: list of customer maps:
{ id, nodeId, name, email }
recommend_product
- Input:
customer_id— your domain identifier on:Customer {id: ...} - Input:
limit— max recommendations (default 5) - Output: list of
{ productId, title, score }
Notes
- Credentials are read from environment variables (dotenv is supported for local dev).
- Cypher assumes labels/properties:
:Customer {id, name, email}and:Product {id, title}with relationships approximating PURCHASED/CONTAINS/PRODUCT. Adjust queries to match your schema if different.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d4236da5fb097a6dd29b0ea3c67bf83de1398946ab59bc026da8d77a184b219
|
|
| MD5 |
afdf607de32195f311873d4b7cd259d2
|
|
| BLAKE2b-256 |
b59ff52e9efa806b056e081f1dd4ac98e3104c01846e3fc2a25a38f6779f5224
|
File details
Details for the file iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
599a06625b84131505b1cdfb4164c45e9cda6cbb0b6ac7201bf5fd25edb98a42
|
|
| MD5 |
f75e47f960953361b66e88315709524f
|
|
| BLAKE2b-256 |
9eb1cc77fb0fae8f2f1c45e4f97407ff8a799cfea259ae0afa6c7c1213720169
|