Labsco
madhukarkumar logo

SingleStore MCP Server

โ˜… 4

from madhukarkumar

An MCP server for interacting with SingleStore databases, requiring environment variables for connection.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

SingleStore MCP Server

smithery badge

A Model Context Protocol (MCP) server for interacting with SingleStore databases. This server provides tools for querying tables, describing schemas, and generating ER diagrams.

Features

  • List all tables in the database
  • Execute custom SQL queries
  • Get detailed table information including schema and sample data
  • Generate Mermaid ER diagrams of database schema
  • SSL support with automatic CA bundle fetching
  • Proper error handling and TypeScript type safety

Environment Variables

Required Environment Variables

The server requires the following environment variables for database connection:

SINGLESTORE_HOST=your-host.singlestore.com
SINGLESTORE_PORT=3306
SINGLESTORE_USER=your-username
SINGLESTORE_PASSWORD=your-password
SINGLESTORE_DATABASE=your-database

All these environment variables are required for the server to establish a connection to your SingleStore database. The connection uses SSL with the SingleStore CA bundle, which is automatically fetched from the SingleStore portal.

Optional Environment Variables

For SSE (Server-Sent Events) protocol support:

SSE_ENABLED=true       # Enable the SSE HTTP server (default: false if not set)
SSE_PORT=3333          # HTTP port for the SSE server (default: 3333 if not set)

Setting Environment Variables

  1. In Your Shell: Set the variables in your terminal before running the server:

    export SINGLESTORE_HOST=your-host.singlestore.com
    export SINGLESTORE_PORT=3306
    export SINGLESTORE_USER=your-username
    export SINGLESTORE_PASSWORD=your-password
    export SINGLESTORE_DATABASE=your-database
  2. In Client Configuration Files: Add the variables to your MCP client configuration file as shown in the integration sections below.

MCP Client Integration

Installing in Claude Desktop

  1. Add the server configuration to your Claude Desktop config file located at:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "singlestore": {
      "command": "node",
      "args": ["path/to/mcp-server-singlestore/build/index.js"],
      "env": {
        "SINGLESTORE_HOST": "your-host.singlestore.com",
        "SINGLESTORE_PORT": "3306",
        "SINGLESTORE_USER": "your-username",
        "SINGLESTORE_PASSWORD": "your-password",
        "SINGLESTORE_DATABASE": "your-database",
        "SSE_ENABLED": "true",
        "SSE_PORT": "3333"
      }
    }
  }
}

The SSE_ENABLED and SSE_PORT variables are optional. Include them if you want to enable the HTTP server with SSE support alongside the standard MCP protocol.

  1. Restart the Claude Desktop App

  2. In your conversation with Claude, you can now use the SingleStore MCP server with:

use_mcp_tool({
  server_name: "singlestore",
  tool_name: "list_tables",
  arguments: {}
})

Installing in Windsurf

  1. Add the server configuration to your Windsurf config file located at:
    • macOS: ~/Library/Application Support/Windsurf/config.json
    • Windows: %APPDATA%\Windsurf\config.json
{
  "mcpServers": {
    "singlestore": {
      "command": "node",
      "args": ["path/to/mcp-server-singlestore/build/index.js"],
      "env": {
        "SINGLESTORE_HOST": "your-host.singlestore.com",
        "SINGLESTORE_PORT": "3306",
        "SINGLESTORE_USER": "your-username",
        "SINGLESTORE_PASSWORD": "your-password",
        "SINGLESTORE_DATABASE": "your-database",
        "SSE_ENABLED": "true",
        "SSE_PORT": "3333"
      }
    }
  }
}

The SSE_ENABLED and SSE_PORT variables are optional, but enable additional functionality through the SSE HTTP server.

  1. Restart Windsurf

  2. In your conversation with Claude in Windsurf, the SingleStore MCP tools will be available automatically when Claude needs to access database information.

Installing in Cursor

  1. Add the server configuration to your Cursor settings:
    • Open Cursor
    • Go to Settings (gear icon) > Extensions > Claude AI > MCP Servers
    • Add a new MCP server with the following configuration:
{
  "singlestore": {
    "command": "node",
    "args": ["path/to/mcp-server-singlestore/build/index.js"],
    "env": {
      "SINGLESTORE_HOST": "your-host.singlestore.com",
      "SINGLESTORE_PORT": "3306",
      "SINGLESTORE_USER": "your-username",
      "SINGLESTORE_PASSWORD": "your-password",
      "SINGLESTORE_DATABASE": "your-database",
      "SSE_ENABLED": "true",
      "SSE_PORT": "3333"
    }
  }
}

The SSE_ENABLED and SSE_PORT variables allow web applications to connect to the server via HTTP and receive real-time updates through Server-Sent Events.

  1. Restart Cursor

  2. When using Claude AI within Cursor, the SingleStore MCP tools will be available for database operations.

Security Considerations

  1. Never commit credentials to version control
  2. Use environment variables or secure configuration management
  3. Consider using a connection pooling mechanism for production use
  4. Implement appropriate access controls and user permissions in SingleStore
  5. Keep the SingleStore CA bundle up to date

Development

Project Structure

mcp-server-singlestore/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ index.ts      # Main server implementation
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ CHANGELOG.md

Building

npm run build

Testing

npm test