Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Combines Neo4j graph database with vector search using OpenAI embeddings for intelligent semantic search across knowledge graphs.

README.md

🔍 MCP Server - Vector Search

![Python](https://python.org) ![Neo4j](https://neo4j.com) ![FastMCP](https://github.com/jlowin/fastmcp) ![uv](https://github.com/astral-sh/uv) ![License](LICENSE)

A blazing-fast Model Context Protocol (MCP) Server built with FastMCP that seamlessly combines Neo4j's graph database capabilities with advanced vector search using embeddings. This server enables intelligent semantic search across your knowledge graph, allowing you to discover contextually relevant information through natural language queries with lightning speed.

🏗️ Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MCP Client    │◄──►│   Vector Search  │◄──►│      Neo4j      │
│   (Claude AI)   │    │      Server      │    │     Database    │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                                │
                                ▼
                       ┌──────────────────┐
                       │    Embeddings    │
                       └──────────────────┘

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • uv
  • Neo4j Database (v5.0+) with APOC plugin
  • OpenAI API Key

Installation with uv

  1. Install uv (if not already installed)
   # On macOS and Linux
   curl -LsSf https://astral.sh/uv/install.sh | sh
   
   # On Windows
   powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Clone and setup the project
   git clone https://github.com/omarguzmanm/mcp-server-vector-search.git
   cd mcp-server-vector-search
   
   # Create virtual environment and install dependencies
   uv venv
   uv pip install fastmcp neo4j openai python-dotenv sentence-transformers pydantic
  1. Environment Configuration
   # Create .env file
   cp .env.example .env

Edit .env with your configurations: ``env NEO4J_URI=bolt://localhost:7687 NEO4J_USERNAME=neo4j NEO4J_PASSWORD=your_neo4j_password NEO4J_DATABASE=neo4j OPENAI_API_KEY=your_openai_api_key ``

  1. Launch the Server
   # Activate virtual environment
   source .venv/bin/activate  # On Linux/macOS
   # or
   .venv\Scripts\activate     # On Windows
   
   # Start the FastMCP server in development mode
   mcp dev server.py

🛠️ Tool

The server exposes a single, powerful tool optimized for vector search:

🔍 Vector Search

vector_search_neo4j(
    prompt="Find documents about machine learning and neural networks"
)

What it does:

  • Converts your natural language query into a 1536-dimensional vector using OpenAI
  • Searches your Neo4j vector index for the most semantically similar nodes
  • Returns ranked results with similarity scores

⚙️ Configuration

Environment Variables

| Variable | Description | Required | Default | |----------|-------------|----------|---------| | NEO4J_URI | Neo4j connection URI | ✅ | bolt://localhost:7687 | | NEO4J_USERNAME | Neo4j username | ✅ | neo4j | | NEO4J_PASSWORD | Neo4j password | ✅ | password | | NEO4J_DATABASE | Neo4j database name | ✅ | neo4j | | OPENAI_API_KEY | OpenAI API key | ✅ | text-embedding-small |

Neo4j Requirements

  1. APOC Plugin: Essential for advanced graph operations
  2. Vector Index: Must support 1536 dimensions for OpenAI embeddings
  3. Node Structure: Nodes should have embedding properties as vectors

Performance Optimization

  • uv Benefits: 10-100x faster dependency resolution compared to pip
  • FastMCP Advantages: Minimal overhead, optimized for MCP protocol
  • Connection Pooling: Automatic Neo4j connection management
  • Async Operations: Non-blocking I/O for maximum throughput

🤝 Integration with Claude Desktop

MCP Configuration

Add to your Claude Desktop MCP settings:

{
  "mcpServers": {
      "mcp-neo4j-vector-search": {
      "command": "python",
      "args": [
        "you\\server.py",
        "--with",
        "mcp[cli]",
        "--with",
        "neo4j",
        "--with",
        "pydantic"
      ],
      "env": {
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_USERNAME": "neo4j",
        "NEO4J_PASSWORD": "your_password",
        "NEO4J_DATABASE": "neo4j",
        "OPENAI_API_KEY": "your_api_key"
      }
    }
  }
}

🐛 Troubleshooting

Common Issues

  1. "Module not found" errors
   # Reinstall dependencies with uv
   uv pip install --force-reinstall fastmcp neo4j openai
  1. "Vector index not found"
   // Check existing indexes
   SHOW INDEXES
   
   // Create if missing
   CREATE VECTOR INDEX descriptionIndex FOR (n:Label) ON (n.embedding)
   OPTIONS {indexConfig: {`vector.dimensions`: 1536, `vector.similarity_function`: 'cosine'}}
  1. OpenAI API errors
   # Verify API key
   uv run python -c "
   import os
   from openai import OpenAI
   client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))
   print('API key is valid!' if client.api_key else 'API key missing!')
   "

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Install development dependencies: uv pip install -e ".[dev]"
  4. Make your changes and add tests
  5. Commit: git commit -m 'Add amazing feature'
  6. Push: git push origin feature/amazing-feature
  7. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • FastMCP - For the incredible MCP framework
  • uv - For blazing-fast Python package management
  • Neo4j - For powerful graph database capabilities
  • OpenAI - For state-of-the-art embedding models
  • Model Context Protocol - For the protocol specification

---

<div align="center"> <p>🚀 Made with ❤️ for the AI and Graph Database community</p> <p> <a href="#-mcp-server---vector-search">⬆️ Back to Top</a> </p> </div>

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Databases servers.