Skip to main content
Glama
andrebarrocas

Local Data Engineering MCP

README.md
# Local Data Engineering MCP

A minimal MCP server that lets an AI agent inspect a mock data platform without cloud credentials. It uses SQLite data for customers, orders, products, and local pipeline status.

## Architecture

- `src/server.py` registers five read-only tools with the official Python MCP SDK.
- `src/data_service.py` creates and queries the local SQLite demo database.
- `src/models.py` defines the tools' structured outputs; `tests/` covers the service and MCP interface.

## Available MCP tools

- `get_table_schema(table_name)`
- `get_table_row_count(table_name)`
- `get_table_freshness(table_name)`
- `run_readonly_query(query)` — accepts one `SELECT` and returns at most 100 rows
- `get_pipeline_status(pipeline_name)`

## Installation

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

## How to run it

Start the stdio server:

```bash
mcp run src/server.py
```

For interactive development, run `mcp dev src/server.py` to open MCP Inspector.

## Example interaction

```text
User: Why is the orders table stale?

Agent:
1. get_table_freshness("orders") -> status: stale, age_hours: 71.0
2. get_pipeline_status("orders_pipeline") -> status: failed
3. get_table_schema("orders") -> order_id, customer_id, product_id,
   quantity, ordered_at, updated_at

Conclusion: the orders pipeline timed out, so no new orders were loaded.
```