DiceDB MCP

by pottekkat
Verified
MIT License
2
  • Linux
  • Apple

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows OpenAI Agents to interact with DiceDB databases through tools for basic database operations including ping, echo, get, set, delete, increment, and decrement functions.

DiceDB MCP

DiceDB 的模型上下文协议 (MCP)服务器实现,以实现 AI 应用程序(主机/客户端)和 DiceDB 数据库服务器之间的交互。

此实现使用DiceDB Go SDK与 DiceDB 通信。

观看演示视频来了解其实际效果!

特征

  • PING DiceDB 来检查连接性。
  • 通过 DiceDB 回显一条消息。
  • 按键从 DiceDB 获取值。
  • 在 DiceDB 中设置一个键值对。
  • 从 DiceDB 中删除一个或多个键。
  • 将键的整数值增加一。
  • 将键的整数值减一。

安装

下载二进制文件

您可以从“发布”页面下载并使用适合您的操作系统和处理器架构的二进制文件。

通过 Go 安装

先决条件:

  • Go 1.24 或更高版本
go install github.com/pottekkat/dicedb-mcp@latest

获取dicedb-mcp二进制文件的路径:

which dicedb-mcp

从源代码构建

请参阅下面的开发部分。

用法

使用 MCP 主机/客户端

将其添加到 Claude Desktop 的claude_desktop_config.json或 Cursor 的mcp.json中:

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

使用 OpenAI Agents SDK

下面的示例展示了如何将dicedb-mcp服务器与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())

可用工具

ping

对 DiceDB 服务器执行 ping 操作以检查连接性。

回声

通过 DiceDB 服务器回显消息。

得到

按键从 DiceDB 中检索值。

在 DiceDB 中设置键值对。

删除

从 DiceDB 中删除一个或多个键。

增加

将键的整数值增加一。

降级

将键的整数值减一。

发展

分叉并克隆存储库:

git clone https://github.com/username/dicedb-mcp.git

进入目录:

cd dicedb-mcp

安装依赖项:

make deps

构建项目:

make build

更新您的 MCP 服务器配置以指向本地构建:

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

执照

MIT 许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

一个 MCP 服务器,使 AI 应用程序能够与 DiceDB 数据库交互。

  1. Features
    1. Installation
      1. Download Binary
      2. Install via Go
      3. Build from Source
    2. Usage
      1. With MCP Hosts/Clients
      2. With OpenAI Agents SDK
    3. Available Tools
      1. ping
      2. echo
      3. get
      4. set
      5. del
      6. incr
      7. decr
    4. Development
      1. License
        ID: 07j6uouk0r