Skip to content

About

A chat-based interface for querying your database using natural language. Built with MCP (Model Context Protocol).

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

DataQuest - Database Query Assistant

A chat-based interface for querying your database using natural language. Built with MCP (Model Context Protocol).

Preview

Read the full article on Medium here: https://medium.com/@jonortega20/building-a-database-querier-with-mcp-17df0f49a2de

Features

  • Clean, modern UI with responsive design
  • Chat-style interface for natural language database queries
  • Real-time interaction with your PostgreSQL database
  • Supports code block formatting in responses
  • Status indicators and loading animations

Requirements

  • Python 3.11+
  • Flask
  • LangChain OpenAI
  • Postgre MCP

Installation

  1. Clone this repository

  2. Install the required Python packages:

pip install flask flask-cors langchain_openai python-dotenv
  1. Make sure you have MCP installed:
pip install mcp_use
  1. Make sure you have an OpenAI API key and your database connection string in your .env file:
OPENAI_API_KEY=your_api_key_here
DB_LINK=your_database_connection_string_here

Usage

  1. Start the Flask server:
python app.py
  1. Open your browser and navigate to:
http://localhost:5000
  1. Start asking questions about your database!

Example Queries

  • "How many users are in the database?"
  • "Show me a random user's information"
  • "What is the average age of the users?"
  • "What is the percentage of active users?"
  • "How many users are there per country?"

Created By

Jon Ortega

About

A chat-based interface for querying your database using natural language. Built with MCP (Model Context Protocol).

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages