rusyasoft
MCP Serverrusyasoftpublic

nl2sql mcp nextjs

nl2sql MCP nextJS

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
MIT License
License

About This Server

nl2sql MCP nextJS

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Natural Language to SQL MCP Server

Built with Next.js and @vercel/mcp-adapter

Overview

This project is a Model Context Protocol (MCP) server that provides natural language to SQL conversion capabilities using Google's Gemini AI. It allows users to write queries in plain English which get translated into SQL statements based on predefined database schemas.

Features

  • Natural Language to SQL Conversion: Converts plain English queries to SQL using Gemini AI
  • Database Schema Awareness: Includes schema definitions for employees, departments, and projects tables
  • Additional Utility Tools:
    • Unit conversion (temperature, distance, weight)
    • Date formatting
    • Mathematical calculations
    • Echo functionality for testing

Setup

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Create a .env file with your Gemini API key:
    GEMINI_API_KEY=your_api_key_here
    
  4. Run the development server:
    npm run dev
    

Database Schemas

The project includes predefined SQL schemas in the app/schemas directory for:

  • employees: Employee records with personal details, salary, and department information
  • departments: Department information including name, location, and budget
  • projects: Project details including status, budget, and timeline

Deployment Notes

This project is ready to deploy on Vercel with the following considerations:

  • For Server-Sent Events (SSE) transport, add a Redis instance to your Vercel project and set REDIS_URL environment variable (optional and not even needed. I still don't know why it is needed)
  • Enable Fluid compute for efficient execution
  • Set the GEMINI_API_KEY environment variable in your Vercel project settings
  • For Pro/Enterprise accounts, adjust maxDuration to 800 in the app configuration. Yes this means you cannot run this MCP server on Vercel for free tier.

Connect Claude Desktop to your MCP server

You can connect to your MCP server from Claude Desktop by following Anthropic's Quickstart and within Claude Desktop go to Settings > Developer > Edit Config.

Update with this configuration (mcp_config.json):

{
  "mcpServers": {
    "RustamMCP-Server": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:3000/mcp" 
      ]
    }
  }
}
  • Restart Claude and you should see the tools become available. (haven't tested yet)

  • Have tested with Windsurf AI and it works

Testing

Example queries to try:

  • "Find all employees in the IT department earning over 70k"
  • "Show me the projects with budgets over 100k"
  • "List managers with the most direct reports"

Quick Start

1

Clone the repository

git clone https://github.com/rusyasoft/nl2sql-mcp-nextjs
2

Install dependencies

cd nl2sql-mcp-nextjs
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerrusyasoft
Reponl2sql-mcp-nextjs
LanguageTypeScript
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation