Ditto MCP Server

Ditto MCP Server

Enables secure execution of Ditto DQL (Data Query Language) queries over HTTPS with safety checks and capability gating. Supports parameterized queries, health checks, and configuration management for Ditto database operations.

Category
访问服务器

README

<div align="center">

Ditto MCP Server — Secure DQL for Ditto

NPM Version MIT licensed Node >=18

Install in Cursor

</div>

📚 Table of Contents

Overview

An open‑source Model Context Protocol server that executes Ditto DQL over HTTPS with capability gating and safety checks. Designed for Cursor, Claude Code, VS Code Copilot Chat (MCP), Windsurf, Zed, and more.

Features

  • Ping health tool, execute_dql tool, and ditto://config resource
  • Statement guardrails: single statement, operation allow‑list, optional query pattern allow‑list
  • Config via env, CLI, or client config
  • Native ESM, strict TypeScript, zero runtime deps beyond MCP SDK

Requirements

  • Node.js >= 18.17
  • A Ditto app base URL, e.g. https://MY_APP.cloud.ditto.live
  • A Ditto API key with access to that app

Quick Start (Local)

npx -y ditto-mcp-server@latest

Defaults to stdio transport. Provide env vars (recommended):

export DITTO_BASE_URL="https://MY_APP.cloud.ditto.live"
export DITTO_API_KEY="YOUR_API_KEY"
export MCP_DITTO_ALLOWED="READ"   # or ALL / SELECT,INSERT,...

npx -y ditto-mcp-server@latest

Install in Clients

Below are minimal JSON snippets. See each client’s docs for full syntax and options.

Cursor

Add to ~/.cursor/mcp.json or project .cursor/mcp.json:

{
  "mcpServers": {
    "ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server@latest"],
      "env": {
        "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
        "DITTO_API_KEY": "YOUR_API_KEY",
        "MCP_DITTO_ALLOWED": "READ"
      }
    }
  }
}

Claude Code CLI

claude mcp add ditto -- npx -y ditto-mcp-server --timeout 20000

VS Code Copilot Chat (Insiders)

{
  "mcp": {
    "servers": {
      "ditto": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "ditto-mcp-server"],
        "env": {
          "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
          "DITTO_API_KEY": "YOUR_API_KEY"
        }
      }
    }
  }
}

Windsurf

Add to Windsurf MCP config (see their docs for exact path):

{
  "mcpServers": {
    "ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server"],
      "env": {
        "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
        "DITTO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Zed

Add to ~/.config/zed/settings.json:

{
  "context_servers": {
    "Ditto": {
      "command": {
        "path": "npx",
        "args": ["-y", "ditto-mcp-server"]
      }
    }
  }
}

Roo Code / Cline

Add in settings under MCP servers or marketplace manual JSON:

{
  "mcpServers": {
    "ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server"],
      "env": {
        "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
        "DITTO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

JetBrains AI Assistant

Settings → Tools → AI Assistant → MCP → Add → As JSON:

{
  "mcpServers": {
    "ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server"],
      "env": {
        "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
        "DITTO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

LM Studio

Program → Install → Edit mcp.json:

{
  "mcpServers": {
    "Ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server"],
      "env": {
        "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
        "DITTO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Warp

Settings → AI → Manage MCP servers:

{
  "Ditto": {
    "command": "npx",
    "args": ["-y", "ditto-mcp-server"],
    "start_on_launch": true
  }
}

Amazon Q Developer CLI

~/.aws/q/developer/cli/config.json:

{
  "mcpServers": {
    "ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server"]
    }
  }
}

Gemini CLI

~/.gemini/settings.json:

{
  "mcpServers": {
    "ditto": {
      "command": "npx",
      "args": ["-y", "ditto-mcp-server"]
    }
  }
}

Tools & Resources

  • ping – returns pong for connectivity check
  • execute_dql – run a parameterized DQL against Ditto
    • statement (string, required) – single statement, no trailing ;
    • args (object, optional) – named parameters
    • transactionId (number, optional) – X‑DITTO‑TXN‑ID
    • apiKey (string, optional) – override key; prefer env
    • baseUrl (string, optional) – override base URL
    • timeoutMs (number, optional, <= 60000)
  • Resource: ditto://config – redacted runtime config

Example: SELECT with named args

Tool: execute_dql
Args:
{
  "statement": "SELECT * FROM collection WHERE type = :t LIMIT 5",
  "args": { "t": "note" }
}

Returns a JSON envelope with items, queryType, warnings, and optional error.

Configuration

You can configure via env, CLI, or client configs. Env is preferred for secrets.

Environment variables:

  • DITTO_BASE_URL – e.g. https://MY_APP.cloud.ditto.live
  • DITTO_API_KEY – Ditto API key
  • MCP_DITTO_ALLOWEDREAD, ALL, or a comma list like SELECT,INSERT
  • MCP_DITTO_QUERY_ALLOW_PATTERNS – comma/semicolon‑separated regex allow‑list
  • DITTO_TIMEOUT_MS – default per‑call timeout (ms)
  • DITTO_API_KEY_ENV – env var name to read API key from (default DITTO_API_KEY)
  • MCP_SERVER_NAME – server display name
  • MCP_SERVER_VERSION – overrides the reported server version (default: package.json version; fallback: 0.0.0-dev)
  • LOG_LEVEL – controls logging verbosity: debug|info|warn|error|silent (default: info)

Configuration precedence: CLI flags > environment variables. Reported version precedence: MCP_SERVER_VERSION > package.json > 0.0.0-dev.

CLI flags (subset):

ditto-mcp [transport] \
  --name <name> \
  --base-url <url> \
  --api-key-env <VAR> \
  --timeout <ms>

Transport argument defaults to stdio. This package currently exposes stdio only.

MCP Client One‑click Patterns

  • Cursor deeplink button above for instant install into ~/.cursor/mcp.json.

Security Notes

  • Prefer environment variables for secrets; avoid CLI args containing secrets
  • Allowed operation gating and optional regex allow‑list help constrain queries
  • Logs redact tokens and obvious secret patterns

Development

yarn
yarn build
node dist/index.js stdio

Linting is TypeScript‑strict by design. The prepack script builds automatically before npm publish.

Test with MCP Inspector

npx -y @modelcontextprotocol/inspector npx ditto-mcp-server

Alternative Runtimes

bunx -y ditto-mcp-server

Windows PowerShell example:

cmd /c npx -y ditto-mcp-server

Docker

Build the image:

docker build -t ditto-mcp .

Run with env vars:

docker run --rm -i \
  -e DITTO_BASE_URL="https://MY_APP.cloud.ditto.live" \
  -e DITTO_API_KEY="YOUR_API_KEY" \
  ditto-mcp

You can also configure Docker as a local MCP command in clients that support running a container for stdio transport. Example:

{
  "mcpServers": {
    "ditto": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "DITTO_BASE_URL",
        "-e",
        "DITTO_API_KEY",
        "ditto-mcp"
      ],
      "env": {
        "DITTO_BASE_URL": "https://MY_APP.cloud.ditto.live",
        "DITTO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Troubleshooting

  • If tools don’t appear, refresh/toggle the server in your client
  • Ensure DITTO_BASE_URL and DITTO_API_KEY are set
  • In Windows, provide full node and dist/index.js paths if needed

If your client has trouble auto-installing via npx, try bunx -y ditto-mcp-server.

Versioning & Changelog

See CHANGELOG.md.

License

MIT © EVT Engineering and contributors


This project is not affiliated with Ditto. “Ditto” is a respective trademark of its owner.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选