Tokenlite Mysql MCP
Überblick
Beschreibung vom Entwickler (englisches Original)
A secure, efficient, and intelligent MySQL server for the Model Context Protocol
Die drei Säulen von PopNx MCP
Diese drei werden nie zu einer Punktzahl zusammengefasst: Meinungen, Messungen und Beliebtheit sind verschiedene Dinge.
- Stimmen der NutzeriNoch keine BewertungenBewertungen starten in einem späteren Schritt zusammen mit Benutzerkonten
- Unsere Basischecksi1 von 1 bestandenAnhand öffentlicher Informationen geprüft; Code noch nicht gescannt
- NutzungiGanz neu↓ 52/Wo. · ★ –
Was du damit machen kannst
Für diesen Server haben wir noch keine Zusammenfassung in einfacher Sprache geschrieben. Unten stehen die Fakten, die wir aus der Registry gelesen haben.
- Verbindung: Läuft auf deinem Computer
- Transport: stdio
- Kategorie: Datenbanken & Datensätze
- Das musst du eintragen: DB_PASSWORD, DB_NAME
Installation
Wähle die KI-App, die du nutzt, und kopiere die Einstellungen.
Bevor du installierst
- Basischecks: 1 von 1 bestanden
- Läuft auf deinem Computer mit den Rechten deines Benutzerkontos (Dateien, Netzwerk, Apps).
- Das trägst du selbst ein:
DB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME,MCP_EXPLAIN_MAX_SCAN_ROWS,MCP_QUERY_ROW_LIMIT,MCP_SAFE_QUERY_MAX_ROWS,MCP_SAFE_QUERY_ENABLE_BLOCKING,MCP_METADATA_PATH,MCP_TEMPLATES_PATH,TOOL_PREFIX,MCP_RATE_LIMIT_RPM,MYSQL_QUERY_TIMEOUT,MYSQL_CONNECTION_LIMIT,MYSQL_CONNECT_TIMEOUT,MYSQL_RETRY_ATTEMPTS,MYSQL_RETRY_DELAY_MS,MYSQL_QUEUE_LIMIT,MCP_DDL_CACHE_TTL,MCP_LOG_LEVEL,ALLOW_INSERT_OPERATION,ALLOW_UPDATE_OPERATION,ALLOW_DELETE_OPERATION,ALLOW_DDL_OPERATION,DB_SSL,DB_SSL_REJECT_UNAUTHORIZED
Als geheim markierte Werte sind Schlüssel zu deinem Konto. Gib sie nie weiter und füge sie nie in einen Chat ein.
Du brauchst
- npmNode.js installiert (für den Befehl npx)
Welche App nutzt du?
Wähle oben deine App. Wir merken sie uns, damit der Button beim nächsten Mal „In … installieren“ anzeigt.
Öffne Claude Desktop → Settings → Developer → Edit Config und füge dies in claude_desktop_config.json ein
{
"mcpServers": {
"tokenlite-mysql": {
"command": "npx",
"args": [
"-y",
"@andezdev/tokenlite-mysql-mcp"
],
"env": {
"DB_HOST": "your-value",
"DB_PORT": "your-value",
"DB_USER": "your-value",
"DB_PASSWORD": "your-value",
"DB_NAME": "your-value",
"MCP_EXPLAIN_MAX_SCAN_ROWS": "your-value",
"MCP_QUERY_ROW_LIMIT": "your-value",
"MCP_SAFE_QUERY_MAX_ROWS": "your-value",
"MCP_SAFE_QUERY_ENABLE_BLOCKING": "your-value",
"MCP_METADATA_PATH": "your-value",
"MCP_TEMPLATES_PATH": "your-value",
"TOOL_PREFIX": "your-value",
"MCP_RATE_LIMIT_RPM": "your-value",
"MYSQL_QUERY_TIMEOUT": "your-value",
"MYSQL_CONNECTION_LIMIT": "your-value",
"MYSQL_CONNECT_TIMEOUT": "your-value",
"MYSQL_RETRY_ATTEMPTS": "your-value",
"MYSQL_RETRY_DELAY_MS": "your-value",
"MYSQL_QUEUE_LIMIT": "your-value",
"MCP_DDL_CACHE_TTL": "your-value",
"MCP_LOG_LEVEL": "your-value",
"ALLOW_INSERT_OPERATION": "your-value",
"ALLOW_UPDATE_OPERATION": "your-value",
"ALLOW_DELETE_OPERATION": "your-value",
"ALLOW_DDL_OPERATION": "your-value",
"DB_SSL": "your-value",
"DB_SSL_REJECT_UNAUTHORIZED": "your-value"
}
}
}
}Führe das in deinem Terminal aus
claude mcp add tokenlite-mysql --env DB_HOST=your-value --env DB_PORT=your-value --env DB_USER=your-value --env DB_PASSWORD=your-value --env DB_NAME=your-value --env MCP_EXPLAIN_MAX_SCAN_ROWS=your-value --env MCP_QUERY_ROW_LIMIT=your-value --env MCP_SAFE_QUERY_MAX_ROWS=your-value --env MCP_SAFE_QUERY_ENABLE_BLOCKING=your-value --env MCP_METADATA_PATH=your-value --env MCP_TEMPLATES_PATH=your-value --env TOOL_PREFIX=your-value --env MCP_RATE_LIMIT_RPM=your-value --env MYSQL_QUERY_TIMEOUT=your-value --env MYSQL_CONNECTION_LIMIT=your-value --env MYSQL_CONNECT_TIMEOUT=your-value --env MYSQL_RETRY_ATTEMPTS=your-value --env MYSQL_RETRY_DELAY_MS=your-value --env MYSQL_QUEUE_LIMIT=your-value --env MCP_DDL_CACHE_TTL=your-value --env MCP_LOG_LEVEL=your-value --env ALLOW_INSERT_OPERATION=your-value --env ALLOW_UPDATE_OPERATION=your-value --env ALLOW_DELETE_OPERATION=your-value --env ALLOW_DDL_OPERATION=your-value --env DB_SSL=your-value --env DB_SSL_REJECT_UNAUTHORIZED=your-value -- npx -y @andezdev/tokenlite-mysql-mcpTrag die leeren Werte ein, bevor du ihn startest.
Oder kopier die Einstellungen selbst
In .cursor/mcp.json in deinem Projekt oder in ~/.cursor/mcp.json einfügen
{
"mcpServers": {
"tokenlite-mysql": {
"command": "npx",
"args": [
"-y",
"@andezdev/tokenlite-mysql-mcp"
],
"env": {
"DB_HOST": "your-value",
"DB_PORT": "your-value",
"DB_USER": "your-value",
"DB_PASSWORD": "your-value",
"DB_NAME": "your-value",
"MCP_EXPLAIN_MAX_SCAN_ROWS": "your-value",
"MCP_QUERY_ROW_LIMIT": "your-value",
"MCP_SAFE_QUERY_MAX_ROWS": "your-value",
"MCP_SAFE_QUERY_ENABLE_BLOCKING": "your-value",
"MCP_METADATA_PATH": "your-value",
"MCP_TEMPLATES_PATH": "your-value",
"TOOL_PREFIX": "your-value",
"MCP_RATE_LIMIT_RPM": "your-value",
"MYSQL_QUERY_TIMEOUT": "your-value",
"MYSQL_CONNECTION_LIMIT": "your-value",
"MYSQL_CONNECT_TIMEOUT": "your-value",
"MYSQL_RETRY_ATTEMPTS": "your-value",
"MYSQL_RETRY_DELAY_MS": "your-value",
"MYSQL_QUEUE_LIMIT": "your-value",
"MCP_DDL_CACHE_TTL": "your-value",
"MCP_LOG_LEVEL": "your-value",
"ALLOW_INSERT_OPERATION": "your-value",
"ALLOW_UPDATE_OPERATION": "your-value",
"ALLOW_DELETE_OPERATION": "your-value",
"ALLOW_DDL_OPERATION": "your-value",
"DB_SSL": "your-value",
"DB_SSL_REJECT_UNAUTHORIZED": "your-value"
}
}
}
}Dein Browser fragt, ob er die App öffnen darf, dann zeigt die App die Einstellungen und bittet dich um Bestätigung. Schlüsselwerte bleiben leer, damit du sie selbst einträgst.
Oder kopier die Einstellungen selbst
In .vscode/mcp.json in deinem Projekt einfügen
{
"servers": {
"tokenlite-mysql": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@andezdev/tokenlite-mysql-mcp"
],
"env": {
"DB_HOST": "your-value",
"DB_PORT": "your-value",
"DB_USER": "your-value",
"DB_PASSWORD": "your-value",
"DB_NAME": "your-value",
"MCP_EXPLAIN_MAX_SCAN_ROWS": "your-value",
"MCP_QUERY_ROW_LIMIT": "your-value",
"MCP_SAFE_QUERY_MAX_ROWS": "your-value",
"MCP_SAFE_QUERY_ENABLE_BLOCKING": "your-value",
"MCP_METADATA_PATH": "your-value",
"MCP_TEMPLATES_PATH": "your-value",
"TOOL_PREFIX": "your-value",
"MCP_RATE_LIMIT_RPM": "your-value",
"MYSQL_QUERY_TIMEOUT": "your-value",
"MYSQL_CONNECTION_LIMIT": "your-value",
"MYSQL_CONNECT_TIMEOUT": "your-value",
"MYSQL_RETRY_ATTEMPTS": "your-value",
"MYSQL_RETRY_DELAY_MS": "your-value",
"MYSQL_QUEUE_LIMIT": "your-value",
"MCP_DDL_CACHE_TTL": "your-value",
"MCP_LOG_LEVEL": "your-value",
"ALLOW_INSERT_OPERATION": "your-value",
"ALLOW_UPDATE_OPERATION": "your-value",
"ALLOW_DELETE_OPERATION": "your-value",
"ALLOW_DDL_OPERATION": "your-value",
"DB_SSL": "your-value",
"DB_SSL_REJECT_UNAUTHORIZED": "your-value"
}
}
}
}Dein Browser fragt, ob er die App öffnen darf, dann zeigt die App die Einstellungen und bittet dich um Bestätigung. Schlüsselwerte bleiben leer, damit du sie selbst einträgst.
Dieser Server läuft auf deinem Computer, und ChatGPT kann sich nur mit Servern im Internet verbinden. Wähle eine andere App.
Deine Auswahl bleibt in einem Cookie auf diesem Gerät; kein Konto nötig.
Werte, die du selbst einträgst
DB_HOSTenvMySQL Host address (defaults to localhost)DB_PORTenvMySQL Port (defaults to 3306)DB_USERenvMySQL Username (defaults to root)- MySQL Password (defaults to empty string)
- MySQL Database name
MCP_EXPLAIN_MAX_SCAN_ROWSenvEXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias.MCP_QUERY_ROW_LIMITenvMax rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)MCP_SAFE_QUERY_MAX_ROWSenvDeprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWSMCP_SAFE_QUERY_ENABLE_BLOCKINGenvEnable or disable the EXPLAIN guardrail (defaults to true)MCP_METADATA_PATHenvAbsolute path to your custom metadata.json dictionaryMCP_TEMPLATES_PATHenvAbsolute path to your custom templates.json pre-approved queriesTOOL_PREFIXenvPrefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override.MCP_RATE_LIMIT_RPMenvMax tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable.MYSQL_QUERY_TIMEOUTenvMax execution time for a query in milliseconds to protect against DoS (defaults to 15000)MYSQL_CONNECTION_LIMITenvMax concurrent pool connections (defaults to 10)MYSQL_CONNECT_TIMEOUTenvMax time to wait for a connection socket to establish in milliseconds (defaults to 10000)MYSQL_RETRY_ATTEMPTSenvMax retries on transient connection errors (defaults to 3)MYSQL_RETRY_DELAY_MSenvBase delay in milliseconds for exponential backoff between retries (defaults to 1000)MYSQL_QUEUE_LIMITenvMax queued requests when all pool connections are busy to prevent memory leak (defaults to 50)MCP_DDL_CACHE_TTLenvTime-to-live in seconds for cached DDL statements (defaults to 60)MCP_LOG_LEVELenvMinimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergencyALLOW_INSERT_OPERATIONenvEnable INSERT and REPLACE queries (defaults to false)ALLOW_UPDATE_OPERATIONenvEnable UPDATE queries (defaults to false)ALLOW_DELETE_OPERATIONenvEnable DELETE and TRUNCATE queries (defaults to false)ALLOW_DDL_OPERATIONenvEnable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)DB_SSLenvEnable TLS for the MySQL connection (defaults to false)DB_SSL_REJECT_UNAUTHORIZEDenvReject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)
Diese Einstellungen werden aus dem Registry-Eintrag des Entwicklers erzeugt. Wenn in der README etwas anderes steht, folge der README.
Was er kann
Läuft auf deinem Computer; die Tool-Liste erscheint nach der Installation in deiner KI-App.
Basischecksi
Wir prüfen Informationen, die jeder sehen kann; den Code haben wir nicht gelesen. Checks, die nicht zutreffen, werden nicht mitgezählt. · Geprüft am 9. Nov. 2026
- ✓ Bestanden
Entwickler passt zum Repo
Der Registry-Name wurde mit dem GitHub-Konto andezdev bestätigt, dem das Repo gehört
- … Noch nicht geprüft
Wird noch gepflegt
Dieses Repo haben wir noch nicht von GitHub gelesen
- … Noch nicht geprüft
Hat eine Lizenz
Dieses Repo haben wir noch nicht von GitHub gelesen
- – Nicht zutreffend
Endpunkt antwortet
Dieser Server läuft auf deinem Computer; es gibt keinen Endpunkt im Internet
- – Nicht zutreffend
Anmeldung mit OAuth
Läuft auf deinem Computer und nutzt stattdessen lokale Einstellungen
- … Noch nicht geprüft
Keine versteckten Anweisungen in Tool-Beschreibungen
Läuft auf deinem Computer; Tool-Listen können wir nur von Endpunkten im Internet lesen
Im Vergleich mit anderen in Datenbanken & Datensätzei
- Mehr Sterne als 0 % der anderen 1152 Server in dieser Kategorie
- Neuer in der Registry veröffentlicht als 13 % der anderen 1152 Server in dieser Kategorie
- Basischecks gleich gut wie oder besser als bei 100 % der anderen 1152 Server in dieser Kategorie
Verglichen mit allen aktiven Servern dieser Kategorie in der Registry. Sterne zählen nur, wenn dem Herausgeber das Repo gehört.
Häufige Fragen
Ist Tokenlite Mysql MCP sicher?
Er hat 1 von 1 zutreffenden Basischecks bestanden. Den Code haben wir nicht gelesen. Bevor du einen Schlüssel oder Token hinzufügst, sieh nach, welche Zugriffe der Server verlangt, und nutze einen Schlüssel, der nur die Berechtigungen hat, die du brauchst.
Welche Schlüssel oder Codes braucht er?
Das musst du eintragen: DB_PASSWORD, DB_NAME
Läuft er auf meinem Computer oder in der Cloud?
Er läuft auf deinem Computer. Deine KI-App startet ihn bei Bedarf, und die Daten laufen nicht über die Server des Entwicklers (außer der Server ruft selbst einen Onlinedienst auf).
Wird er noch gepflegt?
Das GitHub-Repo wurde zuletzt – geändert, und die neueste Version (4.1.0) kam vor 5 Monaten in die Registry.
Welche Apps können ihn nutzen?
Apps, die MCP unterstützen, etwa Claude Desktop, Claude Code, Cursor und VS Code. Außerdem brauchst du Node.js auf deinem Computer.
Was kann ich stattdessen nutzen?
In derselben Kategorie: Supabase, MongoDB MCP Server, Elasticsearch MCP Server
Alternativen
Server derselben Kategorie von anderen Entwicklern, sortiert nach Sternen.
So liest du eine Karte:↓ Downloads pro Wochei★ GitHub-SterneiDrei Säulen: Bewertungen · Checks · NutzungiAktualisiert = neueste Version in der Registry veröffentlichti
README vom Entwickler
README öffnen
Unverändert aus dem Repo des Entwicklers übernommen. PopNx MCP hat den Inhalt weder geprüft noch empfiehlt es ihn. HTML, Bilder und Skripte wurden entfernt. Links führen von dieser Website weg.
TokenLite MySQL MCP
A robust and secure MySQL database server implemented under Anthropic's Model Context Protocol (MCP). Designed specifically to solve the shortcomings of current generic MCP servers through Graceful Degradation, Active Performance Protection, and Aggressive Token Optimization.
🌟 Core Pillars
- Safe-Query Optimizer (AST & EXPLAIN): Protects production databases by pre-analyzing queries. Blocks unindexed Full Table Scans that exceed configurable thresholds and injects strict
LIMITclauses automatically at the AST level. - Granular AST-Based Write Permissions: By default, TokenLite is 100% Read-Only. You can surgically enable specific write operations (INSERT, UPDATE, DELETE, DDL) via environment variables. The firewall uses strict AST parsing to prevent SQL injection and comment-bypass attacks, and strictly prohibits privilege escalation commands (like
GRANTorCALL). - Session-Level Defense in Depth: If the server is configured in strict Read-Only mode (all write variables disabled), TokenLite injects
SET SESSION TRANSACTION READ ONLYdirectly into the connection pool sockets. This guarantees that even if a theoretical bypass exists in the AST parser, the MySQL engine itself will physically reject any data modification. - Business Intelligence Injection: Bridges the gap between raw data and company logic. Automatically attaches semantic dictionaries (
metadata.json) to database schema exploration, and exposes Semantic Templates via the official MCP Prompts API (templates.json) so the LLM uses pre-approved analytical queries instead of hallucinating them. - Graph-Based Semantic Schema: Avoids sending giant schemas to the LLM that saturate the context window. When a table is searched, the engine uses heuristics to deduce implicit relationships and packages the exact "Auto-Join Context".
- CSV Token Compression: Database results are efficiently transformed into tabular CSV markdown with unambiguous NULL representation (
∅), saving up to 50% of Output Tokens compared to verbose JSON. When results hit the appliedLIMIT, a-- rows: N (truncated at LIMIT X)footer is appended so the LLM does not assume a complete dataset. - MCP Completions: Table names and template keywords support the official
completions/completecapability for resource templates (mysql://tables/{name}) and thequery_templatesprompt.
📋 Requirements
- Node.js v20 or higher
- MySQL 5.7 or higher (MySQL 8.0+ recommended)
- A MySQL user with
SELECTandSHOW VIEWprivileges.
🚀 Installation & Usage
You can use this MCP server with any compatible client. Below are the configurations for the most popular ones.
1. Claude Desktop
Edit your claude_desktop_config.json (usually located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS) and add the following:
Using NPX (Recommended)
{
"mcpServers": { "tokenlite-mysql": { "command": "npx", "args": [ "-y", "@andezdev/tokenlite-mysql-mcp" ], "env": { "DB_HOST": "localhost", "DB_PORT": "3306", "DB_USER": "your_db_user", "DB_PASSWORD": "your_password", "DB_NAME": "your_database", "MCP_EXPLAIN_MAX_SCAN_ROWS": "1000", "MCP_QUERY_ROW_LIMIT": "500", "MCP_SAFE_QUERY_ENABLE_BLOCKING": "true" } } } }
2. Claude Code (CLI)
You can easily integrate this server globally into Claude Code:
claude mcp add tokenlite_mysql \
-e DB_HOST="127.0.0.1" \ -e DB_PORT="3306" \ -e DB_USER="root" \ -e DB_PASSWORD="your_password" \ -e DB_NAME="your_database" \ -- npx -y @andezdev/tokenlite-mysql-mcp
3. Cursor IDE
To use within Cursor IDE:
- Open Cursor Settings > Features > MCP.
- Click + Add New MCP Server.
- Set the Type to
command. - Name it
tokenlite-mysql. - Set the command to:
npx -y @andezdev/tokenlite-mysql-mcp
*(Note: Cursor handles environment variables directly in the IDE UI, make sure to add your DB credentials there).*
⚙️ Environment Variables Reference
Understanding Query Limits (two independent knobs)
execute_safe_query applies two separate limits. Do not confuse them:
| Variable | What it controls | Default | Example |
|---|---|---|---|
MCP_EXPLAIN_MAX_SCAN_ROWS | Security gate: blocks queries whose EXPLAIN plan shows a full table scan (type: ALL) with more estimated rows than this threshold. The query is rejected *before* execution. | 1000 | 5000 allows scanning tables up to ~5000 rows without an index |
MCP_QUERY_ROW_LIMIT | Result cap: max rows returned to the LLM. Injected as LIMIT at the AST level. When reached, CSV includes -- rows: N (truncated at LIMIT X). | 500 | 1000 returns up to 1000 rows per SELECT |
Deprecated alias: MCP_SAFE_QUERY_MAX_ROWS still works as a fallback for MCP_EXPLAIN_MAX_SCAN_ROWS only. It does not control the result LIMIT.
Worked example with MCP_EXPLAIN_MAX_SCAN_ROWS=5000 and MCP_QUERY_ROW_LIMIT=500 on a customers table (~1502 rows):
SELECT * FROM customers→ passes EXPLAIN (1502 < 5000), executes withLIMIT 500, returns 500 rows + truncation footer.- Same config but table has 8000 rows → blocked by EXPLAIN before execution.
| Variable | Description | Default | Required |
|---|---|---|---|
DB_HOST | MySQL Host address | localhost | No |
DB_PORT | MySQL Port | 3306 | No |
DB_USER | MySQL Username | root | No |
DB_PASSWORD | MySQL Password | '' | No |
DB_NAME | MySQL Database name | test | Yes |
MCP_EXPLAIN_MAX_SCAN_ROWS | EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking. | 1000 | No |
MCP_QUERY_ROW_LIMIT | Max rows returned per SELECT (AST-injected LIMIT + truncation footer). | 500 | No |
MCP_SAFE_QUERY_ENABLE_BLOCKING | Enable or disable the EXPLAIN guardrail. | true | No |
MCP_METADATA_PATH | Absolute path to your custom metadata.json dictionary. | (Disabled) | No |
MCP_TEMPLATES_PATH | Absolute path to your custom templates.json queries. | (Disabled) | No |
TOOL_PREFIX | Prefix for tool names (useful when running multiple instances). | Derived from DB_NAME (e.g., mydb_). Random fallback only if DB_NAME is unset. | No |
MCP_RATE_LIMIT_RPM | Max tool invocations per minute (sliding window). Set to 0 to disable. | 60 | No |
MYSQL_QUERY_TIMEOUT | Max execution time for a query (in ms). Aborts heavy queries to protect against DoS. | 15000 | No |
MYSQL_CONNECTION_LIMIT | Max concurrent pool connections. | 10 | No |
MYSQL_CONNECT_TIMEOUT | Max time to wait for a socket to establish (in ms). | 10000 | No |
MYSQL_RETRY_ATTEMPTS | Max retries on transient connection errors (ECONNREFUSED, PROTOCOL_CONNECTION_LOST, etc.). | 3 | No |
MYSQL_RETRY_DELAY_MS | Base delay (ms) for exponential backoff between retries (1s, 2s, 4s...). | 1000 | No |
MYSQL_QUEUE_LIMIT | Max queued requests when all pool connections are busy. Prevents unbounded growth if MySQL is down. | 50 | No |
MCP_DDL_CACHE_TTL | Time-to-live (in seconds) for cached DDL statements. Reduces latency on repeated search_schema calls. Invalidated by refresh_schema. | 60 | No |
MCP_LOG_LEVEL | Minimum severity for MCP log notifications: debug, info, notice, warning, error, critical, alert, emergency. | info | No |
ALLOW_INSERT_OPERATION | Enable INSERT and REPLACE queries. | false | No |
ALLOW_UPDATE_OPERATION | Enable UPDATE queries. | false | No |
ALLOW_DELETE_OPERATION | Enable DELETE and TRUNCATE queries. | false | No |
ALLOW_DDL_OPERATION | Enable Data Definition Language (CREATE, ALTER, DROP, RENAME). | false | No |
DB_SSL | Enable TLS for the MySQL connection (recommended for managed/cloud databases). | false | No |
DB_SSL_REJECT_UNAUTHORIZED | Reject self-signed or untrusted TLS certificates when DB_SSL=true. | true | No |
🛡️ Business Intelligence Features (Opt-in)
TokenLite can teach the LLM about your company's business rules. To enable this, map the absolute paths of two JSON files via .env or your MCP client config:
metadata.json (Semantic Dictionary)
Translate integer statuses or internal jargon so the LLM understands the data.
{
"orders.status": { "pending": "The order is waiting for payment validation", "shipped": "The order has left the warehouse" } }
Custom Relationships
Define FK mappings the heuristic engine can't auto-detect (e.g., created_by → users). Add a _relationships key to your metadata.json:
{
"orders.status": { "pending": "...", "shipped": "..." }, "_relationships": { "orders.created_by": "users.id", "categories.parent_id": "categories.id" } }
These are treated as authoritative (not heuristic) and take priority over automatic detection.
The heuristic engine also assigns a confidence score (0–100) to each inferred FK based on name matching (+40), data type validation (+30), primary key verification (+20), and index presence (+10). Only FKs scoring ≥70 are accepted.
templates.json (Pre-approved SQL)
Stop the LLM from hallucinating complex metrics by providing vetted templates.
[
{ "name": "Customer Lifetime Value (LTV)", "description": "Calculates total revenue generated by delivered orders per customer.", "sql": "SELECT c.id, SUM(oi.price) FROM customers c JOIN orders o... WHERE o.status='delivered'" } ]
📈 Benchmarks & Token Savings
TokenLite includes an automated benchmark suite using o200k_base tokenization (GPT-4o/GPT-5 standard) to measure efficiency improvements. Token counts are approximate — Claude 4.x uses a proprietary tokenizer; actual counts may vary slightly.
To run the benchmark in your own environment:
npm run benchmark
Baseline: Standard MCP Pattern
The benchmark compares against the standard pattern used by generic MySQL MCP servers: full schema exposed as information_schema.columns in pretty-printed JSON, and query results returned as JSON.stringify(rows, null, 2) with execution time metadata.
1. Schema Discovery (Input Tokens)
Standard MCP servers dump the entire schema to the LLM. For large databases, this consumes thousands of input tokens on every turn. TokenLite's relational graph serves a localized Auto-Join Context (target table + direct parent tables + direct child tables).
| Scenario | Standard MCP Pattern | TokenLite | 📉 Savings |
|---|---|---|---|
| Mock (50 tables, Enterprise CRM) | 15,566 tokens | 883 tokens | 94.3% |
| Live (9 tables, Test DB) | 2,208 tokens | 531 tokens | 75.9% |
Savings scale with the number of tables: the more tables in the database, the higher the savings because the standard pattern dumps all of them while TokenLite only fetches the target + 1-hop relationships.
2. Query Result Payloads (Output Tokens)
TokenLite converts raw database rows to a dense, structured CSV layout. This avoids JSON syntax overhead (brackets, braces, repeated keys) and compresses the output payload returned to the LLM. When the row count reaches the server-injected LIMIT, results include a truncation footer (e.g. -- rows: 500 (truncated at LIMIT 500)) so agents know more data may exist.
Mock data (varied: NULLs, long descriptions, mixed lengths):
| Rows Returned | Standard MCP Pattern (Tokens) | TokenLite CSV (Tokens) | 📉 Output Savings (%) |
|---|---|---|---|
| 10 rows |
Nur der Anfang wird gezeigt; den Rest findest du im Repo