Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/neo4j-labs/neocarta/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you from a fresh Python environment to a running Neocarta MCP server backed by a real semantic graph. You will install the library, point it at a Neo4j instance, ingest the bundled CSV e-commerce sample dataset (no cloud account required), optionally generate embeddings, and start the MCP server. At the end you will be able to run neocarta tool list-schemas and see your data’s schema returned as structured JSON.
The Neo4j AuraDB free tier gives you a managed Neo4j instance at no cost. It is the fastest way to get a NEO4J_URI without running anything locally.
1

Install Neocarta

Install the core library. Add the [cli] extra to get the neocarta command-line tool, which you will use to query the graph in step 6.
# Core library only
pip install neocarta

# Core + CLI
pip install "neocarta[cli]"
Neocarta requires Python 3.10 or higher.
2

Set up Neo4j and create your .env file

Neocarta reads connection details from environment variables. Create a .env file in your project root — it is loaded automatically by python-dotenv at runtime.
Create the .env file at the root of your project directory. Neocarta’s CLI and Python connectors both call load_dotenv() on startup, so the file is picked up without any extra configuration.
.env
# Neo4j connection
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password
NEO4J_DATABASE=neo4j
If you are using Neo4j AuraDB, your URI will look like neo4j+s://xxxxxxxx.databases.neo4j.io. You can find it on the AuraDB console after creating a free instance.If you prefer to run Neo4j locally with Docker:
docker run \
  -p 7474:7474 -p 7687:7687 \
  -e NEO4J_AUTH=neo4j/your-password \
  neo4j:latest
3

Ingest your first dataset

The repository ships a complete e-commerce sample dataset in datasets/csv/ — four tables (orders, customers, products, order_items) with columns, foreign keys, sample values, and query history — so you can try Neocarta without a cloud account.
neocarta csv ingest --csv-directory datasets/csv
To ingest from BigQuery instead, run:
neocarta bigquery schema --project-id my-gcp-project --dataset-id my_dataset
4

Generate embeddings (optional)

Embeddings are not required for the catalog and full-text tools, but they unlock semantic similarity search — the most powerful retrieval mode. Add your OpenAI key (or any LiteLLM-supported provider) to .env first:
.env
OPENAI_API_KEY=sk-...
EMBEDDING_MODEL=text-embedding-3-small
Then generate embeddings:
# Re-run ingest with --embeddings to generate them in one pass (BigQuery example)
neocarta bigquery schema \
  --project-id my-gcp-project \
  --dataset-id my_dataset \
  --embeddings
The MCP server auto-detects at startup which indexes are present and registers the highest-fidelity retrieval tool available for each node type: business-term-bridged hybrid → hybrid → vector or full-text → catalog only.
5

Start the MCP server

Install the [mcp] extra and start the server. It reads the same NEO4J_* variables from your .env file.
pip install "neocarta[mcp]"

# Start the MCP server (stdio transport, compatible with Claude Desktop and MCP clients)
neocarta-mcp

# Or, if you have both [cli] and [mcp] installed, use the unified CLI:
neocarta mcp serve
To connect the server to Claude Desktop, add the following to your claude_desktop_config.json:
{
  "mcpServers": {
    "neocarta": {
      "command": "uvx",
      "args": ["--from", "neocarta[mcp]", "neocarta-mcp"],
      "env": {
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_USERNAME": "neo4j",
        "NEO4J_PASSWORD": "your-password",
        "NEO4J_DATABASE": "neo4j",
        "OPENAI_API_KEY": "sk-...",
        "EMBEDDING_MODEL": "text-embedding-3-small"
      }
    }
  }
}
6

Query the graph

With the CLI installed you can run the MCP tools directly from the shell — useful for verifying the graph before wiring up an agent.
# List all schemas and their databases
neocarta tool list-schemas --json

# List tables in a specific schema
neocarta tool list-tables-by-schema --schema-name ecommerce --json

# Semantic search across table descriptions (requires embeddings)
neocarta tool get-context-by-table-vector-search \
  --text-content "customer purchase history" \
  --max-tables 5 \
  --json

# Hybrid search (vector + full-text, no embeddings required for full-text path)
neocarta tool get-context-by-table-hybrid-search \
  --text-content "orders and customers" \
  --json
A successful list-schemas call returns something like:
[
  {
    "database": "ecommerce_db",
    "schema": "ecommerce",
    "table_count": 4
  }
]
Your semantic graph is live. Connect any MCP-compatible agent framework (LangGraph, Claude Desktop, LlamaIndex, etc.) to neocarta-mcp plus a query-execution tool for your database and the agent can discover tables, follow foreign keys, and generate accurate SQL.

Build docs developers (and LLMs) love