Skip to content

Epic: MCP Server for Data Studio ecosystem (dockit + sqlkit) #9

Description

@Blankll

Epic: MCP Server for Data Studio ecosystem (dockit + sqlkit)

Status: Planning
Target release: TBD


Background

data-studio-agent powers AI agent loops for both dockit (NoSQL: Elasticsearch, OpenSearch, MongoDB, DynamoDB) and sqlkit (SQL: PostgreSQL, MySQL, SQL Server, SQLite). Currently, only the built-in Tauri-based AI assistant can use these capabilities.

The Model Context Protocol (MCP) has become the standard for AI coding agents (Claude Code, Cursor, Windsurf, OpenCode, Codex) to interact with external tools. This epic delivers a unified MCP Server that exposes both dockit and sqlkit capabilities to any MCP-compatible agent.

Architecture

code agent (Claude Code / Cursor / OpenCode ...)
    |
    | MCP stdio protocol
    v
@geekfun/data-studio-mcp (npm package, pure TypeScript)
    |
    | @modelcontextprotocol/sdk
    | node:http
    |
    |  POST /invoke    POST /tools
    +------+----------------+---
           |                |
           v                v
       dockit:9120    sqlkit:9121
       (HTTP server   (HTTP server
        in dockit)     in sqlkit)
           |                |
           v                v
       invoke_capability_inner()
       + get_available_tools()
           |                |
           v                v
       dockit capabilities     sqlkit capabilities
       (es__*, mongo__*,       (sql__execute_query,
        dynamo__*, etc.)        sql__list_tables, etc.)

Two layers only:

  • MCP Server: pure TypeScript, depends only on @modelcontextprotocol/sdk + built-in node:http
  • Bridge: dockit and sqlkit each expose a lightweight HTTP server that delegates to their existing invoke_capability_inner()

No Rust binary, no platform-specific builds, no launcher shim. The MCP server is just an npm package that npx runs directly.

Repository structure changes

data-studio-agent/
+-- Cargo.toml                  [workspace] (existing, single member)
+-- package.json                npm workspace root (new)
|
+-- crates/
|   +-- data-studio-agent/      existing Rust code, moved from root
|       +-- Cargo.toml          name = "data-studio-agent" (unchanged)
|       +-- src/                existing code, no changes needed
|
+-- packages/
|   +-- data-studio-mcp/        NEW: MCP Server (pure TypeScript)
|       +-- package.json        @geekfun/data-studio-mcp
|       +-- tsconfig.json
|       +-- server.json         MCP registry metadata
|       +-- src/
|           +-- index.ts        MCP server entry
|           +-- discovery.ts    discover dockit/sqlkit ports
|           +-- backends.ts     HTTP proxy to each backend
|           +-- tools.ts        unified tool definitions
|
+-- docs/
+-- README.md

Tool naming convention

All tools use a unified data_studio__{db}__{action} format. The database prefix determines which backend handles the call.

data_studio__sql_*       →  sqlkit:9121
data_studio__es_*        →  dockit:9120
data_studio__mongo_*     →  dockit:9120
data_studio__dynamo_*    →  dockit:9120
data_studio__list_*      →  both backends, merge results

The MCP server routes purely by prefix — no need for Agent to know which backend is which.

Tool Backend Risk Comment
data_studio__list_connections Both Safe Queries both backends, merges into one list
data_studio__list_available_tools Both Safe Returns tools matching current connection types
SQL (via sqlkit)
data_studio__sql_execute sqlkit Elevated Arbitrary SQL query execution
data_studio__sql_list_databases sqlkit Safe
data_studio__sql_list_schemas sqlkit Safe
data_studio__sql_list_tables sqlkit Safe
data_studio__sql_describe_table sqlkit Safe Columns, types, nullability, keys, defaults
data_studio__sql_get_schema sqlkit Safe Full DDL-like schema dump
data_studio__sql_explain sqlkit Safe EXPLAIN ANALYZE execution plan
Elasticsearch (via dockit)
data_studio__es_search dockit Safe Query DSL search
data_studio__es_get_document dockit Safe By document ID
data_studio__es_index_document dockit Elevated Create or replace document
data_studio__es_update_document dockit Elevated Partial update via update API
data_studio__es_delete_document dockit Destructive By document ID
data_studio__es_delete_by_query dockit Destructive Bulk delete matching query
data_studio__es_list_indices dockit Safe Health, docs count, storage
data_studio__es_get_mapping dockit Safe Field names and data types
data_studio__es_create_index dockit Elevated With optional mappings and settings
data_studio__es_delete_index dockit Destructive Irreversible
data_studio__es_put_mapping dockit Elevated Add or update field mappings
data_studio__es_list_aliases dockit Safe Index aliases and routing
data_studio__es_cluster_health dockit Safe Cluster-level health status
data_studio__es_cluster_stats dockit Safe Cluster-level statistics
MongoDB (via dockit)
data_studio__mongo_list_databases dockit Safe
data_studio__mongo_list_collections dockit Safe Within a database
data_studio__mongo_find dockit Safe Query with filter, projection, sort
data_studio__mongo_aggregate dockit Safe Aggregation pipeline
data_studio__mongo_count_documents dockit Safe
data_studio__mongo_sample_documents dockit Safe Quick data preview
data_studio__mongo_insert dockit Elevated Insert single document
data_studio__mongo_update dockit Elevated Update by filter or by _id
data_studio__mongo_delete dockit Destructive Delete by filter or by _id
data_studio__mongo_create_index dockit Elevated
data_studio__mongo_drop_index dockit Destructive
data_studio__mongo_truncate_collection dockit Destructive Remove all documents
DynamoDB (via dockit)
data_studio__dynamo_query dockit Safe PartiQL SELECT
data_studio__dynamo_scan dockit Safe Full table scan with filters
data_studio__dynamo_get_item dockit Safe By primary key
data_studio__dynamo_put_item dockit Elevated Create or replace item
data_studio__dynamo_update_item dockit Elevated Update attributes
data_studio__dynamo_delete_item dockit Destructive By primary key
data_studio__dynamo_list_tables dockit Safe
data_studio__dynamo_describe_table dockit Safe Schema, indexes, throughput, TTL, streams
data_studio__dynamo_create_table dockit Elevated With key schema, indexes, billing
data_studio__dynamo_delete_table dockit Destructive Irreversible
data_studio__dynamo_truncate_table dockit Destructive Remove all items, preserve table
data_studio__dynamo_query_table dockit Safe Query by PK/SK
data_studio__dynamo_scan_table dockit Safe Scan with optional index
data_studio__dynamo_describe_ttl dockit Safe
data_studio__dynamo_describe_backups dockit Safe PITR / continuous backups
data_studio__dynamo_get_metrics dockit Safe CloudWatch capacity/throttling

The MCP server auto-filters tools based on which backends are running:

  • Only dockit running → NoSQL tools only (es, mongo, dynamo)
  • Only sqlkit running → SQL tools only
  • Both running → All tools

Work breakdown

Phase 1: Unified Capability Types (→ #11)

See #11 for details.

Phase 2: HTTP Bridge — Desktop apps as backends (→ #12)

See #12 for details.

Phase 3: MCP Server — TypeScript npm package (→ #13)

See #13 for details.

Phase 4: MCP Permission Model & Management UI (→ #10)

See #10 for full design, research findings, and implementation details.

References

Dependencies

  • dockit and sqlkit must publish a release with MCP bridge before MCP Server can be tested end-to-end

Out of scope

  • Replacing the built-in AI assistant with MCP — the in-app agent loop continues unchanged
  • JDBC bridge for sqlkit — handled by sqlkit's existing jdbc-bridge/
  • Standalone mode (MCP without desktop apps) — can be revisited if there is demand

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions