MCP ExplorerExplorer

SingleStore MCP Server

@singlestore-labson 6 months ago
20 MIT
FreeOfficial
Databases
#singlestore#database#sql#mcp#model context protocol
Interact with the SingleStore database platform

Overview

What is SingleStore MCP Server

The SingleStore MCP Server is an implementation of the Model Context Protocol (MCP), which is designed to manage interactions between large language models (LLMs) and external systems like databases. It allows users to communicate with SingleStore using natural language, streamlining complex operations through an organized command structure.

Use cases

This server can be leveraged for numerous applications, such as retrieving workspace details, executing SQL queries, creating virtual workspaces, managing notebooks, and scheduling jobs. It is particularly useful for data analysts and developers who need to carry out data-related tasks effortlessly using natural language via compatible LLM clients like Claude Desktop and Cursor.

How to use

To set up the MCP server, users can use the initialization command with the API key for SingleStore, or install via Smithery. After configuring the LLM client settings to include the MCP server details, users can start interacting with SingleStore directly using natural language commands.

Key features

Key features include tools for retrieving workspace and organizational details, executing SQL operations, creating and managing virtual workspaces and notebooks, and scheduling jobs. The server simplifies complex database interactions through structured commands without requiring extensive SQL knowledge.

Where to use

The SingleStore MCP Server can be utilized in environments where data access and manipulation are needed alongside natural language processing. Ideal use cases involve applications in analytical reporting, data management tasks, and automated job scheduling within SingleStore’s database ecosystem.

Content

SingleStore MCP Server

MIT Licence PyPI Downloads Smithery

Model Context Protocol (MCP) is a standardized protocol designed to manage context between large language models (LLMs) and external systems. This repository provides an installer and an MCP Server for Singlestore, enabling seamless integration.

With MCP, you can use Claude Desktop, Cursor, or any compatible MCP client to interact with SingleStore using natural language, making it easier to perform complex operations effortlessly.

Requirements

  • Python >= v3.11.0
  • uvx installed on your python environment
  • Claude Desktop, Cursor, or another supported LLM client

Client Setup

1. Init Command

The simplest way to set up the MCP server is to use the initialization command:

uvx singlestore-mcp-server init --api-key <SINGLESTORE_API_KEY>

This command will:

  1. Authenticate the user
  2. Automatically locate the configuration file for your platform
  3. Create or update the configuration to include the SingleStore MCP server
  4. Provide instructions for starting the server

To specify a client (e.g., claude or cursor), use the --client flag:

uvx singlestore-mcp-server init --api-key <SINGLESTORE_API_KEY> --client=<client>

2. Installing via Smithery

To install mcp-server-singlestore automatically via Smithery:

npx -y @smithery/cli install @singlestore-labs/mcp-server-singlestore --client=<client>

Replace <client> with claude or cursor as needed.

3. Manual Configuration

Claude Desktop and Cursor

  1. Add the following configuration to your client configuration file. Check the client’s configuration file here:
  • Claude Desktop

  • Cursor

    {
      "mcpServers": {
        "singlestore-mcp-server": {
          "command": "uvx",
          "args": [
            "singlestore-mcp-server",
            "start",
            "--api-key",
            "<SINGLESTORE_API_KEY>"
          ]
        }
      }
    }
  1. Restart your client after making changes to the configuration.

Components

Tools

The server implements the following tools:

  • workspace_groups_info: Retrieve details about the workspace groups accessible to the user
    • No arguments required
    • Returns details of the workspace groups
  • workspaces_info: Retrieve details about the workspaces in a specific workspace group
    • Arguments: workspaceGroupID (string)
    • Returns details of the workspaces
  • organization_info: Retrieve details about the user’s current organization
    • No arguments required
    • Returns details of the organization
  • list_of_regions: Retrieve a list of all regions that support workspaces for the user
    • No arguments required
    • Returns a list of regions
  • execute_sql: Execute SQL operations on a connected workspace
    • Arguments: workspace_group_identifier, workspace_identifier, username, password, database, sql_query
    • Returns the results of the SQL query in a structured format
  • list_virtual_workspaces: List all starter workspaces accessible to the user
    • No arguments required
    • Returns details of available starter workspaces
  • create_virtual_workspace: Create a new starter workspace with a user
    • Arguments:
      • name: Name of the starter workspace
      • database_name: Name of the database to create
      • username: Username for accessing the workspace
      • password: Password for the user
      • workspace_group: Object containing name (optional) and cellID (mandatory)
    • Returns details of the created workspace and user
  • execute_sql_on_virtual_workspace: Execute SQL operations on a virtual workspace
    • Arguments: virtual_workspace_id, username, password, sql_query
    • Returns the results of the SQL query in a structured format including data, row count, columns, and status
  • list_notebook_samples: List all notebook samples available in SingleStore Spaces
    • No arguments required
    • Returns details of available notebook samples
  • create_notebook: Create a new notebook in the user’s personal space
    • Arguments: notebook_name, content (optional)
    • Returns details of the created notebook
  • list_personal_files: List all files in the user’s personal space
    • No arguments required
    • Returns details of all files in the user’s personal space
  • create_scheduled_job: Create a new scheduled job to run a notebook
    • Arguments:
      • name: Name for the job
      • notebook_path: Path to the notebook to execute
      • schedule_mode: Once or Recurring
      • execution_interval_minutes: Minutes between executions (optional)
      • start_at: When to start the job (optional)
      • description: Description of the job (optional)
      • create_snapshot: Whether to create notebook snapshots (optional)
      • runtime_name: Name of the runtime environment
      • parameters: Parameters for the job (optional)
      • target_config: Target configuration for the job (optional)
    • Returns details of the created job
  • get_job_details: Get details about a specific job
    • Arguments: job_id
    • Returns detailed information about the specified job
  • list_job_executions: List execution history for a specific job
    • Arguments: job_id, start (optional), end (optional)
    • Returns execution history for the specified job

Dockerization

Building the Docker Image

To build the Docker image for the MCP server, run the following command in the project root:

docker build -t mcp-server-singlestore .

Running the Docker Container

To run the Docker container, use the following command:

docker run -d \
  -p 8000:8000 \
  --name mcp-server \
  mcp-server-singlestore

Tools

workspace_groups_info
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
workspaces_info
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: Timestamp of termination if applicable - workspaceGroupID: Workspacegroup identifier - workspaceID: Unique workspace identifier Use this tool to: 1. Monitor workspace status 2. Get connection details for database operations 3. Track workspace lifecycle Required parameter: - workspaceGroupID: Unique identifier of the workspace group Related operations: - Use workspace_groups_info first to get workspacegroupID - Use execute_sql to run queries on specific workspace
organization_info
Retrieve information about the current user's organization in SingleStore. Returns organization details including: - orgID: Unique identifier for the organization - name: Organization display name
list_of_regions
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
execute_sql
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: × No INSERT/UPDATE/DELETE × No DROP/CREATE/ALTER - Ensure queries are properly sanitized Required parameters: - 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 Optional parameters: - username: Username for database access (defaults to SINGLESTORE_DB_USERNAME) - password: Password for database access (defaults to SINGLESTORE_DB_PASSWORD) Allowed query examples: - SELECT * FROM table_name - SELECT COUNT(*) FROM table_name - SHOW TABLES - DESCRIBE table_name Note: For data modifications, please use appropriate admin tools or APIs.
list_virtual_workspaces
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 Note: This tool only lists starter workspaces, not standard workspaces. Use workspaces_info for standard workspace information.
1 / 3

Comments

Recommend MCP Servers

View All MCP Servers