Server data from the Official MCP Registry
WordPress database access via Local by Flywheel. Execute read-only MySQL queries and inspect schema.
WordPress database access via Local by Flywheel. Execute read-only MySQL queries and inspect schema.
Valid MCP server (2 strong, 4 medium validity signals). 7 known CVEs in dependencies (2 critical, 3 high severity) Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (14/15 approved).
6 files analyzed ยท 8 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Unverified package source
We couldn't verify that the installable package matches the reviewed source code. Proceed with caution.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-verygoodplugins-mcp-local-wp": {
"args": [
"-y",
"@verygoodplugins/mcp-local-wp"
],
"command": "npx"
}
}
}From the project's GitHub README.
๐ฏ 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.
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."
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.
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
);
Problem? The activity_meta column doesn't exist! LearnDash stores metadata in a completely separate table with a different structure. Without database access, the AI made reasonable but incorrect assumptions. You'd spend the next 20 minutes manually correcting table names, discovering relationships, and rewriting the query.
โ After MCP Server (AI With X-Ray Vision):
With database access, the AI immediately saw the actual table structure and wrote:
$quiz_activities = $wpdb->get_results(
$wpdb->prepare(
'SELECT ua.post_id, ua.activity_id, uam.activity_meta_key, uam.activity_meta_value
FROM ' . esc_sql( LDLMS_DB::get_table_name( 'user_activity' ) ) . ' ua
LEFT JOIN ' . esc_sql( LDLMS_DB::get_table_name( 'user_activity_meta' ) ) . ' uam
ON ua.activity_id = uam.activity_id
WHERE ua.user_id=%d AND ua.activity_type=%s AND ua.activity_completed IS NOT NULL
AND uam.activity_meta_key IN (%s, %s, %s)',
$user_id,
'quiz',
'percentage',
'points',
'total_points'
),
ARRAY_A
);
The difference? The AI could see that metadata lives in a separate user_activity_meta table, understood the relationship through activity_id, and knew exactly which meta keys were available. First try. Zero guesswork. Problem solved.
When your AI assistant can read your database:
When using the original mcp-server-mysql with Local by Flywheel, developers face several challenges:
lx97vbzE7) that change when sites are restartedThis MCP server automatically detects your active Local by Flywheel MySQL instance by:
mysqld instancesWhen you have multiple Local sites, the server uses priority-based site selection to ensure you're always connected to the right database:
SITE_ID env var - Direct site ID (highest priority)SITE_NAME env var - Human-readable site name lookupSpecify which site to connect to in your MCP config:
{
"mcpServers": {
"wordpress-dev": {
"command": "npx",
"args": ["-y", "@verygoodplugins/mcp-local-wp@latest"],
"env": {
"SITE_NAME": "dev"
}
}
}
}
Or use the site ID directly:
{
"env": {
"SITE_ID": "lx97vbzE7"
}
}
When using Claude Code or Cursor, the server automatically detects which site you're working in based on your current directory. If you're editing files in /Users/.../Local Sites/dev/app/public/wp-content/plugins/my-plugin/, the server connects to the "dev" site's database automatically.
Use the mysql_current_site tool to see which site you're connected to:
{
"siteName": "dev",
"siteId": "lx97vbzE7",
"sitePath": "/Users/.../Local Sites/dev",
"domain": "dev.local",
"selectionMethod": "cwd_detection"
}
Use mysql_list_sites to see all available sites and their status.
Execute read-only SQL against your Local WordPress database.
Input fields:
sql (string): Single read-only statement (SELECT/SHOW/DESCRIBE/EXPLAIN)params (string[]): Optional parameter values for ? placeholdersExample Usage:
-- With parameters
SELECT * FROM wp_posts WHERE post_status = ? ORDER BY post_date DESC LIMIT ?;
-- params: ["publish", "5"]
-- Direct queries
SELECT option_name, option_value FROM wp_options WHERE option_name LIKE '%theme%';
SHOW TABLES;
DESCRIBE wp_users;
Inspect database schema using INFORMATION_SCHEMA.
table: returns columns and indexes for that tableExamples:
// List all tables
{
"tool": "mysql_schema",
"args": {}
}
// Inspect a specific table
{
"tool": "mysql_schema",
"args": { "table": "wp_posts" }
}
Get information about the currently connected Local WordPress site.
Returns the site name, ID, path, domain, socket path, and how the site was selected (env var, cwd detection, or auto-detection).
{
"tool": "mysql_current_site",
"args": {}
}
// Returns:
// {
// "siteName": "dev",
// "siteId": "lx97vbzE7",
// "sitePath": "/Users/.../Local Sites/dev",
// "domain": "dev.local",
// "selectionMethod": "cwd_detection",
// "socketPath": "/Users/.../Local/run/lx97vbzE7/mysql/mysqld.sock"
// }
List all available Local WordPress sites and their running status.
{
"tool": "mysql_list_sites",
"args": {}
}
// Returns:
// {
// "sites": [
// { "id": "lx97vbzE7", "name": "dev", "domain": "dev.local", "running": true },
// { "id": "WP7lolWDi", "name": "staging", "domain": "staging.local", "running": false }
// ],
// "currentSiteId": "lx97vbzE7"
// }
The easiest way to get started - no installation required:
Add this to your Cursor MCP configuration file (.cursor/mcp.json):
{
"mcpServers": {
"mcp-local-wp": {
"command": "npx",
"args": [
"-y",
"@verygoodplugins/mcp-local-wp@latest"
]
}
}
}
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\\Claude\\claude_desktop_config.json
{
"mcpServers": {
"mcp-local-wp": {
"command": "npx",
"args": [
"-y",
"@verygoodplugins/mcp-local-wp@latest"
]
}
}
}
For customization or local development:
git clone https://github.com/verygoodplugins/mcp-local-wp.git
cd mcp-local-wp
npm install
npm run build
{
"mcpServers": {
"mcp-local-wp": {
"command": "node",
"args": [
"/full/path/to/mcp-local-wp/dist/index.js"
]
}
}
}
For non-Local setups or custom configurations:
{
"mcpServers": {
"mcp-local-wp": {
"command": "npx",
"args": [
"-y",
"@verygoodplugins/mcp-local-wp@latest"
],
"env": {
"MYSQL_DB": "local",
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "root"
}
}
}
}
| Variable | Description | Example |
|---|---|---|
SITE_ID | Explicit site ID (highest priority) | lx97vbzE7 |
SITE_NAME | Site name for lookup | dev |
LOCAL_SITES_JSON | Override path to Local's sites.json | /custom/path/sites.json |
LOCAL_RUN_DIR | Override Local's run directory | /custom/run/path |
This MCP server was created because connecting to Local by Flywheel MySQL was "kind of difficult to get working" with existing MCP servers. Here's the story of what we solved:
When we first tried to use mcp-server-mysql with Local by Flywheel, we encountered several issues:
/Users/.../Local/run/lx97vbzE7/mysql/mysqld.sock where lx97vbzE7 changes each time you restart LocalWe solved this step by step:
Instead of guessing paths, we scan for the actual running MySQL process:
ps aux | grep mysqld | grep -v grep
This finds the active MySQL instance and extracts its configuration file path.
// From the process args: --defaults-file=/Users/.../Local/run/lx97vbzE7/conf/mysql/my.cnf
// We extract the site directory and build the socket path
const configPath = extractFromProcess();
const siteDir = path.dirname(path.dirname(path.dirname(configPath)));
const socketPath = path.join(siteDir, 'mysql/mysqld.sock');
The server automatically configures itself with:
local)root/root)โ
Restart Resilient: Works every time you restart Local by Flywheel
โ
Site Switching: Automatically adapts if you switch between Local sites
โ
Zero Maintenance: No need to manually update paths ever again
โ
Error Handling: Provides clear error messages if MySQL isn't running
~/Library/Application Support/Local/run/
โโโ lx97vbzE7/ # Dynamic site ID (changes on restart)
โ โโโ conf/mysql/my.cnf # We read this for port info
โ โโโ mysql/mysqld.sock # We connect via this socket
โโโ WP7lolWDi/ # Another site (if multiple running)
โโโ conf/mysql/my.cnf
โโโ mysql/mysqld.sock
The server intelligently finds the active site and connects to the right MySQL instance.
Once connected, you can use the mysql_query tool to execute any SQL query against your Local WordPress database:
SELECT ID, post_title, post_date, post_status
FROM wp_posts
WHERE post_type = 'post' AND post_status = 'publish'
ORDER BY post_date DESC
LIMIT 5;
-- See all tables
SHOW TABLES;
-- Examine a table structure
DESCRIBE wp_posts;
-- Get table info
SHOW TABLE STATUS LIKE 'wp_%';
-- Get site options
SELECT option_name, option_value
FROM wp_options
WHERE option_name IN ('blogname', 'blogdescription', 'admin_email');
-- Find active plugins
SELECT option_value
FROM wp_options
WHERE option_name = 'active_plugins';
-- Get user information
SELECT user_login, user_email, display_name
FROM wp_users
LIMIT 10;
-- Post meta data
SELECT p.post_title, pm.meta_key, pm.meta_value
FROM wp_posts p
JOIN wp_postmeta pm ON p.ID = pm.post_id
WHERE p.post_type = 'post' AND pm.meta_key = '_edit_last';
Start a Local site: Make sure you have an active Local by Flywheel site running
Clone and build:
git clone https://github.com/verygoodplugins/mcp-local-wp.git
cd mcp-local-wp
npm install
npm run build
Test the connection:
node dist/index.js
npm run dev
This runs the server with TypeScript watching for changes.
npm run lintnpm run lint:fixnpm run formatnpm run format:checkStandards are unified across MCP servers via ESLint + Prettier.
"No active MySQL process found"
"MySQL socket not found"
Connection refused
Permission denied
If auto-detection fails, you can manually configure the connection:
export MYSQL_SOCKET_PATH="/path/to/your/local/site/mysql/mysqld.sock"
export MYSQL_DB="local"
export MYSQL_USER="root"
export MYSQL_PASS="root"
Enable debug logging by setting DEBUG:
DEBUG=mcp-local-wp mcp-local-wp
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/your-feature-namenpm run buildGPL-3.0-or-later - see the LICENSE file for details. As a WordPress-focused tool, we embrace the copyleft philosophy to ensure this remains free and open for the community.
Built with ๐งก by Jack Arturo at Very Good Plugins ยท Made with love for the open-source community
Be the first to review this server!
by Modelcontextprotocol ยท Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno ยท Developer Tools
Toleno Network MCP Server โ Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace ยท Developer Tools
Create, build, and publish Python MCP servers to PyPI โ conversationally.
by Microsoft ยท Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace ยท Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm โ conversationally
by mcp-marketplace ยท Finance
Free stock data and market news for any MCP-compatible AI assistant.