mcp-data-agent
Provides tools for querying and analyzing a SQLite sales database, including listing tables, running read-only SQL queries, computing column statistics, and generating bar charts.
Click on "Install 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., "@mcp-data-agentWhat is the total revenue by region?"
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.
MCP Data Agent
A real Model Context Protocol (MCP) server exposing data-analyst tools over a sales database, plus an LLM agent (Gemini) that discovers those tools at runtime and decides which to call to answer a question — the actual point of MCP being that the tool definitions live on the server, not hardcoded into the agent.
Why this is a real MCP implementation, not a mock
src/mcp_server.pyis a genuine MCP server, built on the officialmcpPython SDK, exposing 4 tools (list_tables,run_sql_query,get_column_stats,plot_bar_chart) over the standard stdio transport.src/smoke_test_client.pyis a protocol-level test with no LLM involved at all — it launches the server as a real subprocess, connects over stdio, callslist_tools(), and callsrun_sql_querythrough the actual MCP wire protocol. This is what proves the server works, independent of whether the agent on top of it works.src/mcp_client_agent.pyis the agent: it lists the server's tools, converts their JSON schemas directly into Gemini function declarations (parameters_json_schema=tool.input_schema— no manual schema translation), and runs the standard tool-calling loop: ask the model → execute any requested tool call via the real MCP session → feed the result back → repeat until the model gives a final answer.
Related MCP server: agente-ecommerce-mcp-memoria
Requires Python 3.10+
The mcp package doesn't support Python 3.9. If your default python is
older, use py -3.12 (or whichever 3.10+ interpreter you have) for every
command below.
Pipeline
pip install -r requirements.txt
python src/generate_data.py # -> data/sales.db (3,000 synthetic orders)
python src/smoke_test_client.py # protocol-only sanity check, no LLM
python src/mcp_client_agent.py "Which category has the highest revenue?"Without GEMINI_API_KEY set, mcp_client_agent.py runs a manual fallback:
it lists the tools discovered from the live server and calls one directly,
so the MCP plumbing is demonstrable with zero API keys. With a key (copy
.env.example to .env), it runs the full agent loop.
Tests
tests/test_pipeline.py calls the server's tool functions directly (schema
introspection, SQL rejection of non-SELECT statements, stats), and — the
real proof this is a working MCP implementation — runs
smoke_test_client.py, which launches the server as an actual subprocess
and talks to it over the real stdio protocol. No API key needed, so this
runs in CI on every push, on Python 3.12.
pip install -r requirements.txt pytest
pytest tests/ -vTools exposed by the server
Tool | Purpose |
| Schema introspection |
| Read-only SQL — rejects anything that isn't a |
| Summary stats for |
| Aggregates by region/category and saves a PNG |
Verified vs. not independently verified
Verified: the MCP server and protocol wiring (tool discovery, tool execution over stdio) —
smoke_test_client.pyruns it end to end with no LLM in the loop, and the manual fallback path inmcp_client_agent.pyexercises the same real protocol.Implemented against the current
google-genaiSDK, not run against a live key in this environment: the Gemini tool-calling loop itself. The function-declaration and function-response types were checked directly against the installed SDK, but the actual multi-turn call requires an API key this environment doesn't have. Run it with your ownGEMINI_API_KEYto exercise that path.
Project structure
data/ generated sales.db
src/ mcp_server, smoke_test_client, mcp_client_agent, generate_data
reports/ charts saved by plot_bar_chartStack
Python 3.12 · mcp (official Model Context Protocol SDK) · google-genai ·
SQLite · matplotlib
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceA production-grade MCP server for enterprise sales analytics, enabling LLM clients to query, analyze, and visualize sales data from a SQLite database through structured tools, resources, and prompts.6MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that exposes a LangChain agent with short-term memory to analyze real e-commerce data through predefined SQL tools, enabling natural language queries on sales, customers, and logistics.
- FlicenseNot gradedqualityCmaintenanceMCP server that routes natural language queries to backend analytics tools (Sales, Finance, Customer, Service) using Google Gemini's function calling.
- AlicenseNot gradedqualityCmaintenanceA production-style MCP server exposing six business tools (web search, database, CRM, email, calendar, analytics) to AI clients via a secure, authenticated interface, with mock mode and a reference agent client.MIT
Related MCP Connectors
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
GibsonAI MCP server: manage your databases with natural language
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dhandashreya/mcp-data-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server