MCP Server

Use Sling CLI as an MCP (Model Context Protocol) server to enable AI assistants to interact with databases, files, and APIs

Overview

The Sling CLI includes a built-in MCP (Model Context Protocol) server that enables AI assistants like Claude, ChatGPT, and GitHub Copilot to interact with your data infrastructure through a standardized interface. MCP is an open protocol that allows AI models to connect to external tools and data sources safely and efficiently.

By running sling mcp, you expose Sling's powerful data movement and transformation capabilities to AI assistants, enabling them to:

  • Query and explore databases across 30+ database systems

  • Manage files across cloud storage providers (S3, Azure, GCS, etc.)

  • Execute data replications and pipelines

  • Create and test API specifications

  • Discover schemas, tables, and columns

Note: The Sling MCP server requires a Sling CLI Pro license for database and file system operations. Connection management and basic operations work without a license.

Sling MCP Demo

Core Capabilities

The Sling MCP server exposes six main tools that AI assistants can use:

1. Connection Tool

Manages connections to databases, file systems, and APIs.

Actions:

  • list - List all configured connections

  • discover - Discover tables, files, or endpoints in a connection

  • test - Test connection validity

  • set - Create or update a connection

  • docs - Fetch connection documentation

2. Database Tool

Provides database-specific operations for querying and schema exploration.

Actions:

  • docs - Fetch database documentation

  • query - Execute SQL queries (read-only by default)

  • get_schemata - Get detailed schema information (databases, schemas, tables, columns)

  • get_schemas - List available schemas

  • get_columns - Get column metadata for specific tables

3. File System Tool

Manages files across local and cloud storage systems.

Actions:

  • list - List files and directories

  • copy - Copy files between connections

  • inspect - Get file metadata and statistics

  • docs - Fetch file system documentation

4. API Spec Tool

Creates and manages API specifications for REST APIs.

Actions:

  • parse - Parse and validate API specification files

  • test - Test API endpoints defined in specifications

  • docs - Fetch API specification documentation

5. Replication Tool

Executes data replication configurations.

Actions:

  • parse - Parse replication YAML files

  • compile - Compile and validate replications

  • run - Execute replications

  • docs - Fetch replication documentation

6. Pipeline Tool

Manages and executes data pipelines.

Actions:

  • parse - Parse pipeline configurations

  • run - Execute pipelines

  • docs - Fetch pipeline documentation

Installation

Prerequisites

  1. Install Sling CLI: Follow the installation guide

  2. Verify installation: Run sling --version

  3. Set up connections: Configure your database and storage connections using environment variables

  4. Optional: Obtain a Sling CLI Pro license for full functionality

VSCode with GitHub Copilot

GitHub Copilot in VSCode supports MCP servers through workspace or user configuration:

Workspace Configuration

Create .vscode/mcp.json in your project root:

{
  "servers": {
    "sling": {
      "type": "stdio",
      "command": "sling",
      "args": ["mcp"],
      "env": {
        "SLING_CLI_TOKEN": "your-token-here"
      }
    }
  }
}

User Configuration (Global)

  1. Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)

  2. Run MCP: Add Server

  3. Select "Global"

  4. Enter configuration:

{
  "name": "sling",
  "type": "stdio",
  "command": "sling",
  "args": ["mcp"],
  "env": {
    "SLING_CLI_TOKEN": "your-token-here"
  }
}

Using with Copilot

  1. Open Chat view (Ctrl+Alt+I or Cmd+Alt+I)

  2. Select "Agent mode" from the dropdown

  3. Click "Tools" button to see available Sling tools

  4. Start using Sling commands in your prompts

Sling MCP on VSCode
Sling MCP on VSCode
Sling MCP on VSCode

Claude Desktop

Claude Desktop supports MCP servers through a configuration file. Here's how to set up Sling:

  1. Open the configuration file:

open ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Add the Sling MCP server configuration:

{
  "mcpServers": {
    "sling": {
      "command": "sling",
      "args": ["mcp"],
      "env": {
        "SLING_CLI_TOKEN": "your-token-here"
      }
    }
  }
}
  1. Restart Claude Desktop

  2. Look for the MCP indicator (🔌) in the bottom-right corner of the chat input

Sling MCP on Claude Desktop
Sling MCP on Claude Desktop
Sling MCP on Claude Desktop

Claude Code

Claude Code supports MCP servers at three configuration scopes:

Local Scope (Project-specific)

# Add for current project only
claude mcp add sling --args "mcp" --env SLING_CLI_TOKEN=your-token-here

Project Scope (Shared with team)

Create .mcp.json in your project root:

{
  "servers": {
    "sling": {
      "type": "stdio",
      "command": "sling",
      "args": ["mcp"],
      "env": {
        "SLING_CLI_TOKEN": "${SLING_CLI_TOKEN}"
      }
    }
  }
}

User Scope (Global)

# Add globally for all projects
claude mcp add sling --scope user --args "mcp" --env SLING_CLI_TOKEN=your-token-here

Alternatively, edit ~/.claude.json directly:

{
  "mcpServers": {
    "sling": {
      "command": "sling",
      "args": ["mcp"],
      "env": {
        "SLING_CLI_TOKEN": "your-token-here"
      }
    }
  }
}

ChatGPT Desktop

For now, you can use bridge solutions like the chatgpt-mcp server that enables MCP interaction through the ChatGPT macOS app:

{
  "mcpServers": {
    "chatgpt-sling-bridge": {
      "command": "uvx",
      "args": ["chatgpt-mcp"],
      "env": {
        "SLING_MCP_COMMAND": "sling mcp",
        "SLING_CLI_TOKEN": "your-token-here"
      }
    }
  }
}

Usage Examples

Querying a Database

Simple Analysis Prompt to AI Assistant:

Use sling connection `postgres_prod` to query the sales table in my warehouse connection and show me the top 10 revenue generating products this month

The assistant will construct and execute:

{
  "action": "query",
  "input": {
    "connection": "postgres_prod",
    "query": "SELECT product_id, SUM(revenue) as total_revenue FROM sales WHERE date >= '2025-01-01' GROUP BY product_id ORDER BY total_revenue DESC LIMIT 10"
  }
}

Table Comparison Prompt to AI Assistant:

Use sling in connection `snowflake_dw` to compare the tables: dbt_dev.core_transactions (dev table) and finance.core_transactions (prod table). Compare the counts and null counts as well as distinct counts.

The assistant will construct and execute multiple queries and return a summary.

Discovering Database Tables

Prompt to AI Assistant:

Using Sling, show me all tables in my `postgres_rds` connection that start with "customer_"

The assistant will use:

{
  "action": "discover",
  "input": {
    "connection": "postgres_rds",
    "pattern": "*.customer_*"
  }
}

Copying Files Between Storage Systems

Prompt to AI Assistant:

Use sling to copy all CSV files from connection `aws_s3` folder "raw/2025/" to connection `AZURE_PROD` "processed/" folder

The assistant will execute:

{
  "action": "copy",
  "input": {
    "source_location": "aws_s3/raw/2025/*.csv",
    "target_location": "azure_prod/processed/",
    "recursive": true
  }
}

MCP Prompts

The Sling MCP server provides specialized prompts that guide AI assistants through complex API specification workflows. These prompts are pre-built conversation templates that help with creating, extending, and debugging API integrations.

api_spec_create_spec

Creates a complete Sling API specification from scratch by analyzing API documentation and building endpoints with authentication, pagination, and data extraction configuration.

Arguments:

Argument
Required
Description

spec_name

Yes

Name for the API specification (used as filename)

spec_file_path

No

Full file path for the spec file

connection_name

Yes

Name for the API connection to create and test

api_docs_url

Yes

URL to the API documentation website

endpoint_names

Yes

Comma-separated list of endpoint names to include

additional_info

No

Additional instructions or requirements

Workflow:

  1. Fetches Sling API spec documentation

  2. Analyzes the target API documentation (using browser if available)

  3. Creates the specification file

  4. Creates or uses existing connection

  5. Tests and iterates until endpoints work correctly

api_spec_add_endpoint

Adds a new endpoint to an existing Sling API specification by analyzing endpoint documentation and implementing proper configuration.

Arguments:

Argument
Required
Description

spec_file_path

Yes

Full file path to the existing spec file

endpoint_name

Yes

Name of the new endpoint to add

endpoint_docs_url

No

URL to the specific endpoint documentation

additional_info

No

Additional instructions for the implementation

Workflow:

  1. Fetches Sling API spec documentation

  2. Loads and parses the existing specification

  3. Analyzes endpoint documentation

  4. Implements the new endpoint following existing patterns

  5. Tests until the endpoint returns data successfully

api_spec_debug_endpoint

Debugs and fixes issues with an existing endpoint in a Sling API specification by analyzing errors and adjusting configuration.

Arguments:

Argument
Required
Description

spec_file_path

Yes

Full file path to the spec file

endpoint_name

Yes

Name of the endpoint to debug and fix

additional_info

No

Additional context about the issues

Workflow:

  1. Fetches Sling API spec documentation

  2. Loads and examines the current specification

  3. Analyzes API documentation for verification

  4. Tests and diagnoses issues

  5. Fixes configuration and iterates until successful

Common issues checked:

  • Authentication (token format, headers, auth type)

  • URL construction (base URLs, parameter encoding)

  • Data extraction (JMESPath expressions)

  • Pagination (next page logic, stop conditions)

  • Rate limiting (request rates, backoff strategies)

Troubleshooting

Log Locations

  • Claude Desktop: ~/Library/Logs/Claude/ (macOS) or %APPDATA%\Claude\logs\ (Windows)

  • Claude Code: View logs with claude mcp logs sling

  • VSCode: Use Command Palette > "MCP: Show Logs"

Debug Output

Enable trace logging for detailed debugging:

{
  "mcpServers": {
    "sling": {
      "command": "sling",
      "args": ["mcp"],
      "env": {
        "SLING_CLI_TOKEN": "your-token-here",
        "DEBUG": "TRACE"
      }
    }
  }
}

Resources

Last updated

Was this helpful?