Skip to main content
Glama
MCP-Server-data

MCP-Server-data

by nishant264

✨ Gemini + MCP Playground

An AI agent that uses Google Gemini and the Model Context Protocol (MCP) to securely interact with data and tools.

Built with Streamlit, Gemini, Agno, and a custom MCP server β€” no Docker needed!


πŸ† Why This Project?

This showcases AI Engineering skills:

Skill

How It's Shown

AI Agent Architecture

Google Gemini + Agno agent that decides which tools to call

MCP Protocol

Custom MCP server with read-only SQL tools + security guardrails

Security Engineering

Guards blocking dangerous queries (DELETE, DROP, etc.)

Full-Stack AI

Streamlit UI + AI backend + local database

Practical Features

One-click CSV/JSON/Markdown export


Related MCP server: MCP DB Server

✨ Features

  • Natural Language Queries β€” Ask questions in plain English about a sample e-commerce database

  • Custom MCP Server β€” A local server that translates AI requests into safe database queries

  • πŸ”’ Security Guardrails β€” Only SELECT queries allowed; all modifications blocked

  • Multiple Export Formats β€” Download results as CSV, JSON, or Markdown with one click

  • AI-Assisted Export β€” Just say "export this as CSV" and the AI handles it

  • Tool Transparency β€” See exactly which tools the AI calls and what SQL it writes


🧠 How It Works

You: "Show me all products over $50"
                β”‚
                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Streamlit Web App (github_agent.py)  β”‚
β”‚                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Gemini (Google AI)             β”‚  β”‚
β”‚  β”‚  β€’ Understands your question    β”‚  β”‚
β”‚  β”‚  β€’ Decides which tool to call   β”‚  β”‚
β”‚  β”‚  β€’ Formats the answer           β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚             β”‚ MCP Protocol             β”‚
β”‚             β–Ό                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  MCP Server (db_mcp_server.py)   β”‚  β”‚
β”‚  β”‚  β€’ Validates query (read-only?) β”‚  β”‚
β”‚  β”‚  β€’ Runs SELECT on SQLite DB     β”‚  β”‚
β”‚  β”‚  β€’ Returns formatted results    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚             β”‚                          β”‚
β”‚             β–Ό                          β”‚
β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚     β”‚  store.db    β”‚  (SQLite file)    β”‚
β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Requirements

No Docker. No GitHub token. No OpenAI key.

Installation

# 1. Install dependencies
pip install -r requirements.txt

# 2. Generate the sample database
python seed_db.py

# 3. Start the app
streamlit run github_agent.py

Usage

  1. Enter your Gemini API key in the sidebar (get one free at aistudio.google.com/apikey)

  2. Type a question about the store data β€” e.g., "Show me all products under $50"

  3. Click "Run Query" and watch the AI work!

  4. Export results using the download buttons below the response


πŸ’¬ Example Queries

Try asking the AI:

πŸ” "Show me all products sorted by price"
πŸ” "Which customers have placed the most orders?"
πŸ” "What's the total revenue from last month?"
πŸ” "Show me orders that haven't shipped yet"
πŸ” "Export all products as CSV"
πŸ” "How many customers do we have from each city?"

πŸ“ Project Structure

File

Purpose

github_agent.py

Main Streamlit app β€” UI + AI agent connection

db_mcp_server.py

Custom MCP server β€” read-only SQL tools + export

seed_db.py

Script to generate the sample database

store.db

SQLite database with sample e-commerce data

requirements.txt

Python dependencies

exports/

Folder where exported files are saved (created on first export)


πŸ—„οΈ Database Schema

The sample database (store.db) contains 5 tables with 30 orders, 25 products, and 10 customers:

Table

Description

categories

Product categories (Electronics, Clothing, Books, etc.)

products

Items for sale with prices and stock

customers

Customer information

orders

Orders placed with status (delivered, shipped, etc.)

order_items

Individual products within each order


πŸ”’ Security Guardrails

The MCP server has layers of protection:

  1. Keyword blocking β€” Queries starting with DELETE, DROP, INSERT, UPDATE, etc. are rejected

  2. Multi-statement detection β€” Multiple SQL statements separated by ; are individually checked

  3. Result limiting β€” Maximum 100 rows returned per query

  4. Read-only export β€” Export tool also validates queries before writing files


πŸ› οΈ Tech Stack

Technology

Role

Streamlit

Web UI framework

Google Gemini

AI model (via google-generativeai)

Agno

AI agent framework

MCP

Model Context Protocol (tool communication standard)

SQLite

Local database (built into Python)


πŸ“ License

This project is for educational purposes. Built as a demonstration of AI Agent + MCP architecture.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with SQLite databases by executing read and write queries, listing tables, and inspecting schemas. It provides a secure, local interface for database management and data retrieval through the Model Context Protocol.
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query databases via natural language using the Model Context Protocol, with automatic schema discovery, SQL query execution, and read-only safety checks.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to connect to and query an SQLite database through the Model Context Protocol, allowing natural language interaction with database tables and data.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Query, explore, and manage SQLite databases through the Model Context Protocol. Connect any MCP-compatible AI client to your databases.
      -