AL
OfficialDatabase

Alkemi MCP Server for Plain-English Database Queries

Query databases in plain English with the Alkemi MCP server to access exposed API endpoints and abstract data products for faster, intuitive insights.

Quick Install
npx -y @alkemi-ai/alkemi-mcp

Overview

Alkemi MCP Server is a small STDIO wrapper that exposes Alkemi’s Streamable HTTP MCP endpoint (https://api.alkemi.cloud/mcp) as a Model Context Protocol (MCP) server. It lets MCP clients (for example, Claude Desktop or other MCP-aware agents) send plain-English questions about data and receive accurate, consistent responses generated using Alkemi’s metadata, query generation, and database connectors.

Rather than shipping database schemas and query examples inside each agent, Alkemi stores metadata and produces the correct SQL (or query language) for Snowflake, Google BigQuery, Databricks and other sources. The MCP server acts as a local bridge: MCP clients communicate over stdio and the server forwards requests to Alkemi’s HTTP endpoint using a bearer token. This makes it easy to share a consistent data-querying surface across teams without duplicating schema knowledge in every client.

Features

  • STDIO-based MCP server compatible with MCP clients (Claude Desktop, other agents)
  • Forwards requests to Alkemi Streamable HTTP MCP endpoint for query generation and execution
  • Supports Snowflake, BigQuery, Databricks and other Alkemi-connected sources
  • Optionally restricts scope to a single Alkemi Product via PRODUCT_ID
  • Works with multiple named MCP servers (MCP_NAME) so teams can run several isolated data views
  • Simple npx / node usage or clone-and-build workflow
  • Includes development tools like an MCP Inspector for debugging stdio communication

Installation / Configuration

Install and build (repository clone) or run directly with npx.

Install dependencies:

npm install

Build:

npm run build

Development (watch + auto-rebuild):

npm run watch

Run via npx (quick start):

# uses BEARER_TOKEN from environment
npx @alkemiai/alkemi-mcp

Example Claude Desktop MCP server config (npx):

{
  "mcpServers": {
    "alkemi": {
      "command": "npx",
      "args": ["@alkemiai/alkemi-mcp"],
      "env": { "BEARER_TOKEN": "sk-12345" }
    }
  }
}

Example using a built node binary:

{
  "mcpServers": {
    "alkemi-data": {
      "command": "node",
      "args": ["/path/to/alkemi-mcp/build/index.js"],
      "env": { "BEARER_TOKEN": "sk-12345" }
    }
  }
}

Environment variables

VariableRequiredDescription
BEARER_TOKENYesAPI key for the Streamable HTTP MCP endpoint (from datalab.alkemi.ai)
MCP_NAMENoName used in MCP Client; required if running multiple Alkemi MCP servers
PRODUCT_IDNoLimit the server to a single Alkemi Product (scoped queries)

Get an API key: https://datalab.alkemi.ai

Available Tools / Resources

  • GitHub repo: https://github.com/alkemi-ai/alkemi-mcp
  • MCP Inspector (debugging stdio communications)
    • Included as an npm script: npm run inspector
    • Opens a browser debugging UI for MCP messages and payloads
  • Alkemi API docs: endpoint used is https://api.alkemi.cloud/mcp
  • Model Context Protocol spec: https://modelcontextprotocol.io/introduction

Use Cases

  • Plain-English analytics for analysts: “Show last quarter revenue by region for products in category X” — the MCP Client sends this text to the Alkemi MCP Server, which uses Alkemi to generate the correct SQL against Snowflake and returns tabular results.
  • Shared, audited query surface: Create separate MCP servers per business domain (customer-data, web-traffic-data) using MCP_NAME and PRODUCT_ID so teams have consistent queries and permissions.
  • Rapid prototyping: Run the server via npx for quick demos without installing or building the repository.
  • Multi-source joins: Ask cross-source questions that Alkemi can resolve using its metadata and connectors, without embedding schema knowledge in each agent.

Concrete example flow

  1. Analyst asks natural language query in an MCP client.
  2. Client sends an MCP request over stdio to the Alkemi MCP Server.
  3. Server forwards the request to https://api.alkemi.cloud/mcp with BEARER_TOKEN.
  4. Alkemi generates the SQL, executes it on the configured data warehouse, and returns results.
  5. Server streams the result back to the MCP client to present to the analyst.

Development & Debugging

  • Use npm run watch for iterative development.
  • Debug STDIO interactions using npm run inspector to visualize MCP messages and payloads.
  • Because communications are over stdio, logs may be interleaved — the Inspector helps isolate request/response cycles.

Security & Best Practices

  • Keep BEARER_TOKEN secret; do not commit tokens to source control.
  • Use PRODUCT_ID to scope access for principle-of-least-privilege when exposing an MCP server to a wider group.
  • Run each domain as a distinct MCP server (MCP_NAME) when different teams need different datasets or access controls.

For more details and examples, see the GitHub repository: https://github.com/alkemi-ai/alkemi-mcp