mcp-server-sql

Crismarquez/mcp-server-sql

3.1

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

Sales Analytics MCP Server provides tools for querying sales data via Model Context Protocol with pluggable database connectors.

Tools
3
Resources
0
Prompts
0

Sales Analytics MCP Server

Tools for querying sales data via Model Context Protocol with pluggable database connectors (Databricks, PostgreSQL, Azure SQL, or Mock).

Setup

  1. Create and activate a virtualenv (optional)
  2. Install deps:
pip install -r requirements.txt
  1. Copy env template and configure:
copy .env.example .env

Environment

  • DB_TYPE: one of databricks, postgres, azure, mock (default: mock)
  • DB_CONN_STR: SQLAlchemy connection string for selected DB (not needed for mock)

Connection string examples

  • Databricks: databricks+connector://token:@/.
  • PostgreSQL: postgresql+psycopg2://user:password@host:5432/dbname
  • Azure SQL: mssql+pyodbc://USER:PASSWORD@SERVER.database.windows.net:1433/DB?driver=ODBC+Driver+18+for+SQL+Server&Encrypt=yes&TrustServerCertificate=no

Run

python main.py

Docker

docker build -t sales-mcp .
docker run --rm -e DB_TYPE=mock sales-mcp

Tools

  • best_sellers_by_region(region: str)
  • top_products(limit: int = 5)
  • sales_by_date(date: str)

Claude Desktop (local connection)

  1. Build the Docker image (once):
docker build -t sales-mcp .
  1. On Windows, create/edit the Claude Desktop config file at: %APPDATA%\Claude\claude_desktop_config.json

  2. Add this configuration to run the MCP inside Docker:

{
    "mcpServers": {
        "sales-analytics": {
            "command": "docker",
            "args": [
                "run", "--rm", "-i",
                "-e", "DB_TYPE=mock",
                "sales-mcp"
            ]
        }
    }
}
  1. Save the file and restart Claude Desktop.

Note: If you want to use a connector other than mock, set DB_TYPE accordingly and, if needed, add -e DB_CONN_STR=... following the "Environment" section of this README.