Skip to main content
Glama

Superset MCP Server - TypeScript

by phatle96

Superset MCP Server - TypeScript Implementation

A comprehensive TypeScript implementation of the Model Context Protocol (MCP) server for Apache Superset, enabling AI assistants to interact with and control Superset instances programmatically through multiple transport methods.

📚 Based on: This TypeScript implementation is derived from the original Python MCP server: aptro/superset-mcp

🚀 Key Features

Multiple Transport Modes

This server supports three different transport modes for maximum deployment flexibility:

  • 🔧 Stdio Transport (Default) - Traditional MCP client integration
  • 🌐 SSE Transport - Web applications with Server-Sent Events
  • ⚡ StreamableHttp Transport - Modern full-duplex HTTP streaming (Recommended for production)

Complete Superset API Coverage

  • 45+ MCP Tools covering all major Superset functionality
  • Authentication Management: Token-based auth with automatic refresh using proper OAuth 2.0 patterns
  • Dashboard Operations: Full CRUD operations for dashboards
  • Chart Management: Complete chart/visualization lifecycle management
  • Database Integration: Connection management, schema exploration, SQL validation
  • Dataset Operations: Dataset creation and management
  • SQL Lab Integration: Query execution, cost estimation, result export
  • Advanced Features: Tag management, exploration tools, advanced data types
  • User & System: User management, activity tracking, system configuration

Production-Ready Features

  • Robust Error Handling: Comprehensive error responses with detailed context
  • Session Management: Cookie-aware CSRF token handling
  • Token Management: Automatic token refresh with proper refresh token usage
  • Type Safety: Full TypeScript implementation with comprehensive type definitions
  • Multiple Deployment Options: Support for different client architectures

📋 Prerequisites

  • Node.js 16+
  • TypeScript 4.0+
  • A running Apache Superset instance (v1.0+)
  • Valid Superset credentials with appropriate permissions

🛠️ Installation

  1. Clone and setup the repository:
    git clone <your-typescript-repository-url> cd superset-mcp-ts npm install
  2. Configure environment variables:Create a .env file in the root directory:
    SUPERSET_BASE_URL=http://localhost:8088 SUPERSET_USERNAME=your_username SUPERSET_PASSWORD=your_password
  3. Build the TypeScript code:
    npm run build

🚀 Quick Start Guide

Transport Mode Selection

Stdio Transport (Default - MCP Clients)
npm run start:stdio

Perfect for Claude Desktop and other MCP clients.

SSE Transport (Web Applications)
npm run start:sse # Server runs on http://localhost:3000 # Health check: curl http://localhost:3000/health

Ideal for web applications requiring real-time updates.

npm run start:http # Server runs on http://localhost:3000 # Health check: curl http://localhost:3000/health

Best performance for high-throughput applications.

Development Workflow

# Development with auto-reload npm run dev # Stdio mode npm run dev:sse # SSE mode npm run dev:http # HTTP mode # Production deployment npm start # Uses stdio by default

Claude Desktop Integration

Add this configuration to your Claude Desktop MCP settings (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{ "mcpServers": { "superset-ts": { "command": "node", "args": ["/absolute/path/to/your/superset-mcp-ts/build/index.js"], "env": { "SUPERSET_BASE_URL": "http://localhost:8088", "SUPERSET_USERNAME": "admin", "SUPERSET_PASSWORD": "admin" } } } }

📚 Complete API Reference

Authentication Tools

ToolDescriptionParameters
superset_auth_check_token_validityVerify current token statusNone
superset_auth_refresh_tokenRefresh access token using refresh tokenNone
superset_auth_authenticate_userLogin with credentialsusername?, password?, refresh?

Dashboard Management

ToolDescriptionParameters
superset_dashboard_listGet all dashboardsNone
superset_dashboard_get_by_idGet specific dashboarddashboard_id: number
superset_dashboard_createCreate new dashboarddashboard_title: string, json_metadata?: object
superset_dashboard_updateUpdate dashboarddashboard_id: number, data: object
superset_dashboard_deleteDelete dashboarddashboard_id: number

Chart/Visualization Tools

ToolDescriptionParameters
superset_chart_listGet all chartsNone
superset_chart_get_by_idGet specific chartchart_id: number
superset_chart_createCreate new chartslice_name, datasource_id, datasource_type, viz_type, params
superset_chart_updateUpdate chartchart_id: number, data: object
superset_chart_deleteDelete chartchart_id: number

Database Connection Management

ToolDescriptionParameters
superset_database_listGet all databasesNone
superset_database_get_by_idGet database detailsdatabase_id: number
superset_database_createCreate database connectionengine, configuration_method, database_name, sqlalchemy_uri
superset_database_test_connectionTest database connectiondatabase_data: object
superset_database_updateUpdate databasedatabase_id: number, data: object
superset_database_deleteDelete databasedatabase_id: number
superset_database_get_tablesGet database tablesdatabase_id: number
superset_database_schemasGet database schemasdatabase_id: number
superset_database_get_catalogsGet database catalogsdatabase_id: number
superset_database_get_connectionGet connection infodatabase_id: number
superset_database_get_function_namesGet available functionsdatabase_id: number
superset_database_get_related_objectsGet related charts/dashboardsdatabase_id: number
superset_database_validate_sqlValidate SQL syntaxdatabase_id: number, sql: string
superset_database_validate_parametersValidate connection paramsparameters: object

Dataset Management

ToolDescriptionParameters
superset_dataset_listGet all datasetsNone
superset_dataset_get_by_idGet dataset detailsdataset_id: number
superset_dataset_createCreate datasettable_name, database_id, schema?, owners?

SQL Lab & Query Execution

ToolDescriptionParameters
superset_sqllab_execute_queryExecute SQL querydatabase_id: number, sql: string
superset_sqllab_get_saved_queriesGet saved queriesNone
superset_sqllab_format_sqlFormat SQLsql: string
superset_sqllab_get_resultsGet query resultskey: string
superset_sqllab_estimate_query_costEstimate query costdatabase_id, sql, schema?
superset_sqllab_export_query_resultsExport results to CSVclient_id: string
superset_sqllab_get_bootstrap_dataGet SQL Lab bootstrap dataNone

Query Management

ToolDescriptionParameters
superset_query_listList all queriesNone
superset_query_get_by_idGet query detailsquery_id: number
superset_query_stopStop running queryclient_id: string

Saved Query Operations

ToolDescriptionParameters
superset_saved_query_get_by_idGet saved queryquery_id: number
superset_saved_query_createCreate saved queryquery_data: object

User & Activity Management

ToolDescriptionParameters
superset_user_get_currentGet current user infoNone
superset_user_get_rolesGet user rolesNone
superset_activity_get_recentGet recent activityNone

Tag System

ToolDescriptionParameters
superset_tag_listGet all tagsNone
superset_tag_createCreate new tagname: string
superset_tag_get_by_idGet tag detailstag_id: number
superset_tag_objectsGet tagged objectsNone
superset_tag_deleteDelete tagtag_id: number
superset_tag_object_addAdd tag to objectobject_type, object_id, tag_name
superset_tag_object_removeRemove tag from objectobject_type, object_id, tag_name

Exploration & Advanced Features

ToolDescriptionParameters
superset_explore_form_data_createCreate exploration form dataform_data: object
superset_explore_form_data_getGet form datakey: string
superset_explore_permalink_createCreate permalinkstate: object
superset_explore_permalink_getGet permalinkkey: string
superset_advanced_data_type_convertConvert data typesvalue, target_type
superset_advanced_data_type_listList data typesNone

System & Configuration

ToolDescriptionParameters
superset_config_get_base_urlGet Superset URLNone
superset_menu_getGet menu structureNone

🏗️ Architecture & Technical Details

Project Structure

src/ ├── index.ts # Main entry point with transport selection ├── server.ts # Core MCP server implementation ├── transports/ │ ├── stdio.ts # Stdio transport implementation │ ├── sse.ts # Server-Sent Events transport │ └── streamable-http.ts # HTTP streaming transport ├── types/ # TypeScript type definitions └── utils/ # Utility functions

Key Technical Implementations

Authentication System
  • OAuth 2.0 Compliant: Proper access/refresh token handling
  • Session Management: Cookie-aware CSRF token support
  • Auto-Refresh: Transparent token renewal on expiration
  • Secure Storage: File-based token persistence
Error Handling
  • Comprehensive Coverage: All API calls wrapped with error handlers
  • Detailed Context: Meaningful error messages with troubleshooting hints
  • Graceful Degradation: Fallback behaviors for common failure scenarios
Transport Layer
  • Modular Design: Pluggable transport implementations
  • Standards Compliant: MCP specification adherence
  • Production Ready: Health checks, proper HTTP status codes
  • Development Friendly: Hot reload and debugging support

Dependencies & Tech Stack

  • @modelcontextprotocol/sdk: MCP TypeScript SDK v1.17.1
  • axios: HTTP client for Superset API communication
  • dotenv: Environment variable management
  • TypeScript: Type safety and modern JavaScript features
  • Node.js: Runtime environment

🔧 Development Guide

Available Scripts

# Building npm run build # Compile TypeScript npm run build:watch # Build with file watching # Development npm run dev # Default stdio development npm run dev:stdio # Stdio transport development npm run dev:sse # SSE transport development npm run dev:http # HTTP transport development # Production npm start # Production mode (stdio) npm run start:stdio # Production stdio npm run start:sse # Production SSE npm run start:http # Production HTTP # Code Quality npm run lint # ESLint checking npm run lint:fix # Auto-fix ESLint issues npm run format # Prettier formatting npm run type-check # TypeScript type checking

Adding New Tools

  1. Add tool definition in ListToolsRequestSchema handler
  2. Implement case handler in CallToolRequestSchema handler
  3. Add proper parameter validation with TypeScript types
  4. Include error handling with meaningful messages
  5. Update documentation in this README

Testing Locally

# Test with curl (for HTTP/SSE transports) curl http://localhost:3000/health # Test authentication npm run dev:stdio # Then use Claude Desktop or other MCP client to test tools

🚀 Deployment Options

Docker Deployment

FROM node:16-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY build/ ./build/ EXPOSE 3000 CMD ["npm", "run", "start:http"]

PM2 Process Management

{ "name": "superset-mcp", "script": "build/index.js", "env": { "NODE_ENV": "production", "SUPERSET_BASE_URL": "https://your-superset.com", "TRANSPORT": "http" } }

Cloud Deployment

  • AWS: Deploy as Lambda function or ECS container
  • Google Cloud: Cloud Run or Compute Engine
  • Azure: Container Instances or App Service
  • Heroku: Direct deployment with buildpack

🔍 Troubleshooting

Common Issues

Authentication Problems
# Check Superset connectivity curl $SUPERSET_BASE_URL/api/v1/security/login # Verify credentials grep SUPERSET .env
Token Refresh Issues
  • Problem: "No refresh token available"
  • Solution: Re-authenticate with superset_auth_authenticate_user
  • Cause: Refresh token expired or not properly stored
CSRF Token Errors
  • Problem: "CSRF token missing"
  • Solution: Server automatically handles CSRF tokens
  • Check: Ensure cookies are enabled in your environment

Debug Mode

# Enable debug logging DEBUG=superset-mcp:* npm run dev

📈 Performance Considerations

  • Connection Pooling: Axios instance reuse
  • Token Caching: Minimize authentication requests
  • Error Caching: Avoid repeated failed requests
  • Batch Operations: Use list operations when possible

🤝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Follow TypeScript best practices
  4. Add comprehensive error handling
  5. Update documentation
  6. Test thoroughly with Superset instance
  7. Submit pull request

Code Style

  • Use Prettier for formatting
  • Follow ESLint rules
  • Maintain TypeScript strict mode
  • Include JSDoc comments for public functions

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

We extend our gratitude to the following projects and communities that made this implementation possible:

Core Foundations

  • aptro/superset-mcp - The original Python MCP server implementation that serves as the foundation for this TypeScript version. This project provides complete feature parity while adding multiple transport options and enhanced type safety.

Key Dependencies & Technologies

  • Apache Superset - The modern business intelligence web application that this server integrates with
  • Model Context Protocol (MCP) - The protocol specification developed by Anthropic that enables AI assistants to securely integrate with external tools and data sources
  • Anthropic Claude - The AI assistant platform that pioneered MCP integration

Development Ecosystem

  • TypeScript - For providing excellent type safety and developer experience
  • Node.js - The runtime environment that powers this server
  • @modelcontextprotocol/sdk - The official TypeScript SDK for MCP implementations
  • Axios - For reliable HTTP client functionality
  • ESLint & Prettier - For maintaining code quality and consistency

Community & Support

  • Open Source Community - For the collaborative spirit that enables projects like this to exist and thrive
  • Apache Software Foundation - For maintaining the open-source Superset platform
  • TypeScript Community - For excellent tooling, type definitions, and best practices that make TypeScript development a pleasure

Special Recognition

This TypeScript implementation maintains full compatibility with the original Python version while extending capabilities through:

  • Multiple transport mechanisms (Stdio, SSE, HTTP)
  • Enhanced type safety and developer experience
  • Production-ready deployment options
  • Comprehensive error handling and logging

Thank you to all contributors, users, and the broader open-source ecosystem that makes innovative integrations like this possible.

📞 Support

  • Issues: Open GitHub issues for bugs and feature requests
  • Documentation: Check this README and inline code comments
  • Original Reference: See aptro/superset-mcp for additional context

🌟 This TypeScript implementation provides complete feature parity with the original Python version while adding multiple transport options and enhanced type safety for modern development workflows.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables AI assistants to interact with Apache Superset instances programmatically, providing 45+ tools for dashboard management, chart creation, database operations, SQL execution, and complete Superset API coverage. Supports multiple transport modes including stdio, SSE, and HTTP streaming for flexible deployment options.

  1. 🚀 Key Features
    1. Multiple Transport Modes
    2. Complete Superset API Coverage
    3. Production-Ready Features
  2. 📋 Prerequisites
    1. 🛠️ Installation
      1. 🚀 Quick Start Guide
        1. Transport Mode Selection
        2. Development Workflow
        3. Claude Desktop Integration
      2. 📚 Complete API Reference
        1. Authentication Tools
        2. Dashboard Management
        3. Chart/Visualization Tools
        4. Database Connection Management
        5. Dataset Management
        6. SQL Lab & Query Execution
        7. Query Management
        8. Saved Query Operations
        9. User & Activity Management
        10. Tag System
        11. Exploration & Advanced Features
        12. System & Configuration
      3. 🏗️ Architecture & Technical Details
        1. Project Structure
        2. Key Technical Implementations
        3. Dependencies & Tech Stack
      4. 🔧 Development Guide
        1. Available Scripts
        2. Adding New Tools
        3. Testing Locally
      5. 🚀 Deployment Options
        1. Docker Deployment
        2. PM2 Process Management
        3. Cloud Deployment
      6. 🔍 Troubleshooting
        1. Common Issues
        2. Debug Mode
      7. 📈 Performance Considerations
        1. 🤝 Contributing
          1. Code Style
        2. 📄 License
          1. 🙏 Acknowledgments
            1. Core Foundations
            2. Key Dependencies & Technologies
            3. Development Ecosystem
            4. Community & Support
            5. Special Recognition
          2. 📞 Support

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              Enables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.
              Last updated -
              JavaScript
              • Apple
            • -
              security
              A
              license
              -
              quality
              This server implementation allows AI assistants to interact with Asana's API, enabling users to manage tasks, projects, workspaces, and comments through natural language requests.
              Last updated -
              746
              TypeScript
              MIT License
            • -
              security
              A
              license
              -
              quality
              MCP server enabling AI agents to programmatically connect to and control Apache Superset instances, allowing users to manage dashboards, charts, databases, datasets, and run SQL queries through natural language interactions.
              Last updated -
              75
              Python
              MIT License
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server that enables large language models to interact with Apache Superset databases through REST API, supporting database queries, table lookups, field information retrieval, and SQL execution.
              Last updated -
              4
              4
              TypeScript

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/phatle96/superset-mcp-ts'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server