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.
Before installing the FalkorDB MCP Server, ensure you have:
Follow these steps to install the FalkorDB MCP Server:
Clone the repository:
git clone https://github.com/falkordb/falkordb-mcpserver.git
cd falkordb-mcpserver
Install dependencies:
npm install
Set up the configuration:
cp .env.example .env
Edit the .env
file with your specific configuration details.
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 requestsTo start the server with hot-reloading for development:
npm run dev
For production deployment, build and start the server:
npm run build
npm start
The MCP server exposes these endpoints:
GET /api/mcp/metadata
: Retrieves metadata about the FalkorDB instance and its capabilitiesPOST /api/mcp/context
: Executes queries against the FalkorDB instanceGET /api/mcp/health
: Checks server health statusGET /api/mcp/graphs
: Returns a list of available graphsTo 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"
]
}
}
}
Configure MCP clients to connect to your server:
{
"defaultServer": "falkordb",
"servers": {
"falkordb": {
"url": "http://localhost:3000/api/mcp",
"apiKey": "your_api_key_here"
}
}
}
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"
}
]
}
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.
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"
]
}
}
}
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.
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.