Redash MCP Server
Enables interaction with Redash instances through a standardized interface, allowing users to execute SQL queries, manage data sources, and retrieve query results using natural language.
README
Redash MCP Server
A Model Context Protocol (MCP) server for Redash that provides query execution, data source management, and more through a standardized interface.
✨ Features
- 🔍 Query Execution: Execute SQL queries and retrieve results
- 📊 Data Source Management: List and inspect data sources
- 🔐 Secure: API key-based authentication
- 🐳 Docker Support: Easy deployment with Docker
- ✅ Fully Tested: Comprehensive test coverage with TDD approach
- 🚀 Modern Stack: Built with TypeScript, Vite, and latest tooling
📋 Requirements
- Node.js: >= 22.0.0
- pnpm: >= 9.0.0
- Redash Instance: With API access
- Docker (optional): For containerized deployment
🚀 Quick Start
Using npx (Recommended)
- Clone the repository:
git clone https://github.com/jasonsmithj/redash-mcp.git
cd redash-mcp
- Install dependencies:
pnpm install
- Build the project:
pnpm build
- Link globally:
pnpm link
- Configure your MCP client (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"redash": {
"command": "npx",
"args": ["redash-mcp"],
"env": {
"REDASH_API_KEY": "your_api_key_here",
"REDASH_BASE_URL": "https://redash.example.com"
}
}
}
}
Using Docker Hub (Recommended)
- Pull the latest image from Docker Hub:
docker pull jasonsmithj/redash-mcp:latest
- Run with Docker:
docker run -i --rm \
-e REDASH_API_KEY=your_api_key \
-e REDASH_BASE_URL=https://redash.example.com \
jasonsmithj/redash-mcp:latest
- Or use Docker Compose:
# Create .env file
cp .env.example .env
# Edit .env with your credentials
# Start the service
docker compose up
- Configure your MCP client:
{
"mcpServers": {
"redash": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"REDASH_API_KEY",
"-e",
"REDASH_BASE_URL",
"jasonsmithj/redash-mcp:latest"
],
"env": {
"REDASH_API_KEY": "your_api_key_here",
"REDASH_BASE_URL": "https://redash.example.com"
}
}
}
}
Building from Source
If you prefer to build from source:
docker build -t redash-mcp:local .
🔧 Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
REDASH_API_KEY |
✅ | - | Your Redash API key |
REDASH_BASE_URL |
✅ | - | Redash instance URL |
REDASH_API_TIMEOUT |
❌ | 30000 | API request timeout (milliseconds) |
Getting Your Redash API Key
- Log in to your Redash instance
- Click on your profile icon → "Edit Profile"
- Copy your API key from the "API Key" section
🛠 Available Tools
1. list_data_sources
List all available data sources in Redash.
Parameters: None
Example:
List all data sources
2. get_data_source
Get details about a specific data source.
Parameters:
data_source_id(number): The ID of the data source
Example:
Get details for data source 1
3. execute_query_and_wait
Execute a SQL query and wait for the result.
Parameters:
query(string): The SQL query to executedata_source_id(number): The ID of the data sourcemax_age(number, optional): Maximum age of cached results in seconds
Example:
Execute query "SELECT * FROM users LIMIT 10" on data source 1
4. list_queries
List all queries in Redash.
Parameters:
page(number, optional): Page number (default: 1)page_size(number, optional): Results per page (default: 25)
Example:
List all queries
🧪 Development
Setup
# Install dependencies
pnpm install
# Run tests
pnpm test
# Run tests with UI
pnpm test:ui
# Run tests with coverage
pnpm test:coverage
# Type check
pnpm typecheck
# Lint
pnpm lint
# Format code
pnpm format
# Run all checks (CI equivalent)
pnpm ci
Testing with act
Test GitHub Actions locally using act:
# List available workflows
act -l
# Run CI workflow
act push
# Run specific job
act -j quality
Project Structure
redash-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── redash-client.ts # Redash API client
│ ├── types.ts # Type definitions
│ └── tools/ # MCP tools
│ ├── datasource.ts # Data source tools
│ └── query.ts # Query execution tools
├── tests/ # Test files
├── scripts/ # Build scripts
├── .github/
│ └── workflows/ # GitHub Actions CI/CD
├── Dockerfile # Docker configuration
├── compose.yaml # Docker Compose configuration
└── package.json
📦 Scripts
pnpm dev: Watch mode for developmentpnpm build: Build for productionpnpm test: Run testspnpm test:coverage: Run tests with coverage reportpnpm lint: Lint codepnpm format: Format codepnpm ci: Run all quality checks
🏗 Tech Stack
- Runtime: Node.js 22+ with ES Modules
- Language: TypeScript 5.7+ (strict mode)
- Build Tool: Vite 6.x
- Package Manager: pnpm 9.x
- Testing: Vitest 3.x with coverage
- Linting: ESLint 9.x (Flat Config)
- Formatting: Prettier 3.x
- MCP SDK: @modelcontextprotocol/sdk 1.x
📦 Docker Images
Pre-built Docker images are available on Docker Hub:
- Latest stable:
jasonsmithj/redash-mcp:latest - Specific version:
jasonsmithj/redash-mcp:v1.0.0 - Major version:
jasonsmithj/redash-mcp:1
Supported Platforms
Multi-architecture images are automatically built for both platforms:
linux/amd64(x86_64) - Intel/AMD CPUs- Windows PCs
- Intel-based Macs
- Traditional Linux servers
linux/arm64(ARM64) - ARM CPUs- Apple Silicon Macs (M1/M2/M3/M4)
- ARM-based Linux servers
- Raspberry Pi 4+ (64-bit)
Docker will automatically pull the correct image for your platform!
🚀 Releasing
To release a new version:
- Update version in
package.json - Commit changes:
git commit -am "chore: bump version to vX.Y.Z" - Create and push tag:
git tag vX.Y.Z && git push origin vX.Y.Z - GitHub Actions will automatically build and push to Docker Hub
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run quality checks:
pnpm ci - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Guidelines
- Follow TDD (Test-Driven Development) approach
- Write tests before implementation
- Maintain test coverage above 85%
- Use conventional commits
- Add JSDoc comments for public APIs
- All code comments should be in English
Setting up GitHub Secrets for CD
To enable automated Docker Hub publishing, add the following secrets to your GitHub repository:
- Go to Settings → Secrets and variables → Actions
- Add the following secrets:
DOCKER_USERNAME: Your Docker Hub usernameDOCKER_PASSWORD: Your Docker Hub password or access token
For enhanced security, use a Docker Hub access token instead of your password:
- Log in to Docker Hub
- Go to Account Settings → Security → New Access Token
- Generate a token with "Read, Write, Delete" permissions
- Use this token as
DOCKER_PASSWORD
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
📮 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ by the Redash MCP community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。