Skip to main content

Neo4j MCP Ecommerce Server (Python)

An MCP server that exposes two tools backed by Neo4j:

  • search_customer(q: str) — search customers by name or email
  • recommend_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

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_USERNAME
  • NEO4J_PASSWORD
  • NEO4J_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:

  1. Run the MCP Inspector:
npx @modelcontextprotocol/inspector
  1. 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"
  2. Once connected, you can:

    • View available tools (search_customer and recommend_product)
    • Test tool calls with sample parameters
    • Inspect responses and debug any issues

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.

Metadata

Release files for iflow-mcp_johnymontana-neo4j-mcp-ecommerce 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_johnymontana-neo4j-mcp-ecommerce 0.1.0
File Size Uploaded
iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0.tar.gz 36.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_johnymontana-neo4j-mcp-ecommerce 0.1.0
File Interpreter ABI Platform
iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.8 kB

Release files / iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0.tar.gz

Download URL iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4d4236da5fb097a6dd29b0ea3c67bf83de1398946ab59bc026da8d77a184b219
BLAKE2b-256 checksum
How to use checksums
b59ff52e9efa806b056e081f1dd4ac98e3104c01846e3fc2a25a38f6779f5224
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0-py3-none-any.whl

Download URL iflow_mcp_johnymontana_neo4j_mcp_ecommerce-0.1.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
599a06625b84131505b1cdfb4164c45e9cda6cbb0b6ac7201bf5fd25edb98a42
BLAKE2b-256 checksum
How to use checksums
9eb1cc77fb0fae8f2f1c45e4f97407ff8a799cfea259ae0afa6c7c1213720169
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page