Schema map for data analyst and text-to-SQL agents: join paths, keys, grain and status codes served to LLM agents over MCP, CLI --json or markdown, plus an offline explorer. MySQL, PostgreSQL, SQLite,
keygraph is an open-source schema map for people building a data analyst agent, a text-to-SQL agent or any other LLM agent that answers questions from a database. It maps how your tables connect (keys, indexes, declared and inferred foreign keys, grain, status codes, business context and value profiles) and serves that schema context to agents through an MCP server, a CLI with --json, or markdown files, and to people through an offline HTML explorer. It reads only metadata, makes no LLM calls, and gives the same output for the same input. It can also link your source code to the same tables and columns (where each column is declared, written, read and used) and keep a log of the queries people and agents ran, with their timing and the business question behind them.
At a glance. MIT licence. Python 3.11 or newer. Reads MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, ClickHouse, Metabase and MongoDB, or informationschema dumps. Fifteen MCP tools: fourteen read-only and one that logs a query. Runs without a server, and the bundled demo webshop has 35 tables in three schemas. Jump to: build a data analyst agent, quickstart, MCP setup, FAQ.
Why a prebuilt map beats no context or context made on the fly
An agent that writes SQL needs to know which tables exist, how they join, what one row means and what the codes in a column stand for. There are three ways to give it that.
No context at all. The agent guesses table names and joins on columns that look alike. It cannot see that a table holds one row per order line rather than per order, so its sums double count. It does not kn
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/alikarami76--keygraph.html)
Your coding agent answers with dashboards, not paragraphs. An MCP server for Claude Code, Codex, Cursor, Gemini CLI and more: charts and tables from read-only SQL on Postgres, SQLite, Excel or CSV, in
thaildhe172591/pythiaPL/SQL development for AI agents on Oracle Database - expert queries, impact analysis, and a snapshot-verified write path with honest rollback
notinferred/halfnineA light TablePlus alternative for PostgreSQL that your AI agents can use too, over MCP. macOS and Windows.
macolszewski/dbeast_managerFast native database client for PostgreSQL, MySQL and SQLite, written in Rust: SQL console, editable result grid, query plans, schema graph, data transfer and a secure MCP server for AI agents.
systempromptio/systemprompt-demoAI Governance Infrastructure — open gateway demo. Self-hosted systemprompt.io gateway in a single Rust binary: policy, audit trails, and cost attribution on every AI request, with the Systemprompt Bri
azimov777/casefileThe task tracker your AI agents keep for each other: every task carries a case file, so the next agent picks up where the last one stopped. MCP server + live board. Self-hosted, one-line install.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.