MCP Server
Enables natural-language querying of structured data via Model Context Protocol, allowing AI agents to answer questions without SQL or API knowledge.
README
MCP Server
Natural-language data querying via Model Context Protocol (MCP)
Built by: KMan | AI-Augmented Engineering Factory
What This Is
An MCP Server that wraps a client's internal API, enabling AI agents to answer natural-language questions against the connected dataset. Users query structured data using conversational language — no SQL, no API knowledge required.
Architecture
MCP Client (Claude Desktop, custom clients)
│
│ JSON-RPC 2.0 over stdio
▼
┌─────────────────────────────────────────────────┐
│ MCP Server (FastMCP) │
│ ├── query_dataset — NL query against dataset │
│ ├── aggregate_data — count/sum/avg/min/max │
│ ├── search_similar — vector similarity search │
│ ├── list_collections — available data sources │
│ ├── describe_collection — schema inspection │
│ └── export_data — CSV/JSON export │
│ │
│ Agents: Query Understanding → Retrieval → NL │
└─────────────────────────────────────────────────┘
│
│ httpx (mock in PoC, real API in production)
▼
Client Internal API
Quick Start
# 1. Clone and install
git clone https://github.com/9KMan/JOB-20260613144931-000091.git
cd JOB-20260613144931-000091
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
# 2. Configure (edit config.yaml)
cp config.yaml config.local.yaml
# 3. Run
python -m mcp_server.main
# 4. Test
curl http://localhost:8000/health
# 5. Run tests
pytest tests/ -v
Docker
docker compose up --build
curl http://localhost:8000/health
Tech Stack
| Layer | Technology |
|---|---|
| Runtime | Python 3.11+ |
| MCP Framework | FastMCP (mcp Python SDK) |
| Web | FastAPI |
| Database | SQLite (PoC) / PostgreSQL (prod) |
| HTTP Client | httpx |
| Config | pydantic-settings |
Project Structure
src/mcp_server/
├── __init__.py # Package entry
├── __version__.py # Version
├── config.py # Settings management
├── database.py # ORM models (SQLAlchemy async)
├── cache.py # In-memory TTL cache
├── main.py # FastMCP server + REST endpoints
└── agents/
├── query_understanding.py # Intent classification
├── data_retrieval.py # API client (mock in PoC)
└── response_synthesis.py # NL response generation
Configuration
Copy config.yaml to config.local.yaml and set:
| Variable | Description | Default |
|---|---|---|
internal_api_url |
Internal API base URL | https://internal-api.example.com |
internal_api_key |
Internal API key | *** |
database_url |
SQLite or PostgreSQL URL | sqlite+aiosqlite://... |
anthropic_api_key |
Anthropic API key | (optional for PoC) |
mcp_api_key |
MCP authentication | mcp_secret... |
MCP Tools
| Tool | Description |
|---|---|
query_dataset |
Execute natural-language query against dataset |
aggregate_data |
Perform count/sum/avg/min/max aggregations |
search_similar |
Vector similarity search (pgvector in prod) |
list_collections |
List available data collections |
describe_collection |
Show schema for a collection |
export_data |
Export results as CSV/JSON |
Business Problem Solved
Domain experts typically need engineering support to query internal data. This MCP Server lets them ask questions in plain English — "What were our Q3 sales by region?" — and get structured answers immediately, without writing SQL or understanding the underlying API schema.
Limitations
⚠️ This is a PoC build. See OUT_OF_SCOPE.md for what's explicitly excluded.
- Only mock data in PoC (no real API calls)
- SQLite database (not production PostgreSQL)
- Static API key auth (no OAuth2)
- Rule-based query understanding (no LLM in PoC)
- No multi-tenancy
Deploy to Production
- Replace
DataRetrievalAgentwith real httpx calls to your internal API - Switch
database_urlfrom SQLite to PostgreSQL + pgvector - Add TLS termination in front of the server
- Replace static API key auth with OAuth2/OIDC
- Review
OUT_OF_SCOPE.mdfor full checklist
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.