Crismarquez/mcp-server-sql
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.
Sales Analytics MCP Server
Tools for querying sales data via Model Context Protocol with pluggable database connectors (Databricks, PostgreSQL, Azure SQL, or Mock).
Setup
- Create and activate a virtualenv (optional)
- Install deps:
pip install -r requirements.txt
- 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)
- Build the Docker image (once):
docker build -t sales-mcp .
-
On Windows, create/edit the Claude Desktop config file at:
%APPDATA%\Claude\claude_desktop_config.json -
Add this configuration to run the MCP inside Docker:
{
"mcpServers": {
"sales-analytics": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "DB_TYPE=mock",
"sales-mcp"
]
}
}
}
- 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.