WordPress MCP Extension for VS Code
LocalAbout WordPress MCP Extension for VS Code
A VS Code extension that connects to a WordPress installation and provides environment-aware coding support. It detects configuration and database details, and adds WordPress completions, documentation hovers, and code actions.
Key features
- 01Detects wp-config.php and installation path
- 02Connects to the WordPress database
- 03WordPress-aware code completion
- 04Function and hook documentation hovers
- 05WordPress-specific code actions
Use cases
- 01Find WordPress configuration from a project folder
- 02Inspect database details and query WordPress data
- 03Get help with WordPress functions and hooks
MCP support
The extension implements an MCP server for WordPress integration in VS Code. It connects the editor to a WordPress installation and its database.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEWordPress MCP Extension for VS Code
This VS Code extension implements a Model Context Protocol (MCP) server for WordPress integration. It helps VS Code understand your WordPress environment, making development easier and more intuitive.
Features
- WordPress Configuration Detection: Automatically finds your wp-config.php file by searching from the current directory up through parent directories
- Database Integration: Extracts WordPress database credentials and connects to your WordPress database
- WordPress Installation Path: Detects the WordPress installation directory
- Intelligent Code Completion: Provides context-aware code completion for WordPress functions and hooks
- Documentation Hover: Shows documentation for WordPress functions including the current WordPress version
- Code Actions: Offers WordPress-specific code actions and quick fixes
Requirements
- VS Code 1.74.0 or higher
- A WordPress installation that the extension can access
- Node.js and npm (for development)
Usage
- Open a folder that contains a WordPress installation or is a child directory of a WordPress installation
- The extension will automatically search for a wp-config.php file
- Use the command
WordPress MCP: Connect to WordPressto explicitly connect to the WordPress installation - Enjoy enhanced WordPress coding with intelligent assistance based on your specific WordPress environment
Extension Settings
This extension doesn't require any additional settings.
Known Issues
- PHP serialization parsing is implemented in a simplified way and may not handle all serialized data formats
- Database connection needs to close properly when VS Code shuts down
Release Notes
0.1.0
Initial release of WordPress MCP Extension with basic WordPress integration features.
Development
Building the Extension
npm install
npm run compile
Packaging the Extension
npm install -g vsce
vsce package
This creates a .vsix file in your project directory that can be installed in VS Code.
Testing the Extension
After installing the extension, you can test its functionality using these commands:
-
Test WordPress Connection:
> WordPress MCP: Connect to WordPressThis command will search for and connect to your WordPress installation.
-
View WordPress Configuration:
> WordPress MCP: Show WordPress ConfigurationThis displays database credentials and other WordPress configuration details.
-
Query WordPress Database:
> WordPress MCP: Query DatabaseThis allows you to execute natural language queries against your WordPress database.
-
Test MCP Integration via Chat:
@wordpress What is the database name in wp-config.php?Use in the VS Code chat interface to test the MCP integration. Other useful queries:
- @wordpress What is the database username?
- @wordpress Show me active plugins
- @wordpress What theme is active?
- @wordpress What custom post types are available?
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.