{
"event": "PreToolUse",
"tool_name": "mcp__mcp-docs__docs_update",
"tool_input": {
"id": 73,
"content": "<![CDATA[<nav class=\"breadcrumb\">\n <a href=\"\/docs\">Dokumentation<\/a> » <a href=\"\/docs\/mcp\">MCP<\/a> » <a href=\"\/docs\/mcp\/mcp-docs\">MCP-Docs<\/a> » Installation\n<\/nav>\n\n<h1>MCP-Docs Installation<\/h1>\n<p class=\"doc-meta\"><strong>Erstellt:<\/strong> 2025-12-20 | <strong>Aktualisiert:<\/strong> 2025-12-31<\/p>\n<p>Setup, Konfiguration und Registrierung des MCP-Docs Servers.<\/p>\n\n<h2>Voraussetzungen<\/h2>\n<ul>\n <li>Python 3.10+<\/li>\n <li>MariaDB\/MySQL mit ki_dev und ki_protokoll Datenbanken<\/li>\n <li>Claude Code CLI<\/li>\n<\/ul>\n\n<h2>Installation<\/h2>\n\n<h3>1. Verzeichnis erstellen<\/h3>\n<pre><code>mkdir -p \/var\/www\/mcp-servers\/mcp_docs\ncd \/var\/www\/mcp-servers\/mcp_docs<\/code><\/pre>\n\n<h3>2. Virtual Environment<\/h3>\n<pre><code>python3 -m venv venv\nsource venv\/bin\/activate\npip install mcp pymysql python-dotenv<\/code><\/pre>\n\n<h3>3. Environment-Datei<\/h3>\n<pre><code># .env\n# Datenbank (ki_dev für Dokumentation, ki_protokoll für Logging)\nDB_HOST=localhost\nDB_PORT=3306\nDB_USER=root\nDB_PASSWORD=geheim<\/code><\/pre>\n\n<h3>4. Datenbank-Tabelle<\/h3>\n<pre><code>-- In ki_dev ausführen\nCREATE TABLE IF NOT EXISTS dokumentation (\n id INT AUTO_INCREMENT PRIMARY KEY,\n parent_id INT DEFAULT NULL,\n depth TINYINT UNSIGNED DEFAULT 0,\n sort_order INT UNSIGNED DEFAULT 0,\n slug VARCHAR(100) NOT NULL,\n path VARCHAR(500) NOT NULL UNIQUE,\n title VARCHAR(200) NOT NULL,\n description VARCHAR(500),\n content LONGTEXT NOT NULL,\n content_format ENUM('html','markdown') DEFAULT 'html',\n status ENUM('draft','published','archived') DEFAULT 'published',\n version INT UNSIGNED DEFAULT 1,\n created_by VARCHAR(100) DEFAULT 'system',\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_by VARCHAR(100),\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n \n FOREIGN KEY (parent_id) REFERENCES dokumentation(id) ON DELETE SET NULL\n);<\/code><\/pre>\n\n<h2>Registrierung in Claude Code<\/h2>\n<pre><code># MCP-Server registrieren\nclaude mcp add mcp-docs \\\n \/var\/www\/mcp-servers\/mcp_docs\/venv\/bin\/python \\\n \/var\/www\/mcp-servers\/mcp_docs\/server.py\n\n# Registrierung prüfen\nclaude mcp list<\/code><\/pre>\n\n<h2>Test<\/h2>\n<pre><code># In Claude Code Session\ndocs_list(compact=True)\ndocs_statistics()\ndocs_hierarchy()<\/code><\/pre>\n\n<h2>Fehlerbehebung<\/h2>\n\n<h3>Server startet nicht<\/h3>\n<pre><code># Manuell testen\n\/var\/www\/mcp-servers\/mcp_docs\/venv\/bin\/python \\\n \/var\/www\/mcp-servers\/mcp_docs\/server.py\n\n# Logs prüfen\ntail -f ~\/.claude\/logs\/mcp-*.log<\/code><\/pre>\n\n<h3>Datenbankverbindung fehlgeschlagen<\/h3>\n<ul>\n <li>.env Credentials prüfen<\/li>\n <li>DB-User Berechtigungen prüfen<\/li>\n <li>MariaDB-Service Status: <code>systemctl status mariadb<\/code><\/li>\n<\/ul>\n\n<h3>Tool nicht gefunden<\/h3>\n<pre><code># MCP-Server neu registrieren\nclaude mcp remove mcp-docs\nclaude mcp add mcp-docs ...<\/code><\/pre>\n\n<h2>Berechtigungen<\/h2>\n<table>\n <tr><th>DB-User<\/th><th>Datenbank<\/th><th>Rechte<\/th><\/tr>\n <tr><td><code>root<\/code><\/td><td>ki_dev<\/td><td>SELECT, INSERT, UPDATE, DELETE auf dokumentation<\/td><\/tr>\n <tr><td><code>root<\/code><\/td><td>ki_protokoll<\/td><td>INSERT auf mcp_log<\/td><\/tr>\n<\/table>\n\n<h2>Konfiguration (config.py)<\/h2>\n<pre><code>from pathlib import Path\nfrom dotenv import load_dotenv\nimport os\n\nload_dotenv(Path(__file__).parent \/ \".env\")\n\n# Datenbank-Konfiguration\nDB_CONFIG = {\n \"host\": os.getenv(\"DB_HOST\", \"localhost\"),\n \"port\": int(os.getenv(\"DB_PORT\", 3306)),\n \"user\": os.getenv(\"DB_USER\"),\n \"password\": os.getenv(\"DB_PASSWORD\"),\n}\n\n# Dokumentation in ki_dev\nDOCS_DATABASE = \"ki_dev\"\n\n# Logging in ki_protokoll\nLOG_DATABASE = \"ki_protokoll\"<\/code><\/pre>]]>"
}
}
{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"doc\": {\n \"id\": 73,\n \"parent_id\": 66,\n \"slug\": \"mcp-docs-installation\",\n \"path\": \"\/mcp\/mcp-docs\/mcp-docs-installation\",\n \"title\": \"Installation\",\n \"description\": null,\n \"content\": \"<![CDATA[<nav class=\\\"breadcrumb\\\">\\n <a href=\\\"\/docs\\\">Dokumentation<\/a> » <a href=\\\"\/docs\/mcp\\\">MCP<\/a> » <a href=\\\"\/docs\/mcp\/mcp-docs\\\">MCP-Docs<\/a> » Installation\\n<\/nav>\\n\\n<h1>MCP-Docs Installation<\/h1>\\n<p class=\\\"doc-meta\\\"><strong>Erstellt:<\/strong> 2025-12-20 | <strong>Aktualisiert:<\/strong> 2025-12-31<\/p>\\n<p>Setup, Konfiguration und Registrierung des MCP-Docs Servers.<\/p>\\n\\n<h2>Voraussetzungen<\/h2>\\n<ul>\\n <li>Python 3.10+<\/li>\\n <li>MariaDB\/MySQL mit ki_dev und ki_protokoll Datenbanken<\/li>\\n <li>Claude Code CLI<\/li>\\n<\/ul>\\n\\n<h2>Installation<\/h2>\\n\\n<h3>1. Verzeichnis erstellen<\/h3>\\n<pre><code>mkdir -p \/var\/www\/mcp-servers\/mcp_docs\\ncd \/var\/www\/mcp-servers\/mcp_docs<\/code><\/pre>\\n\\n<h3>2. Virtual Environment<\/h3>\\n<pre><code>python3 -m venv venv\\nsource venv\/bin\/activate\\npip install mcp pymysql python-dotenv<\/code><\/pre>\\n\\n<h3>3. Environment-Datei<\/h3>\\n<pre><code># .env\\n# Datenbank (ki_dev für Dokumentation, ki_protokoll für Logging)\\nDB_HOST=localhost\\nDB_PORT=3306\\nDB_USER=root\\nDB_PASSWORD=geheim<\/code><\/pre>\\n\\n<h3>4. Datenbank-Tabelle<\/h3>\\n<pre><code>-- In ki_dev ausführen\\nCREATE TABLE IF NOT EXISTS dokumentation (\\n id INT AUTO_INCREMENT PRIMARY KEY,\\n parent_id INT DEFAULT NULL,\\n depth TINYINT UNSIGNED DEFAULT 0,\\n sort_order INT UNSIGNED DEFAULT 0,\\n slug VARCHAR(100) NOT NULL,\\n path VARCHAR(500) NOT NULL UNIQUE,\\n title VARCHAR(200) NOT NULL,\\n description VARCHAR(500),\\n content LONGTEXT NOT NULL,\\n content_format ENUM('html','markdown') DEFAULT 'html',\\n status ENUM('draft','published','archived') DEFAULT 'published',\\n version INT UNSIGNED DEFAULT 1,\\n created_by VARCHAR(100) DEFAULT 'system',\\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\\n updated_by VARCHAR(100),\\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\\n \\n FOREIGN KEY (parent_id) REFERENCES dokumentation(id) ON DELETE SET NULL\\n);<\/code><\/pre>\\n\\n<h2>Registrierung in Claude Code<\/h2>\\n<pre><code># MCP-Server registrieren\\nclaude mcp add mcp-docs \\\\\\n \/var\/www\/mcp-servers\/mcp_docs\/venv\/bin\/python \\\\\\n \/var\/www\/mcp-servers\/mcp_docs\/server.py\\n\\n# Registrierung prüfen\\nclaude mcp list<\/code><\/pre>\\n\\n<h2>Test<\/h2>\\n<pre><code># In Claude Code Session\\ndocs_list(compact=True)\\ndocs_statistics()\\ndocs_hierarchy()<\/code><\/pre>\\n\\n<h2>Fehlerbehebung<\/h2>\\n\\n<h3>Server startet nicht<\/h3>\\n<pre><code># Manuell testen\\n\/var\/www\/mcp-servers\/mcp_docs\/venv\/bin\/python \\\\\\n \/var\/www\/mcp-servers\/mcp_docs\/server.py\\n\\n# Logs prüfen\\ntail -f ~\/.claude\/logs\/mcp-*.log<\/code><\/pre>\\n\\n<h3>Datenbankverbindung fehlgeschlagen<\/h3>\\n<ul>\\n <li>.env Credentials prüfen<\/li>\\n <li>DB-User Berechtigungen prüfen<\/li>\\n <li>MariaDB-Service Status: <code>systemctl status mariadb<\/code><\/li>\\n<\/ul>\\n\\n<h3>Tool nicht gefunden<\/h3>\\n<pre><code># MCP-Server neu registrieren\\nclaude mcp remove mcp-docs\\nclaude mcp add mcp-docs ...<\/code><\/pre>\\n\\n<h2>Berechtigungen<\/h2>\\n<table>\\n <tr><th>DB-User<\/th><th>Datenbank<\/th><th>Rechte<\/th><\/tr>\\n <tr><td><code>root<\/code><\/td><td>ki_dev<\/td><td>SELECT, INSERT, UPDATE, DELETE auf dokumentation<\/td><\/tr>\\n <tr><td><code>root<\/code><\/td><td>ki_protokoll<\/td><td>INSERT auf mcp_log<\/td><\/tr>\\n<\/table>\\n\\n<h2>Konfiguration (config.py)<\/h2>\\n<pre><code>from pathlib import Path\\nfrom dotenv import load_dotenv\\nimport os\\n\\nload_dotenv(Path(__file__).parent \/ \\\".env\\\")\\n\\n# Datenbank-Konfiguration\\nDB_CONFIG = {\\n \\\"host\\\": os.getenv(\\\"DB_HOST\\\", \\\"localhost\\\"),\\n \\\"port\\\": int(os.getenv(\\\"DB_PORT\\\", 3306)),\\n \\\"user\\\": os.getenv(\\\"DB_USER\\\"),\\n \\\"password\\\": os.getenv(\\\"DB_PASSWORD\\\"),\\n}\\n\\n# Dokumentation in ki_dev\\nDOCS_DATABASE = \\\"ki_dev\\\"\\n\\n# Logging in ki_protokoll\\nLOG_DATABASE = \\\"ki_protokoll\\\"<\/code><\/pre>]]>\",\n \"status\": \"published\",\n \"sort_order\": 3,\n \"depth\": 2,\n \"created_at\": \"2025-12-20T13:03:43\",\n \"updated_at\": \"2025-12-31T04:21:43\"\n },\n \"message\": \"Document #73 updated\"\n}"
}
]
}