Mcp Data Analyst — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Mcp Data Analyst (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A Model Context Protocol (MCP) server that enables natural language querying of SQL databases using AI. Connect your database and ask questions in plain English - the server will generate and execute SQL queries for you.
cd /path/to/your/workspace python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txtCopy the example below and create a .env file:
# LLM Configuration
LLM_API_KEY=your-api-key-here
LLM_MODEL=gpt-3.5-turbo
LLM_API_URL=https://api.openai.com/v1
# Database Configuration
DB_TYPE=mysql # mysql|postgresql|mssql|mongodb|sqlite|ssas|elasticsearch|influxdb
DB_HOST=127.0.0.1
DB_PORT=3306 # 5432 (PostgreSQL), 1433 (MSSQL), 27017 (MongoDB), 2383 (SSAS), 9200 (Elasticsearch), 8086 (InfluxDB)
DB_USER=root
DB_PASSWORD=your-password
DB_NAME=your-database-name # For InfluxDB: database name; for SSAS/Elasticsearch: catalog/index database name
# SQLite only
# DB_PATH=database.dbStart the server using the standard MCP stdio transport:
python server.pyThe server will:
The server exposes 3 tools that can be called by MCP clients:
#### 1. query_database_with_prompt Ask questions in natural language and get SQL results.
# Example: "Show me the top 5 customers by total purchases"
{
"success": true,
"query": "SELECT c.name, SUM(o.total) as total_purchases FROM customers c...",
"data": [...]
}#### 2. get_database_schema Retrieve the complete database schema.
{
"success": true,
"schema": {
"users": {
"name": "users",
"columns": {...}
}
}
}#### 3. build_db_definition Rebuild the schema cache from the database.
{
"success": true,
"message": "Successfully loaded schema for 8 tables",
"tables": ["users", "orders", "products", ...]
}To use this server with an MCP client (like Claude Desktop), add it to your MCP configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"data-analyst": {
"command": "python",
"args": ["/path/to/mcp-data-analyst/server.py"],
"env": {
"LLM_API_KEY": "your-key",
"DB_TYPE": "mysql",
"DB_HOST": "localhost",
"DB_NAME": "your_db"
}
}
}
}DataAnalyst/database/Type/ (e.g., SQLite.py)BaseDatabase abstract class__init__, execute_query, build_definition, closeDbTypes enumDataAnalyst/database/Type/__init__.py to export your classserver.py to handle the new database typeQuery: "Show me the top 10 customers by total order value"
Generated SQL:
SELECT c.customer_name, SUM(o.total_amount) as total_value
FROM customers c
JOIN orders o ON c.id = o.customer_id
GROUP BY c.id, c.customer_name
ORDER BY total_value DESC
LIMIT 10;Query: "Which products are low in stock (less than 10 units)?"
Generated SQL:
SELECT product_name, quantity_in_stock
FROM products
WHERE quantity_in_stock < 10
ORDER BY quantity_in_stock ASC;Contributions are welcome! Please ensure:
BaseDatabaseFor issues, questions, or contributions, please open an issue on the repository.
Built with:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.