{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"doc\": {\n \"id\": 41,\n \"parent_id\": 36,\n \"slug\": \"mcp-db-config\",\n \"path\": \"\/mcp\/mcp-db\/mcp-db-config\",\n \"title\": \"Konfiguration\",\n \"description\": \"Zentrale Konfiguration über Environment Variables und Config-Klasse.\",\n \"content\": \"<nav class=\\\"breadcrumb\\\">\\n <a href=\\\"\/docs\\\">Dokumentation<\/a> » <a href=\\\"\/docs\/mcp\/mcp-db\\\">MCP-DB<\/a> » Konfiguration\\n<\/nav>\\n\\n<h1>MCP-DB Konfiguration<\/h1>\\n<p>Zentrale Konfiguration über Environment Variables und Config-Klasse.<\/p>\\n\\n<h2>config.py<\/h2>\\n<pre><code>\\\"\\\"\\\"Zentrale Konfiguration\\\"\\\"\\\"\\nimport os\\nfrom typing import List\\n\\nclass Config:\\n \\\"\\\"\\\"Konfiguration aus Environment Variables\\\"\\\"\\\"\\n\\n # Datenbank für Queries (mcp_readonly)\\n DB_HOST: str = os.getenv(\\\"DB_HOST\\\", \\\"localhost\\\")\\n DB_USER: str = os.getenv(\\\"DB_USER\\\", \\\"mcp_readonly\\\")\\n DB_PASSWORD: str = os.getenv(\\\"DB_PASSWORD\\\", \\\"\\\")\\n\\n # Datenbank für Logging (mcp_logger)\\n LOG_DB_HOST: str = os.getenv(\\\"LOG_DB_HOST\\\", \\\"localhost\\\")\\n LOG_DB_NAME: str = os.getenv(\\\"LOG_DB_NAME\\\", \\\"ki_protokoll\\\")\\n LOG_DB_USER: str = os.getenv(\\\"LOG_DB_USER\\\", \\\"mcp_logger\\\")\\n LOG_DB_PASSWORD: str = os.getenv(\\\"LOG_DB_PASSWORD\\\", \\\"\\\")\\n\\n # Database Allowlist\\n ALLOWED_DATABASES: List[str] = [\\\"ki_protokoll\\\", \\\"ki_system\\\"]\\n\\n # Dangerous Keyword Blocklist\\n BLOCKED_KEYWORDS: List[str] = [\\n \\\"DROP\\\", \\\"DELETE\\\", \\\"INSERT\\\", \\\"UPDATE\\\", \\\"TRUNCATE\\\",\\n \\\"ALTER\\\", \\\"CREATE\\\", \\\"RENAME\\\", \\\"GRANT\\\", \\\"REVOKE\\\",\\n \\\"LOAD_FILE\\\", \\\"INTO OUTFILE\\\", \\\"INTO DUMPFILE\\\",\\n \\\"BENCHMARK\\\", \\\"SLEEP\\\"\\n ]\\n\\n # Query Limits\\n MAX_QUERY_LENGTH: int = 2000\\n MAX_ROWS: int = 100\\n QUERY_TIMEOUT_SEC: int = 30\\n\\n # Table Allowlist (29 Tabellen)\\n ALLOWED_TABLES: List[str] = [\\n # ki_protokoll\\n \\\"mcp_log\\\", \\\"protokoll\\\",\\n # ki_system - Content Studio\\n \\\"content_orders\\\", \\\"content_versions\\\", \\\"content_contracts\\\",\\n \\\"content_critiques\\\", \\\"content_sources\\\", \\\"content_structures\\\",\\n \\\"author_profiles\\\", \\\"critics\\\",\\n # ki_system - RAG\/Documents\\n \\\"documents\\\", \\\"chunks\\\", \\\"document_entities\\\", \\\"document_taxonomy\\\",\\n # ki_system - Chat\\n \\\"chat_sessions\\\", \\\"chat_messages\\\",\\n # ki_system - Pipeline\\n \\\"pipeline_log\\\", \\\"pipeline_queue\\\", \\\"prompts\\\", \\\"prompt_tests\\\", \\\"llm_requests\\\",\\n # ki_system - Entities\/Taxonomy\\n \\\"entities\\\", \\\"entity_relations\\\", \\\"entity_synonyms\\\",\\n \\\"entity_classifications\\\", \\\"entity_corrections\\\",\\n \\\"taxonomy_terms\\\", \\\"ontology_classes\\\",\\n # ki_system - Search\\n \\\"search_history\\\",\\n ]<\/code><\/pre>\\n\\n<h2>Environment Variables<\/h2>\\n<table>\\n <tr><th>Variable<\/th><th>Beschreibung<\/th><th>Default<\/th><\/tr>\\n <tr><td>DB_HOST<\/td><td>Datenbank-Host für Queries<\/td><td>localhost<\/td><\/tr>\\n <tr><td>DB_USER<\/td><td>User für Queries (nur SELECT)<\/td><td>mcp_readonly<\/td><\/tr>\\n <tr><td>DB_PASSWORD<\/td><td>Passwort für Query-User<\/td><td>-<\/td><\/tr>\\n <tr><td>LOG_DB_HOST<\/td><td>Datenbank-Host für Logging<\/td><td>localhost<\/td><\/tr>\\n <tr><td>LOG_DB_NAME<\/td><td>Datenbank für Logging<\/td><td>ki_protokoll<\/td><\/tr>\\n <tr><td>LOG_DB_USER<\/td><td>User für Logging (nur INSERT)<\/td><td>mcp_logger<\/td><\/tr>\\n <tr><td>LOG_DB_PASSWORD<\/td><td>Passwort für Logger-User<\/td><td>-<\/td><\/tr>\\n<\/table>\\n\\n<h2>.env.example<\/h2>\\n<pre><code># Datenbank für Queries (mcp_readonly)\\nDB_HOST=localhost\\nDB_USER=mcp_readonly\\nDB_PASSWORD=\\n\\n# Datenbank für Logging (mcp_logger)\\nLOG_DB_HOST=localhost\\nLOG_DB_NAME=ki_protokoll\\nLOG_DB_USER=mcp_logger\\nLOG_DB_PASSWORD=<\/code><\/pre>\\n\\n<h2>Allowlists<\/h2>\\n\\n<h3>Database Allowlist<\/h3>\\n<p>Nur diese Datenbanken sind erlaubt:<\/p>\\n<ul>\\n <li><code>ki_protokoll<\/code> - Protokoll und Logging<\/li>\\n <li><code>ki_system<\/code> - KI-System Daten<\/li>\\n<\/ul>\\n\\n<h3>Table Allowlist (29 Tabellen)<\/h3>\\n<p>Nur diese Tabellen sind für SELECT erlaubt:<\/p>\\n\\n<h4>ki_protokoll (2 Tabellen)<\/h4>\\n<ul>\\n <li><code>mcp_log<\/code> - MCP Logging<\/li>\\n <li><code>protokoll<\/code> - Claude Protokoll<\/li>\\n<\/ul>\\n\\n<h4>ki_system - Content Studio (8 Tabellen)<\/h4>\\n<ul>\\n <li><code>content_orders<\/code> - Content-Aufträge<\/li>\\n <li><code>content_versions<\/code> - Content-Versionen<\/li>\\n <li><code>content_contracts<\/code> - Content-Contracts<\/li>\\n <li><code>content_critiques<\/code> - Kritiken<\/li>\\n <li><code>content_sources<\/code> - Quellen<\/li>\\n <li><code>content_structures<\/code> - Strukturen<\/li>\\n <li><code>author_profiles<\/code> - Autoren-Profile<\/li>\\n <li><code>critics<\/code> - Kritiker-Definitionen<\/li>\\n<\/ul>\\n\\n<h4>ki_system - RAG\/Documents (4 Tabellen)<\/h4>\\n<ul>\\n <li><code>documents<\/code> - Dokumente<\/li>\\n <li><code>chunks<\/code> - Dokument-Chunks für RAG<\/li>\\n <li><code>document_entities<\/code> - Dokument-Entitäten<\/li>\\n <li><code>document_taxonomy<\/code> - Dokument-Taxonomie<\/li>\\n<\/ul>\\n\\n<h4>ki_system - Chat (2 Tabellen)<\/h4>\\n<ul>\\n <li><code>chat_sessions<\/code> - Chat-Sessions<\/li>\\n <li><code>chat_messages<\/code> - Chat-Nachrichten<\/li>\\n<\/ul>\\n\\n<h4>ki_system - Pipeline (5 Tabellen)<\/h4>\\n<ul>\\n <li><code>pipeline_log<\/code> - Pipeline-Log<\/li>\\n <li><code>pipeline_queue<\/code> - Pipeline-Queue<\/li>\\n <li><code>prompts<\/code> - Prompts<\/li>\\n <li><code>prompt_tests<\/code> - Prompt-Tests<\/li>\\n <li><code>llm_requests<\/code> - LLM-Requests<\/li>\\n<\/ul>\\n\\n<h4>ki_system - Entities\/Taxonomy (7 Tabellen)<\/h4>\\n<ul>\\n <li><code>entities<\/code> - Entitäten<\/li>\\n <li><code>entity_relations<\/code> - Entitäts-Relationen<\/li>\\n <li><code>entity_synonyms<\/code> - Synonyme<\/li>\\n <li><code>entity_classifications<\/code> - Klassifikationen<\/li>\\n <li><code>entity_corrections<\/code> - Korrekturen<\/li>\\n <li><code>taxonomy_terms<\/code> - Taxonomie-Begriffe<\/li>\\n <li><code>ontology_classes<\/code> - Ontologie-Klassen<\/li>\\n<\/ul>\\n\\n<h4>ki_system - Search (1 Tabelle)<\/h4>\\n<ul>\\n <li><code>search_history<\/code> - Suchverlauf<\/li>\\n<\/ul>\\n\\n<p>Zusätzlich erlaubt: <code>information_schema.TABLES<\/code> für Schema-Abfragen.<\/p>\\n\\n<h2>Keyword Blocklist<\/h2>\\n<p>Diese Keywords werden in Queries blockiert (mit Word Boundaries):<\/p>\\n<table>\\n <tr><th>Kategorie<\/th><th>Keywords<\/th><\/tr>\\n <tr><td>DML<\/td><td>DELETE, INSERT, UPDATE<\/td><\/tr>\\n <tr><td>DDL<\/td><td>DROP, TRUNCATE, ALTER, CREATE, RENAME<\/td><\/tr>\\n <tr><td>DCL<\/td><td>GRANT, REVOKE<\/td><\/tr>\\n <tr><td>File-Operationen<\/td><td>LOAD_FILE, INTO OUTFILE, INTO DUMPFILE<\/td><\/tr>\\n <tr><td>DoS-Funktionen<\/td><td>BENCHMARK, SLEEP<\/td><\/tr>\\n<\/table>\\n\\n<h2>Limits<\/h2>\\n<table>\\n <tr><th>Limit<\/th><th>Wert<\/th><th>Beschreibung<\/th><\/tr>\\n <tr><td>MAX_QUERY_LENGTH<\/td><td>2000<\/td><td>Maximale Query-Länge in Zeichen<\/td><\/tr>\\n <tr><td>MAX_ROWS<\/td><td>100<\/td><td>Maximale Ergebniszeilen<\/td><\/tr>\\n <tr><td>QUERY_TIMEOUT_SEC<\/td><td>30<\/td><td>Query-Timeout in Sekunden<\/td><\/tr>\\n<\/table>\\n\\n<h2>Erweiterung der Allowlists<\/h2>\\n<pre><code># In config.py erweitern:\\nALLOWED_TABLES: List[str] = [\\n \\\"mcp_log\\\",\\n \\\"ki_eintraege\\\",\\n # Neue Tabellen hinzufügen:\\n \\\"neue_tabelle\\\",\\n]\\n\\nALLOWED_DATABASES: List[str] = [\\n \\\"ki_protokoll\\\",\\n \\\"ki_system\\\",\\n # Neue Datenbank hinzufügen:\\n \\\"neue_db\\\",\\n]<\/code><\/pre>\\n\\n<h2>Verwandte Kapitel<\/h2>\\n<ul>\\n <li><a href=\\\"\/docs\/mcp\/mcp-db-security\\\">Sicherheit<\/a> - DB-User Hardening<\/li>\\n <li><a href=\\\"\/docs\/mcp\/mcp-db-installation\\\">Installation<\/a> - .env Setup<\/li>\\n<\/ul>\",\n \"status\": \"published\",\n \"sort_order\": 5,\n \"depth\": 2,\n \"created_at\": \"2025-12-20T11:13:58\",\n \"updated_at\": \"2025-12-20T11:13:58\"\n }\n}"
}
]
}