Skip to main content
Glama
guerinjeanmarc

Neo4j GraphRAG MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
NEO4J_URIYesNeo4j connection URI (default: bolt://localhost:7687)
AZURE_API_KEYNoAzure API key (required if using Azure embedding model)
AZURE_API_BASENoAzure API base URL (required if using Azure embedding model)
COHERE_API_KEYNoCohere API key (required if using Cohere embedding model)
NEO4J_DATABASENoDatabase name (default: neo4j)
NEO4J_PASSWORDYesNeo4j password (default: password)
NEO4J_USERNAMEYesNeo4j username (default: neo4j)
OPENAI_API_KEYNoOpenAI API key (required if using OpenAI embedding model)
EMBEDDING_MODELNoEmbedding model (default: text-embedding-3-small)
AWS_ACCESS_KEY_IDNoAWS access key ID (required if using Bedrock embedding model)
AWS_SECRET_ACCESS_KEYNoAWS secret access key (required if using Bedrock embedding model)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tasks
{
  "list": {},
  "cancel": {},
  "requests": {
    "tools": {
      "call": {}
    },
    "prompts": {
      "get": {}
    },
    "resources": {
      "read": {}
    }
  }
}
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_neo4j_schema_and_indexesA

Returns Neo4j graph schema with search indexes and property size warnings.

IMPORTANT: Call this tool BEFORE using any search tools (vector_search, fulltext_search, search_cypher_query).

This tool provides:

  • Vector & fulltext indexes (for search)

  • Node/relationship schemas with property types

  • Warnings for large properties (helps choose efficient return_properties)

Property size warnings help you avoid token limits when using search tools. For example, if a property has warning "avg ~100-200KB", avoid returning it unless necessary.

You should only provide a sample_size value if requested by the user, or tuning performance.

vector_searchA

Performs vector similarity search on a Neo4j vector index.

This tool embeds your text query using OpenAI and searches the specified vector index. Returns node IDs, labels, node properties (automatically sanitized), and similarity scores.

Automatic Sanitization (always applied):

  • Embedding property used by the vector index → automatically excluded (vector_search only)

  • Large lists (≥128 items) → replaced with placeholders

  • Large strings (≥10K chars) → truncated with suffix

  • Total response limited to 8000 tokens (results dropped if needed)

Property Selection:

  • Default (no return_properties): Returns ALL properties (sanitized)

  • With return_properties: Returns ONLY specified properties

  • Example: return_properties="pageNumber,id" → returns only these two

  • Check get_neo4j_schema_and_indexes for property warnings to avoid large fields

Post-Filtering:

  • Use pre_filter to filter results by exact property match after vector scoring (e.g., {"documentName": "foo.pdf"})

  • Check get_neo4j_schema_and_indexes for available node properties to filter on

Performance Optimization: Internally fetches max(top_k × 2, 100) results to avoid local maximum problems in kANN algorithms.

fulltext_searchA

Performs fulltext search on a Neo4j fulltext index using Lucene query syntax.

Lucene Syntax Supported:

  • Boolean: "legal AND compliance", "privacy OR security"

  • Wildcards: "compli*", "te?t"

  • Fuzzy: "complience~"

  • Phrases: ""exact phrase""

Automatic Sanitization (always applied):

  • Large lists (≥128 items) → replaced with placeholders

  • Large strings (≥10K chars) → truncated with suffix

  • Total response limited to 8000 tokens (results dropped if needed)

Property Selection:

  • Default (no return_properties): Returns ALL properties (sanitized)

  • With return_properties: Returns ONLY specified properties

  • Example: return_properties="pageNumber,id" → returns only these two

  • Check get_neo4j_schema_and_indexes for property warnings to avoid large fields

Returns node/relationship IDs, labels/types, properties (sanitized), and relevance scores.

read_neo4j_cypherB

Execute a read Cypher query on the Neo4j database.

write_neo4j_cypherA

Execute a write Cypher query on the Neo4j database and return the result summary (counters).

search_cypher_queryA

Execute a Cypher query that uses vector and/or fulltext search indexes.

This powerful tool allows you to:

  1. Use vector search ($vector_embedding) and/or fulltext search ($fulltext_text) in Cypher

  2. Post-filter large result sets (fetch 100-1000, filter with WHERE)

  3. Combine search with graph traversal

  4. Aggregate over search results

Example:

search_cypher_query(
    cypher_query='''
        CALL db.index.vector.queryNodes('chunk_embedding_vector', 500, $vector_embedding)
        YIELD node, score
        WHERE score > 0.75
        MATCH (node)-[:BELONGS_TO]->(d:Document)
        WHERE d.year >= 2020
        RETURN node.chunkId, d.title, score
        ORDER BY score DESC
        LIMIT 20
    ''',
    vector_query="student requirements"
)

Placeholders:

  • $vector_embedding: Replaced with embedding vector

  • $fulltext_text: Replaced with text string for fulltext

read_node_imageA

Retrieve a base64 image stored on a Neo4j node, plus selected text properties.

Returns a mixed ToolResult with TextContent (node properties) and ImageContent (the image). The image property itself is excluded from the text content to avoid duplication.

Usage:

  • node_element_id: get from vector_search/fulltext_search/read_neo4j_cypher (nodeId field)

  • image_property: property storing the base64 image (default: "imageBase64")

  • mime_type: override detected MIME type (default: read from node's imageMimeType, else "image/png")

  • return_properties: comma-separated list of properties to include in text response

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/guerinjeanmarc/mcp-neo4j-graphrag'

If you have feedback or need assistance with the MCP directory API, please join our Discord server