MCP cover image
See in Github
2025-04-14

1

Github Watches

0

Github Forks

0

Github Stars

MCP Server for Amazon Redshift

A Model Context Protocol (MCP) server implementation for Amazon Redshift, allowing AI models to interact with Redshift databases through a standardized interface.

Features

  • Connect to Amazon Redshift databases
  • List tables, views, and materialized views
  • Retrieve schema information for database objects
  • Execute read-only SQL queries
  • Environment variable configuration
  • Schema filtering support

Prerequisites

  • Node.js 18.x or higher
  • npm 9.x or higher
  • Access to an Amazon Redshift cluster

Installation

  1. Clone the repository:

    git clone https://github.com/snahmod/mcp-server-redshift.git
    cd mcp-server-redshift
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file based on the example:

    cp .env.example .env
    
  4. Edit the .env file with your Redshift connection details:

    REDSHIFT_HOST=your-cluster.region.redshift.amazonaws.com
    REDSHIFT_PORT=5439
    REDSHIFT_DATABASE=your_database
    REDSHIFT_USER=your_username
    REDSHIFT_PASSWORD=your_password
    REDSHIFT_SCHEMAS=public,schema1,schema2
    
    # Transport configuration (optional)
    TRANSPORT_TYPE=stdio  # or 'sse'
    PORT=3000            # Only used with SSE transport
    

Usage

Starting the Server

The server supports two transport types:

  1. stdio (default):

    npm start
    # or explicitly
    TRANSPORT_TYPE=stdio npm start
    
  2. SSE (Server-Sent Events):

    TRANSPORT_TYPE=sse PORT=3000 npm start
    

When using SSE transport, the server exposes two endpoints:

  • GET /sse - Establishes an SSE connection
  • POST /messages - Handles MCP messages

Testing

Run the test client to verify the server functionality:

npm test

The test client will:

  1. Start the MCP server
  2. List all tables, views, and materialized views
  3. Get schema information for a table
  4. Get schema information for a view (if available)
  5. Execute a count query on a table
  6. Execute a simple query

Building

Build the TypeScript code:

npm run build

Using with MCP

This server can be used with any MCP-compatible client, including AI assistants like Claude. To use it:

  1. Build the server:

    npm run build
    
  2. Set up your environment variables in .env

  3. Start the server:

    npm start
    
  4. Connect to the server using an MCP client. The server will provide access to database resources and the query tool.

Example MCP Interactions

  1. List all tables and views:

    {
      "type": "list_resources",
      "params": {}
    }
    
  2. Get table schema:

    {
      "type": "read_resource",
      "params": {
        "uri": "redshift://your-cluster/schema/table"
      }
    }
    
  3. Execute a query:

    {
      "type": "call_tool",
      "params": {
        "name": "query",
        "arguments": {
          "sql": "SELECT * FROM schema.table LIMIT 5"
        }
      }
    }
    

Development

Project Structure

  • src/ - Source code
    • index.ts - Main server implementation
    • types.ts - TypeScript type definitions
  • test/ - Test files
    • client.ts - Test client for verifying server functionality
  • dist/ - Compiled JavaScript code (generated)

Adding New Features

  1. Implement new functionality in src/index.ts
  2. Add appropriate tests in test/client.ts
  3. Update documentation in README.md

License

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Acknowledgments

This project is based on the PostgreSQL MCP server from the Model Context Protocol project. Special thanks to the original authors for their work.

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • modelcontextprotocol
  • Serveurs de protocole de contexte modèle

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • n8n-io
  • Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.

  • open-webui
  • Interface AI conviviale (prend en charge Olllama, Openai API, ...)

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.

  • metorial
  • Versions conteneurisées de centaines de serveurs MCP 📡 🧠 🧠

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

    Reviews

    4 (1)
    Avatar
    user_jwrqLOXb
    2025-04-17

    As a dedicated user of mcp-server-redshift, I can confidently say that this product has significantly improved my data processing efficiency. The seamless integration and robust performance make it a standout in its category. Highly recommend checking it out!