FalkorDB MCP server

Enables natural language querying of graph databases by translating requests into FalkorDB queries for analyzing relationships in knowledge graphs, recommendation systems, and network data.
Back to servers
Provider
FalkorDB
Release date
Mar 26, 2025
Language
TypeScript
Stats
8 stars

FalkorDB MCP Server is an implementation of the Model Context Protocol that enables AI models to query and interact with FalkorDB graph databases. It acts as a bridge between AI models and graph databases by translating MCP requests into FalkorDB queries and formatting responses according to the MCP standard.

Prerequisites

Before installing the FalkorDB MCP Server, ensure you have:

  • Node.js (v16 or later)
  • npm or yarn
  • Access to a FalkorDB instance (local or remote)

Installation

Follow these steps to install the FalkorDB MCP Server:

  1. Clone the repository:

    git clone https://github.com/falkordb/falkordb-mcpserver.git
    cd falkordb-mcpserver
    
  2. Install dependencies:

    npm install
    
  3. Set up the configuration:

    cp .env.example .env
    
  4. Edit the .env file with your specific configuration details.

Configuration Options

Configure the server by setting these environment variables in your .env file:

  • PORT: The port on which the server will run (default: 3000)
  • NODE_ENV: Environment setting (development, production)
  • FALKORDB_HOST: Host address of your FalkorDB instance (default: localhost)
  • FALKORDB_PORT: Port of your FalkorDB instance (default: 6379)
  • FALKORDB_USERNAME: Username for FalkorDB authentication (if required)
  • FALKORDB_PASSWORD: Password for FalkorDB authentication (if required)
  • MCP_API_KEY: API key for authenticating MCP requests

Running the Server

Development Mode

To start the server with hot-reloading for development:

npm run dev

Production Mode

For production deployment, build and start the server:

npm run build
npm start

API Endpoints

The MCP server exposes these endpoints:

  • GET /api/mcp/metadata: Retrieves metadata about the FalkorDB instance and its capabilities
  • POST /api/mcp/context: Executes queries against the FalkorDB instance
  • GET /api/mcp/health: Checks server health status
  • GET /api/mcp/graphs: Returns a list of available graphs

Integrating with MCP Clients

Server Configuration

To use this server with MCP clients, add it to your MCP configuration:

{
  "mcpServers": {
    "falkordb": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-p", "3000:3000",
        "--env-file", ".env",
        "falkordb-mcpserver",
        "falkordb://host.docker.internal:6379"
      ]
    }
  }
}

Client Configuration

Configure MCP clients to connect to your server:

{
  "defaultServer": "falkordb",
  "servers": {
    "falkordb": {
      "url": "http://localhost:3000/api/mcp",
      "apiKey": "your_api_key_here"
    }
  }
}

Sending Queries

To query your graph database through the MCP server, send POST requests to the /api/mcp/context endpoint with your query parameters. The server will translate these into appropriate FalkorDB queries and return the results in the MCP-compliant format.

Example of a basic context request:

{
  "query": "Find all people who live in New York",
  "contextList": [
    {
      "id": "graph-query",
      "source": "falkordb"
    }
  ]
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later