Dynamic-Smart
Intelligent SQL Database/API Interface with Natural Language Support, MCP server can connect to any database/API with just a few steps
claude mcp add --transport stdio uaepro-dynamic-smart-mcp python main.py \ --env DB_TYPE="your-database-type (e.g., mysql, postgres, sqlite)" \ --env DATABASE_URL="your-database-connection-string-or-path" \ --env OPENAI_API_KEY="your-openai-api-key"
How to use
Dynamic-Smart is a production-ready MCP server that connects to any SQL database and translates natural language questions into SQL queries using AI. It uses a read-only, safety-first approach to generate and execute queries, automatically discovering your database schema and offering a straightforward natural language interface for data exploration. With OpenAI integration and SQLAlchemy for universal database access, you can ask questions like 'Show me customers from last quarter' or 'What is the total revenue by category?' and receive SQL-backed results. The server emphasizes zero-configuration operation and is designed to work with existing schemas without extensive setup. To use it, configure your database connection in config.yaml or via environment variables, ensure your OpenAI API key is set, and start the server using the main.py entry point. The included tools parse NL input, generate safe SQL, and fetch results, with safeguards such as read-only defaults, keyword blacklists, and row-limiting to protect your data. Once running, you can issue natural language queries through the server's endpoints and leverage the automatic schema detection to simplify query formulation while retaining control over security and performance.
How to install
Prerequisites:
- Python 3.8+ installed on the host
- Access to a SQL-compatible database (MySQL, PostgreSQL, SQLite, SQL Server, Oracle, etc.)
- Optional: OpenAI API key if you want AI-powered NL to SQL translation
-
Clone the repository or download the release package
-
Set up a Python virtual environment
python3 -m venv .venv
- Activate the virtual environment
- Linux/Mac:
source .venv/bin/activate
- Windows:
.venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Configure environment variables and/or config.yaml
- Set OPENAI_API_KEY if using AI features
- Provide DATABASE_URL and DB_TYPE (e.g., mysql, postgres, sqlite) in config.yaml or via environment variables
- Generate or verify schema and configuration
python generate_schema.py
- Run the server
python main.py
Optional: If you need to customize the MCP starting protocol, you may edit main.py in the main function to adjust the starting behavior.
Additional notes
Tips and common issues:
- Ensure your database user has read-only access (as the server is designed for safe, read-only querying by default).
- If you encounter authentication or API key issues, verify that OPENAI_API_KEY is correctly exported in your environment or defined in config.yaml.
- The server relies on automatic schema detection; ensure your database user has permissions to read schema information.
- For large databases, consider enabling row limits and query timeouts to protect performance and avoid long-running queries.
- If you run into connection problems, double-check DATABASE_URL formatting for your specific DB type and ensure network access is allowed.
- Review docs in docs/ for deeper configuration options and security best practices.
Related MCP Servers
jupyter
🪐 🔧 Model Context Protocol (MCP) Server for Jupyter.
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
falcon
Connect AI agents to CrowdStrike Falcon for automated security analysis and threat hunting
beemcp
BeeMCP: an unofficial Model Context Protocol (MCP) server that connects your Bee wearable lifelogger to AI via the Model Context Protocol
MCP-MultiServer-Interoperable-Agent2Agent-LangGraph-AI-System
This project demonstrates a decoupled real-time agent architecture that connects LangGraph agents to remote tools served by custom MCP (Modular Command Protocol) servers. The architecture enables a flexible and scalable multi-agent system where each tool can be hosted independently (via SSE or STDIO), offering modularity and cloud-deployable execut
Helios
An AI IDE secure coding MCP service