DiceDB MCP server

Enables AI applications to interact with DiceDB database servers for key-value operations without requiring direct database credentials or connection management
Back to servers
Provider
Navendu Pottekkat
Release date
Apr 09, 2025
Language
Go
Stats
5 stars

The DiceDB MCP server implements the Model Context Protocol (MCP) to enable interactions between AI applications and DiceDB database servers. It provides a bridge for AI systems to perform database operations on DiceDB using the DiceDB Go SDK for communication.

Installation Options

Download Binary

You can download the appropriate binary for your operating system and processor architecture from the Releases page.

Install via Go

Prerequisites:

  • Go 1.24 or higher
go install github.com/pottekkat/dicedb-mcp@latest

Get the path to the dicedb-mcp binary:

which dicedb-mcp

Usage

Configuring with MCP Hosts/Clients

Add this to your claude_desktop_config.json for Claude Desktop or mcp.json for Cursor:

{
    "mcpServers": {
        "dicedb-mcp": {
            "command": "path/to/dicedb-mcp"
        }
    }
}

Using with OpenAI Agents SDK

Here's how to use the dicedb-mcp server with the OpenAI Agents SDK:

from agents import Agent, Runner, trace
from agents.mcp import MCPServer, MCPServerStdio
from dotenv import load_dotenv
import os
import openai
import asyncio

load_dotenv()


async def run(mcp_server: MCPServer, prompt: str, server_url: str):
    agent = Agent(name="DiceDB MCP",
                  instructions=f"""You can interact with a DiceDB database
                                  running at {server_url}, use
                                  this for url.""",
                  mcp_servers=[mcp_server],)
    result = await Runner.run(starting_agent=agent, input=prompt)
    print(result.final_output)


async def main():
    openai.api_key = os.getenv("OPENAI_API_KEY")

    prompt = "Can you change the value of the 'name' key to 'Rachel Green'?"
    server_url = "localhost:7379"

    async with MCPServerStdio(
        cache_tools_list=True,
        params={"command": "path/to/dicedb-mcp", "args": [""]},
    ) as server:
        with trace(workflow_name="DiceDB MCP"):
            await run(server, prompt, server_url)


if __name__ == "__main__":
    asyncio.run(main())

Available Tools

ping

Pings a DiceDB server to check connectivity.

echo

Echoes a message through the DiceDB server.

get

Retrieves a value from DiceDB by key.

set

Sets a key-value pair in DiceDB.

del

Deletes one or more keys from DiceDB.

incr

Increments the integer value of a key by one.

decr

Decrements the integer value of a key by one.

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