VM

verygoodplugins/mcp-local-wp

Database management公式

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

34 stars 5 forks 品質 77 トレンド 32NOASSERTION

MCP server for WordPress database access via Local by Flywheel

概要

A Model Context Protocol (MCP) server that gives AI assistants like Claude and Cursor direct, read-only access to your Local by Flywheel WordPress database. No more guessing table structures. No more writing SQL queries blind. Your AI can now understand your actual data. Think of MCP (Model Context Protocol) as a secure bridge between AI assistants and your development tools. Instead of copying and pasting database schemas or query results, MCP servers let AI assistants directly interact with your tools while you maintain complete control. : "Hey AI, I think there's a table called wp_something with a column that might be named user_meta... can you write a query?" : "Hey AI, check what's in my database and write the exact query I need." Picture this: You're debugging a LearnDash integration issue. Quiz results aren't syncing properly.

README

以下は原文 README の抜粋です。原文を見る。

MCP Server Local WP

🎯 What if your AI assistant could actually SEE your WordPress database?

A Model Context Protocol (MCP) server that gives AI assistants like Claude and Cursor direct, read-only access to your Local by Flywheel WordPress database. No more guessing table structures. No more writing SQL queries blind. Your AI can now understand your actual data.

Upgrading to 2.0

Version 2.0 requires Node.js 24 or newer and uses MCP SDK v2. Existing tool names and site selectors remain available. Query results are now { "rows": [...] }; schema listing returns { "tables": [...], "hasMore": false, "nextAfter": null } with bounded pages of table names. Successful tools return matching structured and JSON-text results, and failures set isError: true.

Database and Local configuration are resolved lazily, so MCP tool discovery works without a running site. Explicit MYSQL_HOST or MYSQL_SOCKET_PATH selects the manual connection. Keep stdin open until all tool responses arrive; EOF closes the session. The parent watchdog also cleans up abandoned stdio servers.

🤔 What’s an MCP Server?

Think of MCP (Model Context Protocol) as a secure bridge between AI assistants and your development tools. Instead of copying and pasting database schemas or query results, MCP servers let AI assistants directly interact with your tools while you maintain complete control.

Without MCP: “Hey AI, I think there’s a table called wp_something with a column that might be named user_meta… can you write a query?”
With MCP: “Hey AI, check what’s in my database and write the exact query I need.”

💡 The WordPress Developer’s Dilemma

Picture this: You’re debugging a LearnDash integration issue. Quiz results aren’t syncing properly. You fire up Cursor to help diagnose the problem, but without database access, even the most advanced AI is just making educated guesses about your table structures.

The Real-World Impact

Here’s an actual support ticket we were working on. The task was simple: fetch quiz activity data from LearnDash tables.

❌ Before MCP Server (AI Flying Blind):

The AI tried its best, suggesting this query:

$quiz_activities = $wpdb->get_results(
  $wpdb->prepare(
    'SELECT post_id, activity_meta FROM ' . esc_sql( LDLMS_DB::get_table_name( 'user_activity' ) ) . '
     WHERE user_id=%d AND activity_type=%s AND activity_status=1 AND activity_completed IS NOT NULL',
    $user_id,
    'quiz'
  ),
  ARRAY_A
);
GitHub で README 全文を見る

インストール

npx -y @verygoodplugins/mcp-local-wp@latest
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "wordpress-dev": { "command": "npx", "args": ["-y", "@verygoodplugins/mcp-local-wp@latest"], "env": { "SITE_NAME": "dev" } } } }