Redshift MCP Server (TypeScript)
paschmaria
README
Redshift MCP Server (TypeScript)
This is a Model Context Protocol (MCP) server for Amazon Redshift implemented in TypeScript. It follows Anthropic's implementation pattern and provides Cursor IDE and other MCP-compatible clients with rich contextual information about your Redshift data warehouse. This server enables LLMs to inspect database schemas and execute read-only queries.
Integration with MCP Clients
Project-Specific Configuration
Create a .cursor/mcp.json
file in your project directory:
{
"mcpServers": {
"redshift-mcp": {
"command": "node",
"args": ["path/to/dist/index.js"],
"env": {
"DATABASE_URL": "redshift://username:password@hostname:port/database?ssl=true"
}
}
}
}
Global Configuration
For using across all projects, create ~/.cursor/mcp.json
in your home directory with the same configuration.
Client-Specific Setup
Cursor IDE
- The server will be automatically detected if configured in
mcp.json
- Tools will appear under "Available Tools" in MCP settings
- Agent will automatically use the tools when relevant
Other MCP Clients
Configure the server using stdio transport:
{
"servers": [
{
"name": "redshift-mcp",
"transport": {
"kind": "stdio",
"command": ["node", "path/to/dist/index.js"]
}
}
]
}
Prerequisites
- Node.js 16 or higher
- TypeScript
- Access to an Amazon Redshift cluster
- Basic knowledge of Redshift and SQL
- Cursor IDE installed
Installation
- Clone this repository or copy the files to your local system
- Install the dependencies:
npm install
- Build the TypeScript code:
npm run build
Usage
The server requires a Redshift connection URL via the DATABASE_URL
environment variable:
export DATABASE_URL="redshift://username:password@hostname:port/database?ssl=true"
npm start
Or you can run directly:
DATABASE_URL="redshift://username:password@hostname:port/database?ssl=true" node dist/index.js
For development, you can use:
DATABASE_URL="redshift://username:password@hostname:port/database?ssl=true" npm run dev
Connection URL Format
redshift://username:password@hostname:port/database?ssl=true
- username: Your Redshift username
- password: Your Redshift password
- hostname: Your Redshift cluster endpoint
- port: Usually 5439 for Redshift
- database: The name of your database
- ssl: Set to "true" for secure connection (recommended)
Additional connection parameters:
ssl=true
: Required for secure connections (recommended)timeout=10
: Connection timeout in secondskeepalives=1
: Enable TCP keepalivekeepalives_idle=130
: TCP keepalive idle time
Project Structure
src/index.ts
: Main TypeScript implementationdist/
: Compiled JavaScript outputpackage.json
: Project dependencies and scriptstsconfig.json
: TypeScript configuration
Components
Tools Available in Cursor
-
query
- Execute read-only SQL queries against the connected Redshift database
- Example: "Write a query to show all tables in the public schema"
-
describe_table
- Get detailed information about a specific table
- Example: "Show me the structure of the users table"
-
find_column
- Find tables containing columns with specific name patterns
- Example: "Find all tables that have a column containing 'email'"
Resources Available to Cursor
The server provides schema information that Cursor can use:
-
Schema Listings (
redshift://<host>/schema/<schema_name>
)- Lists all tables within a specific schema
- Automatically discovered from database metadata
-
Table Schemas (
redshift://<host>/<schema>/<table>/schema
)- JSON schema information for each table
- Includes column names, data types, and Redshift-specific attributes (distribution and sort keys)
-
Sample Data (
redshift://<host>/<schema>/<table>/sample
)- Sample rows from each table (limited to 5)
- Sensitive data is automatically redacted
-
Statistics (
redshift://<host>/<schema>/<table>/statistics
)- Table statistics including size, row count, and creation time
- Distribution and compression information
Security Considerations
This server:
- Uses read-only transactions for queries to prevent modifications
- Sanitizes inputs to prevent SQL injection
- Does not expose raw password information in resource URIs
- Automatically redacts sensitive data in sample results (email, phone)
- Should be used in a secure environment since it has access to your database
Example Cursor Interactions
Here are some example questions you can ask Cursor once connected:
- "Show me all tables in the public schema"
- "What's the structure of the customers table?"
- "Find all tables that contain customer information"
- "Write a query to count orders by status"
- "Show me sample data from the products table"
Extending the Server
You can extend this server by:
- Adding new resource types in the
ListResourcesRequestSchema
andReadResourceRequestSchema
handlers - Adding new tools in the
ListToolsRequestSchema
andCallToolRequestSchema
handlers - Enhancing security features or adding authentication
Development
For development, you can use the npm run dev
command, which uses ts-node to run the TypeScript code directly without pre-compilation.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.