Model Context Protocol server for Ditto DQL with capability gating
npm install ditto-mcp-server

![Node >=18]()

- Ditto MCP Server — Secure DQL for Ditto
- 📚 Table of Contents
- Overview
- Features
- Requirements
- Quick Start (Local)
- Install in Clients
- Cursor
- Claude Code CLI
- VS Code Copilot Chat (Insiders)
- Windsurf
- Zed
- Roo Code / Cline
- JetBrains AI Assistant
- LM Studio
- Warp
- Amazon Q Developer CLI
- Gemini CLI
- Tools \& Resources
- Example: SELECT with named args
- Configuration
- MCP Client One‑click Patterns
- Security Notes
- Development
- Test with MCP Inspector
- Alternative Runtimes
- Docker
- Troubleshooting
- Versioning \& Changelog
- License
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.
- 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
- 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
``bash`
npx -y ditto-mcp-server@latest
Defaults to stdio transport. Provide env vars (recommended):
`bash
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
`
Below are minimal JSON snippets. See each client’s docs for full syntax and options.
Add to ~/.cursor/mcp.json or project .cursor/mcp.json:
`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"
}
}
}
}
`bash`
claude mcp add ditto -- npx -y ditto-mcp-server --timeout 20000
`json`
{
"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"
}
}
}
}
}
Add to Windsurf MCP config (see their docs for exact path):
`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"
}
}
}
}
Add to ~/.config/zed/settings.json:
`json`
{
"context_servers": {
"Ditto": {
"command": {
"path": "npx",
"args": ["-y", "ditto-mcp-server"]
}
}
}
}
Add in settings under MCP servers or marketplace manual JSON:
`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"
}
}
}
}
Settings → Tools → AI Assistant → MCP → Add → As JSON:
`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"
}
}
}
}
Program → Install → Edit mcp.json:
`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"
}
}
}
}
Settings → AI → Manage MCP servers:
`json`
{
"Ditto": {
"command": "npx",
"args": ["-y", "ditto-mcp-server"],
"start_on_launch": true
}
}
~/.aws/q/developer/cli/config.json:
`json`
{
"mcpServers": {
"ditto": {
"command": "npx",
"args": ["-y", "ditto-mcp-server"]
}
}
}
~/.gemini/settings.json:
`json`
{
"mcpServers": {
"ditto": {
"command": "npx",
"args": ["-y", "ditto-mcp-server"]
}
}
}
- ping – returns pong for connectivity checkexecute_dql
- – run a parameterized DQL against Dittostatement
- (string, required) – single statement, no trailing ;args
- (object, optional) – named parameterstransactionId
- (number, optional) – X‑DITTO‑TXN‑IDapiKey
- (string, optional) – override key; prefer envbaseUrl
- (string, optional) – override base URLtimeoutMs
- (number, optional, <= 60000)ditto://config
- Resource: – redacted runtime config
`txt`
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.
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.liveDITTO_API_KEY
- – Ditto API keyMCP_DITTO_ALLOWED
- – READ, ALL, or a comma list like SELECT,INSERTMCP_DITTO_QUERY_ALLOW_PATTERNS
- – comma/semicolon‑separated regex allow‑listDITTO_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 nameMCP_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):
`bash`
ditto-mcp [transport] \
--name
--base-url
--api-key-env \
--timeout
Transport argument defaults to stdio. This package currently exposes stdio only.
- Cursor deeplink button above for instant install into ~/.cursor/mcp.json.
- 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
`bash`
yarn
yarn build
node dist/index.js stdio
Linting is TypeScript‑strict by design. The prepack script builds automatically before npm publish.
`bash`
npx -y @modelcontextprotocol/inspector npx ditto-mcp-server
`bash`
bunx -y ditto-mcp-server
Windows PowerShell example:
`powershell`
cmd /c npx -y ditto-mcp-server
Build the image:
`bash`
docker build -t ditto-mcp .
Run with env vars:
`bash`
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:
`json`
{
"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"
}
}
}
}
- If tools don’t appear, refresh/toggle the server in your client
- Ensure DITTO_BASE_URL and DITTO_API_KEY are setnode
- In Windows, provide full and dist/index.js paths if needed
If your client has trouble auto-installing via npx, try bunx -y ditto-mcp-server`.
See CHANGELOG.md.
MIT © EVT Engineering and contributors
---
This project is not affiliated with Ditto. “Ditto” is a respective trademark of its owner.