DenoKV MCP Server

by joshuayoes

292 downloads
Not rated
GitHub

About

An MCP Server for chatting with Deno KV instances

Details

Author
joshuayoes
Downloads
292
Categories
Other

- Set key-value pairs with optional TTL (expireIn).
- Get values with strong or eventual consistency.
- Delete key-value pairs.
- Get multiple values at once.
- List key-value pairs by prefix, range, and limit.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name DenoKV MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure your MCP client with the command and environment variables. Use the published JSR package (@joshuayoes/deno-kv-mcp) with Deno (recommended) or Node (≥v22.7.0). Set DENO_KV_PATH to a local file path or remote connection URL, and DENO_KV_ACCESS_TOKEN only for remote databases. Example for Deno: deno run --unstable-kv --allow-env --allow-net --allow-read --allow-write --allow-run jsr:@joshuayoes/deno-kv-mcp.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "denokv mcp server": {
            "denokv": {
                "command": "deno",
                "args": [
                    "run",
                    "--unstable-kv",
                    "--allow-env",
                    "--allow-net",
                    "--allow-read",
                    "--allow-write",
                    "--allow-run",
                    "jsr:@joshuayoes/deno-kv-mcp"
                ],
                "env": {
                    "DENO_KV_PATH": "path/to/your/kv.db OR https://api.deno.com/databases/<UUID>/connect",
                    "DENO_KV_ACCESS_TOKEN": "<YOUR_DENO_DEPLOY_ACCESS_TOKEN>"
                }
            }
        }
    }
}

McpServers

{
    "denokv": {
        "command": "deno",
        "args": [
            "run",
            "--unstable-kv",
            "--allow-env",
            "--allow-net",
            "--allow-read",
            "--allow-write",
            "--allow-run",
            "jsr:@joshuayoes/deno-kv-mcp"
        ],
        "env": {
            "DENO_KV_PATH": "path/to/your/kv.db OR https://api.deno.com/databases/<UUID>/connect",
            "DENO_KV_ACCESS_TOKEN": "<YOUR_DENO_DEPLOY_ACCESS_TOKEN>"
        }
    }
}

DenoKV MCP Server

JSR Score

Usage with MCP Clients

Deno (recommended)

The easiest way to integrate this server with an MCP client like Claude Desktop or Cursor is to use the published JSR package. Configure your MCP client as follows:

{
  "mcpServers": {
    "denokv": {
      "command": "deno",
      "args": [
        "run",
        "--unstable-kv",
        "--allow-env",
        "--allow-net",
        "--allow-read",
        "--allow-write",
        "--allow-run",
        "jsr:@joshuayoes/deno-kv-mcp"
      ],
      "env": {
        "DENO_KV_PATH": "path/to/your/kv.db OR https://api.deno.com/databases/<UUID>/connect",
        "DENO_KV_ACCESS_TOKEN": "<YOUR_DENO_DEPLOY_ACCESS_TOKEN>" // Only needed for remote DB
      }
    }
  }
}

Make sure to replace the env values with your specific details.

Node

After figuring out that:

- Deno has an official client library for KV that works with Node
- Deno has a compatibility layer with Node,
- Even though jsr packages do not work natively with npx, thanks to this xjsr npm package, we can run jsr packages using npx and node.

We can run this in Node!

{
  "mcpServers": {
    "denokv": {
      "command": "npx",
      "args": ["xjsr", "@joshuayoes/deno-kv-mcp@latest"],
      "env": {
        "DENO_KV_PATH": "path/to/your/kv.db OR https://api.deno.com/databases/<UUID>/connect",
        "DENO_KV_ACCESS_TOKEN": "<YOUR_DENO_DEPLOY_ACCESS_TOKEN>" // Only needed for remote DB
      }
    }
  }
}

Make sure to replace the env values with your specific details.

If you really want to get crazy, replace npx with bunx.

Available Tools

This server provides the following tools:

- set: Set a key-value pair in the Deno KV store.
- key (array of strings): The key to set.
- value (string): The value to set (JSON string).
- expireIn (number, optional): Time-to-live (TTL) for the key in milliseconds.
- get: Get a value by key from the Deno KV store.
- key (array of strings): The key to get.
- consistency (enum: "strong" | "eventual", optional): Consistency level for the read.
- delete: Delete a key-value pair from the Deno KV store.
- key (array of strings): The key to delete.
- getMany: Get multiple values by keys from the Deno KV store.
- keys (array of array of strings): The keys to get.
- consistency (enum: "strong" | "eventual", optional): Consistency level for the read.
- list: List key-value pairs based on a selector.
- prefix (array of strings, optional): Key prefix to list (e.g., ["users"]).
- start (array of strings, optional): Start key for range queries (e.g., ["orders", "2023"]).
- end (array of strings, optional): End key for range queries (e.g., ["orders", "2024"]).
- limit (integer, positive, optional): Maximum number of entries to return.
- consistency (enum: "strong" | "eventual", optional): Consistency level for the list operation.
- batchSize (integer, positive, optional): Number of entries to fetch per batch internally.
- reverse (boolean, optional): Whether to reverse the order of entries.
- _Note:_ Must provide prefix, start, or (start and end) parameter. end requires start or prefix.

Local Development Setup

If you prefer to run the server from a local clone of this repository (e.g., for development or testing), use the following configuration instead:

Deno

{
  "mcpServers": {
    "denokv": {
      "command": "deno",
      "args": [
        "run",
        "--unstable-kv",
        "--allow-env",
        "--allow-net",
        "--allow-read",
        "--allow-write",
        "--allow-run",
        "/path/to/your/mcp-deno-kv/index.ts" // Replace with the actual path to index.ts
      ],
      "env": {
        "DENO_KV_PATH": "path/to/your/kv.db OR https://api.deno.com/databases/<UUID>/connect",
        "DENO_KV_ACCESS_TOKEN": "<YOUR_DENO_DEPLOY_ACCESS_TOKEN>" // Only needed for remote DB
      }
    }
  }
}

Make sure to replace /path/to/your/mcp-deno-kv/index.ts and the env values with your specific details.

Node

Using node (>=v22.7.0), we can also run the server directly without a build step!

You may need to run deno install first to add a node_modules folder.

{
  "mcpServers": {
    "denokv": {
      "command": "node",
      "args": [
        "--experimental-transform-types",
        "/path/to/your/mcp-deno-kv/index.ts" // Replace with the actual path to index.ts
      ],
      "env": {
        "DENO_KV_PATH": "path/to/your/kv.db OR https://api.deno.com/databases/<UUID>/connect",
        "DENO_KV_ACCESS_TOKEN": "<YOUR_DENO_DEPLOY_ACCESS_TOKEN>" // Only needed for remote DB
      }
    }
  }
}

Make sure to replace /path/to/your/mcp-deno-kv/index.ts and the env values with your specific details.

If you really want to get crazy, replace npx with bunx.

Environment Variables

This server requires the following environment variables to be set:

- DENO_KV_PATH: Specifies the path to the Deno KV database.
- For a local database, this should be the file path (e.g., ./my-kv.db).
- For a remote Deno Deploy database, this should be the connection URL (e.g., https://api.deno.com/databases/<UUID>/connect).
- DENO_KV_ACCESS_TOKEN: Required only if DENO_KV_PATH points to a remote Deno Deploy database. This should be your Deno Deploy personal access token.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.