mysql-context-mcp
Provides tools for retrieving recent MySQL row changes, fetching diffs, and acknowledging changes, using outbox or watermark modes to track row-level before/after modifications.
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., "@mysql-context-mcpWhat's changed in MySQL since I last checked?"
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.
mysql-context-mcp
Light stdio MCP server. Agents pull compact MySQL row diffs into context. No UI, no replica, no Kafka.
License: MIT. Do not commit DSNs. See SECURITY.md.
Modes
Mode | What you get | Deploy cost |
outbox (default) | Real before/after from table triggers | One extra table + 3 triggers per watched table |
watermark | Rows newer than | Config only |
Related MCP server: MySQL MCP Server
Setup
git clone https://github.com/velinussage/mysql-context-mcp.git
cd mysql-context-mcp
npm install
cp config.example.yaml mysql-context.yaml
export MYSQL_CONTEXT_DSN='mysql://user@127.0.0.1:3306/app'Put the password in the environment DSN, not in the YAML. Edit tables: to the few tables agents should see.
Install triggers once, from a privileged shell — not from the agent:
npx tsx src/install.tsAfter that, run the MCP with a user that can only SELECT watched tables and SELECT/UPDATE the outbox table.
Tools
Tool | Use |
| Default pull. Unacked diffs, capped, JSON. |
| One change ( |
| Mark seen so they leave the next pull. |
There is no execute_sql and no install tool on the MCP server.
Attach to a harness
Claude Code / Grok / Cursor (project .mcp.json):
{
"mcpServers": {
"mysql-context": {
"command": "npx",
"args": ["tsx", "src/server.ts"],
"cwd": ".",
"env": {
"MYSQL_CONTEXT_CONFIG": "./mysql-context.yaml",
"MYSQL_CONTEXT_DSN": "${MYSQL_CONTEXT_DSN}"
}
}
}
}Set cwd to the clone. Keep MYSQL_CONTEXT_DSN in the process environment, not in a committed file.
Claude Agent SDK:
import { query } from "@anthropic-ai/claude-agent-sdk";
for await (const message of query({
prompt: "What changed in MySQL since last look? Use recent_changes.",
options: {
mcpServers: {
"mysql-context": {
command: "npx",
args: ["tsx", "src/server.ts"],
env: {
MYSQL_CONTEXT_CONFIG: "./mysql-context.yaml",
MYSQL_CONTEXT_DSN: process.env.MYSQL_CONTEXT_DSN!,
},
},
},
allowedTools: [
"mcp__mysql-context__recent_changes",
"mcp__mysql-context__get_diff",
"mcp__mysql-context__ack_changes",
],
},
})) {
// ...
}Skill
Copy skill/mysql-context/SKILL.md into the project .claude/skills/ or .grok/skills/ so the agent calls recent_changes before reasoning about live rows.
When this is the wrong tool
You need a full history of every row forever — use a binlog indexer
You need a live analytics replica — use a CDC replica
You need the agent to run arbitrary SQL — do not add that here
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
- Alicense-qualityDmaintenanceEnables AI agents to safely interact with MySQL/MariaDB databases, supporting read-only queries by default with optional write operations and access control.MIT
- Flicense-qualityDmaintenanceEnables AI agents to interact with a MySQL database using natural language, automating SQL tasks like querying, inserting, updating, and deleting data.1
- AlicenseAqualityCmaintenanceEnables AI agents to dynamically register and query MySQL-compatible databases at runtime with built-in destructive SQL protection.61MIT
- Alicense-qualityCmaintenanceEnables AI agents to interact with PostgreSQL or MySQL databases using natural language. Supports SQL queries, schema discovery, and pre-built aggregations without writing SQL.310MIT
Related MCP Connectors
An agent-friendly API for product changelogs. A unified registry via CLI, API, or MCP.
The agent-native cloud: database, functions, AI, storage, computers. 50 tools, one API key.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
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/velinussage/mysql-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server