Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2db6776
Update dependencies, refactor server implementation, and add Redis se…
SecKatie Jul 25, 2025
7633849
Streamline to MCP-only architecture and enhance documentation
SecKatie Jul 27, 2025
96d702c
Fix module resolution and logging issues for ES modules
SecKatie Jul 28, 2025
32ab939
Enhance configuration, documentation, and CI/CD workflow
SecKatie Jul 28, 2025
02bce89
Add environment configuration for release workflow in GitHub Actions
SecKatie Jul 28, 2025
4f32b8c
Remove broken snyk test
SecKatie Jul 28, 2025
80267dc
ci: fix broken publish rule
SecKatie Jul 28, 2025
60778b4
chore: update version and enhance README with npm usage instructions
SecKatie Jul 28, 2025
9a3b4c2
Update src/mcp/prompts.ts
SecKatie Jul 28, 2025
98d560f
Merge pull request #1 from SecKatie/develop
SecKatie Jul 28, 2025
5206d09
feat: add read-only query support for replica instances
singhtanmay6735 Jan 28, 2026
ea60278
Merge pull request #2 from singhtanmay6735/feature/read-only-support
SecKatie Feb 2, 2026
1f99d35
Merge branch 'main' into rebase
gkorland Feb 8, 2026
feb4908
update
gkorland Feb 8, 2026
5a7ee62
Apply suggestion from @Copilot
gkorland Feb 8, 2026
6afbf5d
Potential fix for code scanning alert no. 10: Workflow does not conta…
gkorland Feb 8, 2026
387a664
Initial plan
Claude Feb 8, 2026
8616f19
Address PR review comments: fix concurrent init, improve error handli…
Claude Feb 8, 2026
b803fcf
Merge pull request #15 from FalkorDB/claude/sub-pr-14
gkorland Feb 8, 2026
5d7f215
Update .github/workflows/node.yml
gkorland Feb 8, 2026
acfbfb6
Update .env.example
gkorland Feb 8, 2026
4e02729
Update CONTRIBUTING.md
gkorland Feb 8, 2026
22f6095
Update CLAUDE.md
gkorland Feb 8, 2026
42473fc
Initial plan
Claude Feb 9, 2026
8b5185a
Address PR review comments: sanitize query logging, fix MCP level map…
Claude Feb 9, 2026
a2e403a
Merge pull request #16 from FalkorDB/claude/sub-pr-14
gkorland Feb 9, 2026
f7f154d
Update node.yml
gkorland Feb 12, 2026
f924c66
Update falkordb.service.ts
gkorland Feb 12, 2026
7d837bf
Initialize retryCount before initializing promise
gkorland Feb 12, 2026
bf0bbe3
update lock
gkorland Feb 15, 2026
7b95314
fix: suppress TS2589 deep type instantiation error in registerTool
gkorland Feb 23, 2026
a1f4111
fix: address security and reliability issues from code review
gkorland Feb 23, 2026
5d4d539
fix: improve FalkorDB service reliability and logging
gkorland Feb 23, 2026
80e1204
fix: address PR review findings from copilot reviewer
gkorland Feb 23, 2026
f50c816
feat: add Streamable HTTP transport support
gkorland Feb 23, 2026
09f4691
fix: improve Redis service reliability and fix review findings
gkorland Feb 23, 2026
beef955
docs: add HTTP transport testing instructions to README
gkorland Feb 23, 2026
1c674df
docs: add API key authentication usage to README
gkorland Feb 23, 2026
d238e32
feat: add Docker support for HTTP transport
gkorland Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Streamline to MCP-only architecture and enhance documentation
- Remove legacy HTTP API components (controllers, routes, middleware)
- Clean up Express dependencies from package.json
- Simplify graph_list resource to return markdown format
- Add comprehensive CLAUDE.md for development guidance
- Modernize README with enhanced setup instructions and examples
- Focus entirely on MCP server functionality via stdio transport

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
SecKatie and claude committed Jul 27, 2025
commit 7633849410e201b171d0bb5a3c1ff4485e2a9fed
100 changes: 100 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Development Commands

- **Build**: `npm run build` - Compiles TypeScript to JavaScript in `dist/`
- **Dev server**: `npm run dev` - Starts development server with hot-reloading using nodemon
- **Production start**: `npm start` - Runs the built application from `dist/index.js`
- **Lint**: `npm run lint` - Runs ESLint on TypeScript files
- **Test**: `npm test` - Runs Jest test suite
- **Test with coverage**: `npm test:coverage` - Runs tests with coverage report
Comment thread
gkorland marked this conversation as resolved.
Outdated

## Project Architecture

This is a Model Context Protocol (MCP) server that enables AI models to interact with FalkorDB graph databases through natural language. The server communicates via stdio transport and provides tools for graph operations.

### MCP Server Implementation
- **Entry point**: `src/index.ts` - Creates MCP server using `@modelcontextprotocol/sdk`
- **Communication**: Uses stdio transport for MCP protocol (not HTTP)
- **MCP Tools registered**:
- `query_graph` - Execute OpenCypher queries on specific graphs
- `list_graphs` - List all available graphs in the database
- `delete_graph` - Delete specific graphs
- `set_key`/`get_key` - Redis key-value operations for data storage
- **MCP Resources**: `graph_list` resource provides markdown-formatted graph listings

### Core Services
- **FalkorDB Service** (`src/services/falkordb.service.ts`):
- Singleton service managing FalkorDB connections
- Uses `falkordb` npm package
- Handles connection retries and pooling
- Main operations: `executeQuery()`, `listGraphs()`, `deleteGraph()`

- **Redis Service** (`src/services/redis.service.ts`):
- Manages Redis operations for key-value storage
- Used alongside graph operations

### Configuration
- **Config system** (`src/config/index.ts`): Centralized configuration using dotenv
- **Environment variables**: Defined in `.env` file (copy from `.env.example`)
- **Key variables**: `FALKORDB_HOST`, `FALKORDB_PORT`, `FALKORDB_USERNAME`, `FALKORDB_PASSWORD`

### Current Project Structure
```
src/
├── index.ts # MCP server entry point with tool/resource registration
├── services/
│ ├── falkordb.service.ts # FalkorDB connection and graph operations
│ └── redis.service.ts # Redis key-value operations
├── config/
│ └── index.ts # Centralized configuration using dotenv
├── models/ # TypeScript type definitions
│ ├── mcp.types.ts # MCP protocol interfaces
│ └── mcp-client-config.ts # Configuration models
└── utils/
└── connection-parser.ts # Utility functions
```

## Testing
- **Framework**: Jest with ts-jest preset
- **Test files**: Located alongside source files with `.test.ts` extension
- **Coverage**: Configured to exclude test files and type definitions
- **Test environment**: Node.js environment

## Key Dependencies
- `@modelcontextprotocol/sdk` - MCP protocol implementation
- `falkordb` - FalkorDB Node.js client
- `zod` - Schema validation for MCP tools

## MCP Integration Setup

### Claude Desktop Configuration
To use this server with Claude Desktop, add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"falkordb": {
"command": "node",
"args": ["/absolute/path/to/falkordb-mcpserver/dist/index.js"]
}
}
}
```

### Environment Configuration
Required environment variables in `.env`:
- `FALKORDB_HOST` - FalkorDB hostname (default: localhost)
- `FALKORDB_PORT` - FalkorDB port (default: 6379)
- `FALKORDB_USERNAME` - Optional authentication
- `FALKORDB_PASSWORD` - Optional authentication
- `REDIS_URL` - Redis connection for key-value operations

## Development Notes
- Uses ES modules (`"type": "module"` in package.json)
- TypeScript configuration in `tsconfig.json`
- Nodemon watches `src/**/*.ts` for development hot-reload
- **Important**: This is an MCP server, not a web server - it communicates via stdio transport
- Build output in `dist/` directory is executed by MCP clients
- The server automatically closes FalkorDB and Redis connections on exit
238 changes: 175 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,230 @@
# FalkorDB MCP Server

A Model Context Protocol (MCP) server for FalkorDB, allowing AI models to query and interact with graph databases.
> 🚀 **Connect AI models to FalkorDB graph databases through the Model Context Protocol**

## Overview
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)

This project implements a server that follows the Model Context Protocol (MCP) specification to connect AI models with FalkorDB graph databases. The server translates and routes MCP requests to FalkorDB and formats the responses according to the MCP standard.
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.

## Prerequisites
## 🎯 What is this?

* Node.js (v16 or later)
* npm or yarn
* FalkorDB instance (can be run locally or remotely)
This server implements the [Model Context Protocol (MCP)](https://modelcontextprotocol.io), allowing AI models to:
- **Query graph databases** using OpenCypher
- **Create and manage** nodes and relationships
- **Store and retrieve** key-value data
- **List and explore** multiple graphs
- **Delete graphs** when needed

## Installation
## 🚀 Quick Start

1. Clone this repository:
### Prerequisites

- Node.js 16+
Comment thread
gkorland marked this conversation as resolved.
Outdated
- FalkorDB instance (running locally or remotely)
- Claude Desktop app (for AI integration)

### Installation

1. **Clone and install:**
```bash
git clone https://github.com/falkordb/falkordb-mcpserver.git
cd falkordb-mcpserver
npm install
```
2. Install dependencies:

2. **Configure environment:**
```bash
npm install
cp .env.example .env
```

Edit `.env`:
```env
# FalkorDB Connection
FALKORDB_HOST=localhost
FALKORDB_PORT=6379
FALKORDB_USERNAME= # Optional
FALKORDB_PASSWORD= # Optional

# Redis Connection (for key-value storage)
REDIS_URL=redis://localhost:6379
REDIS_USERNAME= # Optional
REDIS_PASSWORD= # Optional
```
3. Copy the example environment file and configure it:

3. **Build the project:**
```bash
cp .env.example .env
npm run build
```

Edit `.env` with your configuration details.
## 🤖 Claude Desktop Integration

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

Configuration is managed through environment variables in the `.env` file:
```json
{
"mcpServers": {
"falkordb": {
"command": "node",
"args": [
"/absolute/path/to/falkordb-mcpserver/dist/index.js"
]
}
}
}
```

* `PORT`: Server port (default: 3000)
* `NODE_ENV`: Environment (development, production)
* `FALKORDB_HOST`: FalkorDB host (default: localhost)
* `FALKORDB_PORT`: FalkorDB port (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
Restart Claude Desktop and you'll see the FalkorDB tools available!

## Usage
## 📚 Available MCP Tools

### Development
Once connected, you can ask Claude to:

Start the development server with hot-reloading:
### 🔍 Query Graphs
```
"Show me all people who know each other"
"Find the shortest path between two nodes"
"What relationships does John have?"
```

```bash
npm run dev
### 📝 Manage Data
```
"Create a new person named Alice who knows Bob"
"Add a 'WORKS_AT' relationship between Alice and TechCorp"
"Store my API key in the database"
```

### Production
### 📊 Explore Structure
```
"List all available graphs"
"Show me the structure of the user_data graph"
"Delete the old_test graph"
```

Build and start the server:
## 🛠️ Development

### Commands

```bash
# Development with hot-reload
npm run dev

# Run tests
npm test

# Lint code
npm run lint

# Build for production
npm run build

# Start production server
npm start
```

## API Endpoints
### Project Structure

```
src/
├── index.ts # MCP server entry point
├── services/
│ ├── falkordb.service.ts # FalkorDB operations
│ └── redis.service.ts # Key-value operations
├── config/
│ └── index.ts # Configuration management
├── models/ # TypeScript type definitions
└── utils/ # Utility functions
```

## 🔧 Advanced Configuration

### Using with Remote FalkorDB

For cloud-hosted FalkorDB instances:

* `GET /api/mcp/metadata`: Get metadata about the FalkorDB instance and available capabilities
* `POST /api/mcp/context`: Execute queries against FalkorDB
* `GET /api/mcp/health`: Check server health
* `GET /api/mcp/graphs`: Returns the list of Graphs
*
```env
FALKORDB_HOST=your-instance.falkordb.com
FALKORDB_PORT=6379
FALKORDB_USERNAME=your-username
FALKORDB_PASSWORD=your-secure-password
```

## MCP Configuration
### Running Multiple Instances

To use this server with MCP clients, you can add it to your MCP configuration:
You can run multiple MCP servers for different FalkorDB instances:

```json
{
"mcpServers": {
"falkordb": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p", "3000:3000",
"--env-file", ".env",
"falkordb-mcpserver",
"falkordb://host.docker.internal:6379"
]
"falkordb-dev": {
"command": "node",
"args": ["path/to/server/dist/index.js"],
"env": {
"FALKORDB_HOST": "dev.falkordb.local"
}
},
"falkordb-prod": {
"command": "node",
"args": ["path/to/server/dist/index.js"],
"env": {
"FALKORDB_HOST": "prod.falkordb.com"
}
}
}
}
```

For client-side configuration:
## 📖 Example Usage

```json
{
"defaultServer": "falkordb",
"servers": {
"falkordb": {
"url": "http://localhost:3000/api/mcp",
"apiKey": "your_api_key_here"
}
}
}
Here's what you can do once connected:

```cypher
// Claude can help you write queries like:
MATCH (p:Person)-[:KNOWS]->(friend:Person)
WHERE p.name = 'Alice'
RETURN friend.name, friend.age

// Or create complex data structures:
CREATE (alice:Person {name: 'Alice', age: 30})
CREATE (bob:Person {name: 'Bob', age: 25})
CREATE (alice)-[:KNOWS {since: 2020}]->(bob)

// And even analyze your graph:
MATCH path = shortestPath((start:Person)-[*]-(end:Person))
WHERE start.name = 'Alice' AND end.name = 'Charlie'
RETURN path
```

## Contributing
## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.

Contributions are welcome! Please feel free to submit a Pull Request.
### Development Workflow

## License
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](LICENSE) file for details.

## 🙏 Acknowledgments

- Built on the [Model Context Protocol SDK](https://github.com/anthropics/model-context-protocol)
- Powered by [FalkorDB](https://www.falkordb.com/)
- Inspired by the growing MCP ecosystem

## 🔗 Resources

- [FalkorDB Documentation](https://docs.falkordb.com)
- [MCP Specification](https://modelcontextprotocol.io/docs)
- [OpenCypher Query Language](https://opencypher.org/)

---

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