Custom MCP · Live SQL analytics

PING Education Department - SQL MCP Server for Analytics Querying

A custom MCP server that gives Claude governed, read-only access to live education-portal SQL data so users can ask business questions in natural language and receive analysis directly from the authoritative database.

Interface
Claude + MCP
Data source
SQL Server
Access model
Governed read-only
Business context
Semantic layer

What I built

I built a purpose-specific MCP server that connects Claude to the education portal database. Claude can translate a business question into SQL, execute it through controlled tools, receive live results, and turn those results into an explanation, table, or visualization.

How the system works

NATURAL
LANGUAGE
CLAUDE
CUSTOM MCP
TOOLS
SQL SERVER
ANALYSIS +
VISUALIZATION

The MCP acts as the governed bridge between Claude and SQL. It exposes the data and query capabilities needed for education analytics while keeping the interface narrow and predictable.

Business-semantic layer

The server includes a knowledge.md layer that defines what business terms mean and how the core tables relate. For example, a completed enrollment is defined by a populated Enrollments.date_completed field.

It also encodes the portal-aware relationships required for correct joins:

  • Enrollments.user_id = Users.id and Enrollments.portal = Users.portal
  • Enrollments.course_id = Courses.id and Enrollments.portal = Courses.portal
That join logic matters: joining users only by ID inflated 157,432 enrollments to 174,834 rows because 622 user IDs occur in multiple portals. The portal-aware relationship preserves the correct row count.

Governed query tools

The MCP exposes the three tables needed for the analytics workflow—Users, Enrollments, and Courses—through query tools designed for read-only analysis. This gives Claude enough capability to answer real questions while keeping access scoped to the intended use case.

Implementation proof

Configured and running as a local MCP server

The server is registered in Claude as education-sql and launches the Python server.py process that provides the governed analytics tools.

Education SQL local MCP server shown running in Claude
Local Education SQL MCP server configured and running in Claude.
Example workflow

Question → live SQL → chart

A user can ask for a business-ready output directly. Claude uses the MCP to run the SQL and then presents the result in the requested format.

Claude prompt requesting course completion analysis through the Education SQL MCP
Natural-language request triggers the Education SQL MCP query workflow.
Bar chart of course completions returned after the SQL query
Claude returns a business-ready visualization directly from the live SQL results.