llm-redshift-sample-mcp

amitds1997/llm-redshift-sample-mcp

3.2

If you are the rightful owner of llm-redshift-sample-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This document provides a comprehensive guide to building a Model Context Protocol (MCP) server for connecting to Redshift and executing queries.

Build an MCP

We would build a small MCP server that would allow us to do fun stuff like connecting to Redshift to run a query.

Prerequisites

  1. You have access to Redshift and have the credentials.

  2. You have access to an MCP-enabled client like Claude Code.

  3. Have uv installed. If on MacOS, just do brew install uv.

  4. VSCode, if you do not have it, because this session is built for it. If on MacOS, just do brew install --cask visual-studio-code. It can be done in any editor, I will just be using VSCode for this session.

  5. Open the directory where this file is located in your terminal and run uv sync to install the dependencies.

    uv sync
    
  6. Time to work with server.py which will be our MCP server. Open it in VS Code. If you are not in VS Code, but have it installed and are in the terminal, you can run:

    code .
    

Important information and commands

  1. To run MCP inspector: uv run mcp dev server.py
  2. Put your Redshift credentials in .env file.
  3. To import MCP server in Claude Code, use claude mcp add sample-mcp -- uv run --directory <directory-where-things-are-installed> server.py
  4. A completed MCP server is present in file.