Smart MCP Server
Connects to MariaDB databases, automatically detects schema, and enables natural language questions to be converted into safe, read-only SQL queries.
Connects to MySQL databases, automatically detects schema, and enables natural language questions to be converted into safe, read-only SQL queries.
Uses the OpenAI API for natural language processing to translate plain English questions into SQL queries.
Connects to PostgreSQL databases, automatically detects schema, and enables natural language questions to be converted into safe, read-only SQL queries.
Connects to SQLite databases, automatically detects schema, and enables natural language questions to be converted into safe, read-only SQL queries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Smart MCP ServerShow me the top 5 customers by total order value this year"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Smart MCP Server š
Intelligent SQL Database Interface with Natural Language Support
A production-ready FastMCP 2 server that connects to any SQL database (MySQL, PostgreSQL, SQLite, SQL Server, Oracle, etc.) and converts natural language questions into SQL queries using AI.
⨠Features
š Universal Database Support: MySQL, PostgreSQL, SQLite, SQL Server, Oracle, MariaDB
š§ Natural Language to SQL: Ask questions in plain English, get SQL results
š Auto-Schema Detection: Automatically scans and understands your database structure
š”ļø Safety First: Read-only by default, blocks dangerous operations
ā” FastMCP 2 Powered: Modern, efficient MCP server implementation
šÆ Zero Configuration: Works with any schema without prior setup
š§ Extensible: Clean, documented code for easy customization
Related MCP server: mcp-db-server
š Documentation
All documentation is organized in the docs/ folder with priority numbers for easy reading order.
Quick Links:
docs/00_READ_ME_FIRST.md - š Start here!
docs/01_QUICKSTART.md - š Get running in 5 minutes
docs/02_DATABASE_DOCUMENTATION_GUIDE.md - Document your DB for better queries
docs/03_PRODUCTION_SECURITY.md - š Security guide (CRITICAL)
ā See docs/00_READ_ME_FIRST.md for complete reading order
š Quick Start
1. Crate Environment
python3 -m venv .venvOn Linux/Mac:
source .venv/bin/activateOn Windows:
.venv\Scripts\activate2. Install Dependencies
pip install -r requirements.txt3. Edit config.yaml with LLM connector and Database Connector
you can also setup the key from .env file
4. Run the automatic database Schema generator
python generate_schema.py5. Run the Server
python main.pyyou might need to edit the main.py in the main function to change the MCP starting protocol
šÆ Example Queries
Try these natural language questions:
"Show me all customers"
"What are the top 5 most expensive products?"
"Show me orders with customer names"
"What is the total revenue by category?"
"List customers who placed orders in the last 30 days"š ļø Tech Stack
FastMCP 2 - MCP server framework
SQLAlchemy 2.x - Universal database adapter
OpenAI API - Natural language processing
Python 3.8+ - Core language
š¦ Project Structure
SmartMCP/
āāā main.py # Server entry point
āāā config.yaml # Configuration
āāā requirements.txt # Dependencies
āāā example_database.py # Sample data generator
āāā test_setup.py # Setup verification
āāā db/adapter.py # Database connector
āāā nlp/query_parser.py # NL to SQL parser
āāā mcp/tools.py # MCP tool definitions
āāā utils/schema.py # Schema utilitiesš Learn More
QUICKSTART.md - Step-by-step setup guide
ARCHITECTURE.md - System design deep dive
PROJECT_SUMMARY.md - Complete feature list
README.md - Full documentation with examples
š Safety Features
ā Read-only by default
ā Keyword blacklist (DROP, DELETE, etc.)
ā SQL injection prevention
ā Row limits (max 1000 per query)
ā Environment variable for secrets
š License
MIT License - Free to use, modify, and distribute!
Built with ā¤ļø and AI :P for the MCP community
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask questions in plain language, get answers from your business database. No SQL required.
Ask business questions in plain English. Get instant answers from your database, no SQL needed.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Ask your databases questions in plain English, run read-only SQL and set up data alerts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables read-only access to MySQL databases through natural language queries. Provides automatic table schema discovery and executes SELECT, SHOW, DESCRIBE, and EXPLAIN statements within secure read-only transactions.MIT
- FlicenseNot gradedqualityDmaintenanceEnables querying PostgreSQL and MySQL databases using natural language, with RESTful endpoints for listing tables, describing schemas, and executing read-only queries.1-
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of any SQL database by converting plain English questions into SQL queries, with auto-schema detection and safety features.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.1MIT