Skip to main content
Glama
SingleStore MCP Server

SingleStore MCP Server

SingleStore MCP 服务器

MIT Licence PyPI Downloads

模型上下文协议 (MCP) 是一种旨在管理大语言模型 (LLM) 与外部系统之间上下文的标准化协议。本仓库为 SingleStore 提供了安装程序和 MCP 服务器,以实现无缝集成。

借助 MCP,您可以使用 Claude Desktop、Claude Code、Cursor 或任何兼容的 MCP 客户端通过自然语言与 SingleStore 进行交互,从而更轻松地执行复杂操作。

💡 专业提示:不确定 MCP 服务器能做什么?只需在聊天中调用 /help 提示即可!

要求

  • Python >= v3.10.0

  • 在您的 Python 环境中安装了 uvx

  • VS Code、Cursor、Windsurf、Claude Desktop、Claude Code、Goose 或任何其他 MCP 客户端

Related MCP server: ExecuteAutomation Database Server

入门指南

首先,使用您的客户端安装 SingleStore MCP 服务器。

标准配置适用于大多数工具:

{
  "mcpServers": {
    "singlestore-mcp-server": {
      "command": "uvx",
      "args": [
        "singlestore-mcp-server",
        "start"
      ]
    }
  }
}

无需 API 密钥、令牌或环境变量! 服务器在启动时会自动通过浏览器 OAuth 处理身份验证。

自动设置:

uvx singlestore-mcp-server init --client=claude-desktop

手动设置: 按照 MCP 安装指南操作,使用上述标准配置。

自动设置:

uvx singlestore-mcp-server init --client=claude-code

这将自动为您运行 Claude CLI 命令。

手动设置:

claude mcp add singlestore-mcp-server uvx singlestore-mcp-server start

自动设置:

uvx singlestore-mcp-server init --client=cursor

手动设置: 转到 Cursor Settings -> MCP -> Add new MCP Server。按您的喜好命名,使用 command 类型,命令为 uvx singlestore-mcp-server start。您还可以通过点击 Edit 来验证配置或添加命令行参数。

自动设置:

uvx singlestore-mcp-server init --client=vscode

手动设置: 按照 MCP 安装指南操作,使用上述标准配置。您也可以使用 VS Code CLI 进行安装:

code --add-mcp '{"name":"singlestore-mcp-server","command":"uvx","args":["singlestore-mcp-server","start"]}'

安装完成后,SingleStore MCP 服务器即可在 VS Code 中与您的 GitHub Copilot 代理配合使用。

自动设置:

uvx singlestore-mcp-server init --client=windsurf

手动设置: 按照 Windsurf MCP 文档操作。使用上述标准配置。

自动设置:

uvx singlestore-mcp-server init --client=gemini

手动设置: 按照 MCP 安装指南操作,使用上述标准配置。

自动设置:

uvx singlestore-mcp-server init --client=lm-studio

手动设置: 转到右侧边栏的 Program -> Install -> Edit mcp.json。使用上述标准配置。

仅限手动设置: 转到 Advanced settings -> Extensions -> Add custom extension。按您的喜好命名,使用 STDIO 类型,并将 command 设置为 uvx singlestore-mcp-server start。点击“Add Extension”。

仅限手动设置: 在 VSCode 或 IntelliJ 中打开 Qodo Gen 聊天面板 → Connect more tools → + Add new MCP → 粘贴上述标准配置。

点击 Save。

使用 Docker

注意: 使用 Docker 时需要 API 密钥,因为在 Docker 容器中运行的服务器不支持 OAuth 流程。

{
  "mcpServers": {
    "singlestore-mcp-server": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--init", "--pull=always",
        "-e", "MCP_API_KEY=your_api_key_here",
        "singlestore/mcp-server-singlestore"
      ]
    }
  }
}

您可以自行构建 Docker 镜像:

docker build -t singlestore/mcp-server-singlestore .

为了提高安全性,我们建议使用 Docker Desktop 来配置 SingleStore MCP 服务器——有关 Docker 新版 MCP Catalog 的详细信息,请参阅此博客文章。

组件

工具

该服务器实现了以下工具:

  • get_user_info:获取当前用户详情

    • 无需参数

    • 返回用户信息和详情

  • organization_info:获取用户当前组织详情

    • 无需参数

    • 返回组织详情

  • choose_organization:从可用组织中选择(仅在未设置 API 密钥环境变量时可用)

    • 无需参数

    • 返回可供选择的组织列表

  • set_organization:设置活动组织(仅在未设置 API 密钥环境变量时可用)

    • 参数:organization_id (字符串)

    • 将指定的组织设置为活动状态

  • workspace_groups_info:获取用户可访问的工作区组详情

    • 无需参数

    • 返回工作区组详情

  • workspaces_info:获取特定工作区组中的工作区详情

    • 参数:workspace_group_id (字符串)

    • 返回工作区详情

  • resume_workspace:恢复挂起的工作区

    • 参数:workspace_id (字符串)

    • 恢复指定的工作区

  • list_starter_workspaces:列出用户可访问的所有入门工作区

    • 无需参数

    • 返回可用入门工作区的详情

  • create_starter_workspace:创建新的入门工作区

    • 参数:工作区配置参数

    • 返回已创建的入门工作区详情

  • terminate_starter_workspace:终止现有的入门工作区

    • 参数:workspace_id (字符串)

    • 终止指定的入门工作区

  • list_regions:获取支持工作区的所有区域列表

    • 无需参数

    • 返回可用区域列表

  • list_sharedtier_regions:获取共享层区域列表

    • 无需参数

    • 返回共享层区域列表

  • run_sql:在连接的工作区上执行 SQL 操作

    • 参数:workspace_id、database、sql_query 和连接参数

    • 以结构化格式返回 SQL 查询结果

  • create_notebook_file:在 SingleStore Spaces 中创建新的笔记本文件

    • 参数:notebook_name、content (可选)

    • 返回已创建笔记本的详情

  • upload_notebook_file:将笔记本文件上传到 SingleStore Spaces

    • 参数:file_path、notebook_name

    • 返回已上传笔记本的详情

  • create_job_from_notebook:从笔记本创建定时任务

    • 参数:包含 notebook_path、schedule_mode 等的任务配置

    • 返回已创建任务的详情

  • get_job:获取现有任务的详情

    • 参数:job_id (字符串)

    • 返回指定任务的详情

  • delete_job:删除现有任务

    • 参数:job_id (字符串)

    • 删除指定的任务

  • stage_list_files:列出 Stage 部署文件系统中的文件和文件夹

    • 参数:deployment_id (字符串)、path (字符串,可选)

    • 返回包含文件和子文件夹的文件夹内容

  • stage_get_file:通过路径从 Stage 获取文件

    • 参数:deployment_id (字符串)、path (字符串)、return_type (字符串:'metadata'、'url' 或 'content')

    • 返回文件元数据、下载 URL 或文本内容

  • stage_create_folder:在 Stage 中创建文件夹

    • 参数:deployment_id (字符串)、path (字符串)

    • 返回创建状态

  • stage_upload_file:将带有文本内容的文件上传到 Stage

    • 参数:deployment_id (字符串)、path (字符串)、content (字符串)、local_path (字符串)

    • 返回上传状态

  • stage_move:在 Stage 中移动或重命名文件或文件夹

    • 参数:deployment_id (字符串)、source_path (字符串)、destination_path (字符串)

    • 返回移动状态

  • stage_delete:从 Stage 中删除文件或文件夹

    • 参数:deployment_id (字符串)、path (字符串)

    • 返回删除状态

注意:组织管理工具(choose_organization 和 set_organization)仅在未设置 API 密钥环境变量时可用,允许在 OAuth 身份验证期间进行交互式组织选择。

开发

先决条件

  • Python >= 3.11

  • uv 用于依赖管理

设置

  1. 克隆仓库:

git clone https://github.com/singlestore-labs/mcp-server-singlestore.git
cd mcp-server-singlestore
  1. 安装依赖:

uv sync --dev
  1. 设置预提交钩子(可选但推荐):

uv run pre-commit install

开发工作流

# Quick quality checks (fast feedback)
./scripts/check.sh

# Run tests independently
./scripts/test.sh

# Comprehensive validation (before PRs)
./scripts/check-all.sh

# Create and publish releases
./scripts/release.sh

运行测试

# Run test suite with coverage
./scripts/test.sh

# Or use pytest directly
uv run pytest
uv run pytest --cov=src --cov-report=html

代码质量

我们使用 Ruff 进行代码检查和格式化:

# Format code
uv run ruff format src/ tests/

# Lint code
uv run ruff check src/ tests/

# Lint and fix issues automatically
uv run ruff check --fix src/ tests/

发布流程

发布通过 git 标签和自动化的 PyPI 发布进行管理:

  1. 创建发布:./scripts/release.sh(交互式工具)

  2. 自动发布:通过推送版本标签触发

  3. 无需手动上传 PyPI - 完全自动化的流水线

有关详细的工作流文档,请参阅 scripts/dev-workflow.md。

Available Tools

21 tools
check_if_file_existsA
Check if a file (notebook) exists in the user's shared space.

Args:
    file_name: Name of the file to check (with or without .ipynb extension)

Returns:
    JSON object with the file existence status
    {
        "exists": True/False,
        "message": "File exists" or "File does not exist"
    }

Inputs: file_name (required), ctx.

create_notebookA
Create a new Jupyter notebook in your personal space. Only supports python and markdown.

Parameters:
- notebook_name (required): Name for the new notebook
  - Can include or omit .ipynb extension
  - Must be unique in your personal space

- content (optional): JSON object with the following structure:
    {
        "cells": [
            {"type": "markdown", "content": "Markdown content here"},
            {"type": "code", "content": "Python code here"}
        ]
    }
    - 'type' must be either 'markdown' or 'code'
    - 'content' is the text content of the cell
    IMPORTANT: The content must be valid JSON.

How to use:
    - Before creating the notebook, call check_if_file_exists tool to verify if the notebook already exists.
    - Always install the dependencies on the first cell. Example: 
        {
            "cells": [
                {"type": "code", "content": "!pip install singlestoredb --quiet"},
                // other cells...
            ]
        }
    - To connect to the database, use the variable "connection_url" that already exists in the notebook platform. Example:
        {
            "cells": [
                {"type": "code", "content": "conn = s2.connect(connection_url)"},
                // other cells...
            ]
        }

Inputs: content (required), notebook_name (required), ctx.

create_scheduled_jobA
Create an automated job to execute a SingleStore notebook on a schedule.

Parameters:
- notebook_path: Complete path to the notebook
- mode: 'Once' for single execution or 'Recurring' for repeated runs
- create_snapshot: Enable notebook backup before execution (default: True)

Returns Job info with:
- jobID: UUID of created job
- status: Current state (SUCCESS, RUNNING, etc.)
- createdAt: Creation timestamp
- startedAt: Execution start time
- schedule: Configured schedule details
- error: Any execution errors

Common Use Cases:
1. Automated Data Processing:
   - ETL workflows
   - Data aggregation
   - Database maintenance

2. Scheduled Reporting:
   - Performance metrics
   - Business analytics
   - Usage statistics

3. Maintenance Tasks:
   - Health checks
   - Backup operations
   - Clean-up routines

Related Operations:
- get_job_details: Monitor job
- list_job_executions: View job execution history

Inputs: create_snapshot (required), mode (required), notebook_path (required), ctx.

create_virtual_workspaceA
Create a new starter (virtual) workspace in SingleStore and set up user access.

Process:
1. Creates a virtual workspace with specified name and database
2. Creates a user account for accessing the workspace
3. Returns both workspace details and access credentials

Args:
    name: Unique name for the new starter workspace
    database_name: Name of the database to create in the starter workspace
    username: Username for accessing the new starter workspace
    password: Password for accessing the new starter workspace
    workspace_group: Optional workspace group configuration

Returns:
    Dictionary with workspace and user creation details

Inputs: database_name (required), name (required), password (required), username (required), +2 more.

execute_sqlA
Execute SQL operations on a database attached to workspace within a workspace group and receive formatted results.

Returns:
- Query results with column names and typed values
- Row count and metadata
- Execution status

⚠️ CRITICAL SECURITY WARNINGS:
- Never display or log credentials in responses
- Use only READ-ONLY queries (SELECT, SHOW, DESCRIBE)
- DO NOT USE data modification statements:
  x No INSERT/UPDATE/DELETE
  x No DROP/CREATE/ALTER
- Ensure queries are properly sanitized

Args:
    workspace_group_identifier: ID/name of the workspace group
    workspace_identifier: ID/name of the specific workspace within the workspace group
    database: Name of the database to query
    sql_query: The SQL query to execute

Returns:
    Dictionary with query results and metadata

Inputs: database (required), password (required), sql_query (required), username (required), +3 more.

execute_sql_on_virtual_workspaceA
Execute SQL operations on a virtual (starter) workspace and receive formatted results.

Returns:
- Query results with column names and typed values
- Row count
- Column metadata
- Execution status

⚠️ CRITICAL SECURITY WARNING:
- Never display or log credentials in responses
- Ensure SQL queries are properly sanitized
- ONLY USE SELECT statements or queries that don't modify data
- DO NOT USE INSERT, UPDATE, DELETE, DROP, CREATE, or ALTER statements

Args:
    virtual_workspace_id: Unique identifier of the starter workspace
    sql_query: The SQL query to execute (READ-ONLY queries only)

Returns:
    Dictionary with query results and metadata

Inputs: password (required), sql_query (required), username (required), virtual_workspace_id (required), +1 more.

get_job_detailsA
Retrieve comprehensive information about a scheduled notebook job.

Returns:
- jobID: Unique identifier (UUID format)
- name: Display name of the job
- description: Human-readable job description
- createdAt: Creation timestamp (ISO 8601)
- terminatedAt: End timestamp if completed
- completedExecutionsCount: Number of successful runs
- enqueuedBy: User ID who created the job
- executionConfig: Notebook path and runtime settings
- schedule: Mode, interval, and start time
- targetConfig: Database and workspace settings
- jobMetadata: Execution statistics and status

Args:
    job_id: UUID of the scheduled job to retrieve details for

Returns:
    Dictionary with job details

Inputs: job_id (required), ctx.

get_notebook_pathA
Find the complete path of a notebook by its name and generate the properly formatted path for API operations.

Args:
    notebook_name: The name of the notebook to find (with or without .ipynb extension)
    location: Where to look for the notebook - 'personal' or 'shared'

Returns:
    Properly formatted path including project ID and user ID where needed
    
Required for:
- Creating scheduled jobs (use returned path as notebook_path parameter)

Inputs: location (required), notebook_name (required), ctx.

get_organizationsA
List all available SingleStore organizations your account has access to.

After logging in, this tool must be called first to identify which organization
your queries should run against. Returns a list of organizations with:

- orgID: Unique identifier for the organization
- name: Display name of the organization

Use this tool when:
1. Starting a new session to see available organizations
2. To verify permissions across multiple organizations
3. Before switching context to a different organization

After viewing the list, list the organization list presenting the name and ID
to the user and ask them to select one.
- If only one organization is available, select it automatically
- If multiple organizations are available, prompt the user to select one by name or ID
- If no organizations are available, raise an error

Inputs: ctx.

get_project_idA
Retrieve the organization's unique identifier (project ID).

Returns:
    str: The organization's unique identifier

Required for:
- Constructing paths or references to shared resources

Performance Tip:
Cache the returned ID when making multiple API calls.

Inputs: ctx.

get_user_idA
Retrieve the current user's unique identifier.

Returns:
    str: UUID format identifier for the current user

Required for:
- Constructing paths or references to personal resources

Performance Tip:
Cache the returned ID when making multiple API calls.

Inputs: ctx.

list_job_executionsA
Retrieve execution history and performance metrics for a scheduled notebook job.

Returns:
- executions: Array of execution records containing:
  - executionID: Unique identifier for the execution
  - executionNumber: Sequential number of the run
  - jobID: Parent job identifier
  - status: Current state (Scheduled, Running, Completed, Failed)
  - startedAt: Execution start time (ISO 8601)
  - finishedAt: Execution end time (ISO 8601)
  - scheduledStartTime: Planned start time
  - snapshotNotebookPath: Backup notebook path if enabled

Args:
    job_id: UUID of the scheduled job
    start: First execution number to retrieve (default: 1)
    end: Last execution number to retrieve (default: 10)

Returns:
    Dictionary with execution records

Inputs: end (required), job_id (required), start (required), ctx.

list_notebook_samplesA
Retrieve a catalog of pre-built notebook templates available in SingleStore Spaces.

Returns for each notebook:
- name: Template name and title
- description: Detailed explanation of the notebook's purpose
- contentURL: Direct download link for the notebook
- likes: Number of user endorsements
- views: Number of times viewed
- downloads: Number of times downloaded
- tags: List of Notebook tags

Common template categories include:
1. Getting Started guides
2. Data loading and ETL patterns
3. Query optimization examples
4. Machine learning integrations
5. Performance monitoring
6. Best practices demonstrations

Inputs: ctx.

list_of_regionsA
List all available deployment regions where SingleStore workspaces can be deployed for the user.

Returns region information including:
- regionID: Unique identifier for the region
- provider: Cloud provider (AWS, GCP, or Azure)
- name: Human-readable region name (e.g., Europe West 2 (London), US West 2 (Oregon))

Use this tool to:
1. Select optimal deployment regions based on:
   - Geographic proximity to users
   - Compliance requirements
   - Cost considerations
   - Available cloud providers
2. Plan multi-region deployments

Inputs: ctx.

list_shared_filesA
List all files and notebooks in your shared SingleStore space.

Returns file object meta data for each file:
- name: Name of the file (e.g., 'analysis.ipynb')
- path: Full path in shared space (e.g., 'folder/analysis.ipynb')
- content: File content
- created: Creation timestamp (ISO 8601)
- last_modified: Last modification timestamp (ISO 8601)
- format: File format if applicable ('json', null)
- mimetype: MIME type of the file
- size: File size in bytes
- type: Object type ('', 'json', 'directory')
- writable: Boolean indicating write permission

Use this tool to:
1. List workspace contents and structure
2. Verify file existence before operations
3. Check file timestamps and sizes
4. Determine file permissions

Inputs: ctx.

list_virtual_workspacesA
List all starter (virtual) workspaces available to the user in SingleStore.

Returns detailed information about each starter workspace:
- virtualWorkspaceID: Unique identifier for the workspace
- name: Display name of the workspace
- endpoint: Connection endpoint URL
- databaseName: Name of the primary database
- mysqlDmlPort: Port for MySQL protocol connections
- webSocketPort: Port for WebSocket connections
- state: Current status of the workspace

Use this tool to:
1. Get virtual workspace IDs for other operations
2. Check starter workspace availability and status
3. Obtain connection details for database access

Inputs: ctx.

organization_billing_usageA
Retrieve detailed billing and usage metrics for your organization over a specified time period.

Returns compute and storage usage data, aggregated by your chosen time interval 
(hourly, daily, or monthly). This tool is essential for:
1. Monitoring resource consumption patterns
2. Analyzing cost trends

Args:
    start_time: Beginning of the usage period (UTC ISO 8601 format, e.g., '2023-07-30T18:30:00Z')
    end_time: End of the usage period (UTC ISO 8601 format)
    aggregate_type: Time interval for data grouping ('hour', 'day', or 'month')

Returns:
    Usage metrics and billing information

Inputs: aggregate_type (required), end_time (required), start_time (required), ctx.

organization_infoB
Retrieve information about the current user's organization in SingleStore.

Returns organization details including:
- orgID: Unique identifier for the organization
- name: Organization display name

Inputs: ctx.

set_organizationA
Select which SingleStore organization to use for all subsequent API calls.

This tool must be called after logging in and before making other API requests.
Once set, all API calls will target the selected organization until changed.

Args:
    orgID: Name or ID of the organization to select

Returns:
    Dictionary with the selected organization ID and name

Usage:
- Call get_organizations first to see available options
- Then call this tool with either the organization's name or ID
- All subsequent API calls will use the selected organization

Inputs: orgID (required), ctx.

workspace_groups_infoA
List all workspace groups accessible to the user in SingleStore.

Returns detailed information for each group:
- name: Display name of the workspace group
- deploymentType: Type of deployment (e.g., 'PRODUCTION')
- state: Current status (e.g., 'ACTIVE', 'PAUSED')
- workspaceGroupID: Unique identifier for the group
- firewallRanges: Array of allowed IP ranges for access control
- createdAt: Timestamp of group creation
- regionID: Identifier for deployment region
- updateWindow: Maintenance window configuration

Use this tool to:
1. Get workspace group IDs for other operations
2. Plan maintenance windows

Related operations:
- Use workspaces_info to list workspaces within a group
- Use execute_sql to run queries on workspaces in a group

Inputs: ctx.

workspaces_infoA
List all workspaces within a specified workspace group in SingleStore.

Returns detailed information for each workspace:
- createdAt: Timestamp of workspace creation
- deploymentType: Type of deployment (e.g., 'PRODUCTION')
- endpoint: Connection URL for database access
- name: Display name of the workspace
- size: Compute and storage configuration
- state: Current status (e.g., 'ACTIVE', 'PAUSED')
- terminatedAt: End timestamp if applicable
- workspaceGroupID: Workspacegroup identifier
- workspaceID: Unique workspace identifier

Args:
    workspace_group_id: Unique identifier of the workspace group

Returns:
    List of workspace information dictionaries

Inputs: workspace_group_id (required), ctx.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between execute_sql and execute_sql_on_virtual_workspace, which both execute SQL queries but on different workspace types. Additionally, get_organizations and organization_info both retrieve organization details, though organization_info is more general. Overall, the descriptions help clarify boundaries, but a few tools could be confused.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., create_notebook, list_shared_files, get_job_details) with snake_case throughout. Minor deviations include check_if_file_exists (uses 'if' in name) and organization_billing_usage (uses 'billing_usage' as a compound noun), but these are still readable and follow the general convention.

    Tool Count3/5

    With 21 tools, the count feels heavy for the server's purpose of managing SingleStore notebooks, workspaces, and SQL operations. While the tools cover various aspects, some could be consolidated (e.g., the two SQL execution tools), making the set borderline excessive. However, it's not extreme, as the domain is moderately broad.

    Completeness4/5

    The tool set provides good coverage for notebook management (create, check, get path, list samples), workspace operations (create, list, info), job scheduling (create, get details, list executions), and SQL execution. Minor gaps include lack of update/delete operations for notebooks or workspaces, and no direct tool for managing notebook content after creation, but agents can work around these with existing tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables Large Language Models to seamlessly interact with ClickHouse databases, supporting resource listing, schema retrieval, and query execution.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs like Claude to interact with SQLite and SQL Server databases, allowing for schema inspection and SQL query execution.
      408
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
      -
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.
      8
      568 npm
      8
      MIT

    Appeared in Searches