Labsco
FalkorDB logo

FalkorDB

β˜… 36

from FalkorDB

Query and interact with FalkorDB graph databases using AI models.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

Tests codecov License Discord X (formerly Twitter) MCP Compatible

FalkorDB MCP Server

Try Free

A Model Context Protocol (MCP) server for FalkorDB, allowing AI models to query and interact with graph databases. FalkorDB MCP Server enables AI assistants like Claude to interact with FalkorDB graph databases using natural language. Query your graph data, create relationships, and manage your knowledge graph - all through conversational AI.

🎯 What is this?

This server implements the Model Context Protocol (MCP), allowing AI models to:

  • Query graph databases using OpenCypher (with read-only mode support)
  • Create and manage nodes and relationships
  • List and explore multiple graphs
  • Delete graphs when needed
  • Read-only queries for replica instances or to prevent accidental writes

πŸ€– Claude Desktop Integration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "falkordb": {
      "command": "node",
      "args": [
        "/absolute/path/to/falkordb-mcpserver/dist/index.js"
      ]
    }
  }
}

Restart Claude Desktop and you'll see the FalkorDB tools available!

πŸ“š Available MCP Tools

Once connected, you can ask Claude to:

πŸ” Query Graphs

"Show me all people who know each other"
"Find the shortest path between two nodes"
"What relationships does John have?"
"Run a read-only query on the replica instance"

Note: The query_graph tool now supports a readOnly parameter to execute queries in read-only mode using GRAPH.RO_QUERY. This is ideal for:

  • Running queries on replica instances
  • Preventing accidental write operations
  • Ensuring data integrity in production environments

There's also a dedicated query_graph_readonly tool that always executes queries in read-only mode.

Parameterized queries: The query_graph and query_graph_readonly tools accept an optional params object so values can be passed separately from the query text (referenced as $name), instead of string-concatenating them into Cypher. This avoids query-injection risks and malformed queries. For example, a query of MATCH (p:Person {name: $name}) RETURN p with params: { "name": "Alice" }. Parameter names (including nested map keys) must be valid identifiers. Note: FalkorDB does not allow parameters in LIMIT/SKIP clauses.

πŸ“ Manage Data

"Create a new person named Alice who knows Bob"
"Add a 'WORKS_AT' relationship between Alice and TechCorp"

πŸ“Š Explore Structure

"List all available graphs"
"Show me the schema of the movies graph"
"What properties do Person nodes usually have in the movies graph?"
"What properties are on ACTED_IN relationships in the movies graph?"
"Delete the old_test graph"

Schema discovery: FalkorDB is schemaless, so three tools help an agent orient itself before querying:

  • get_graph_schema β€” returns node labels, relationship types, and (optionally) the connection topology. Each connection is { source, relationship, target } where source and target are arrays of node labels (a node may have multiple labels) and relationship is the relationship type. Topology is derived from a bounded sample of relationships (connectionSampleSize, default 10000) and can be turned off with includeConnections: false on very large graphs.
  • get_node_schema / get_relationship_schema β€” sample up to sampleSize (default 100) nodes/relationships of a given label/type and rank their property keys by frequency, returning the actual sampledCount alongside requestedSampleSize. Useful for spotting property naming drift.

All three schema tools always execute read-only (GRAPH.RO_QUERY), so they are safe to run against replica/read-only deployments.

A typical orientation workflow is: list_graphs β†’ get_graph_schema β†’ get_node_schema / get_relationship_schema β†’ query_graph.

πŸ› οΈ Development

Commands

# Development with hot-reload
npm run dev

# Development with TypeScript execution (faster startup)
npm run dev:ts

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage report
npm run test:coverage

# Lint code
npm run lint

# Lint and auto-fix issues
npm run lint:fix

# Build for production
npm run build

# Start production server
npm start

# Inspect MCP server with debugging tools
npm run inspect

# Clean build artifacts
npm run clean

# Full CI pipeline (test, lint, build)
npm run prepublish

Project Structure

src/
β”œβ”€β”€ index.ts                   # MCP server entry point
β”œβ”€β”€ services/                  # Core business logic
β”‚   β”œβ”€β”€ falkordb.service.ts   # FalkorDB operations
β”‚   └── logger.service.ts     # Logging and MCP notifications
β”œβ”€β”€ mcp/                      # MCP protocol implementations
β”‚   β”œβ”€β”€ tools.ts             # MCP tool definitions
β”‚   β”œβ”€β”€ resources.ts         # MCP resource definitions
β”‚   └── prompts.ts           # MCP prompt definitions
β”œβ”€β”€ errors/                   # Error handling framework
β”‚   β”œβ”€β”€ AppError.ts          # Custom error classes
β”‚   └── ErrorHandler.ts      # Global error handling
β”œβ”€β”€ config/                   # Configuration management
β”‚   └── index.ts             # Environment configuration
β”œβ”€β”€ models/                   # TypeScript type definitions
β”‚   β”œβ”€β”€ mcp.types.ts         # MCP protocol types
β”‚   └── mcp-client-config.ts # Configuration models
└── utils/                    # Utility functions
    └── connection-parser.ts  # Connection string parsing

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

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

πŸ™ Acknowledgments

πŸ”— Resources


<p align="center"> Made with ❀️ by the FalkorDB team & Katie Mulliken </p>