适用于 VS Code 的 WordPress MCP 扩展
此 VS Code 扩展实现了用于 WordPress 集成的模型上下文协议 (MCP) 服务器。它可以帮助 VS Code 理解您的 WordPress 环境,使开发更轻松、更直观。
特征
WordPress 配置检测:通过从当前目录向上搜索父目录自动找到您的 wp-config.php 文件
数据库集成:提取 WordPress 数据库凭据并连接到您的 WordPress 数据库
WordPress 安装路径:检测 WordPress 安装目录
智能代码完成:为 WordPress 函数和钩子提供上下文感知的代码完成
文档悬停:显示 WordPress 功能的文档,包括当前 WordPress 版本
代码操作:提供特定于 WordPress 的代码操作和快速修复
要求
VS Code 1.74.0 或更高版本
扩展程序可以访问的 WordPress 安装
Node.js 和 npm(用于开发)
用法
打开包含 WordPress 安装或 WordPress 安装子目录的文件夹
该扩展程序将自动搜索 wp-config.php 文件
使用命令
WordPress MCP: Connect to WordPress明确连接到 WordPress 安装享受增强的 WordPress 编码以及基于特定 WordPress 环境的智能协助
扩展设置
此扩展不需要任何额外的设置。
已知问题
PHP 序列化解析以简化方式实现,可能无法处理所有序列化数据格式
VS Code 关闭时数据库连接需要正确关闭
发行说明
0.1.0
WordPress MCP 扩展的初始版本具有基本的 WordPress 集成功能。
发展
构建扩展
打包扩展
这会在您的项目目录中创建一个.vsix文件,该文件可以在 VS Code 中安装。
测试扩展
安装扩展后,您可以使用以下命令测试其功能:
测试 WordPress 连接:
> WordPress MCP: Connect to WordPress此命令将搜索并连接到您的 WordPress 安装。
查看 WordPress 配置:
> WordPress MCP: Show WordPress Configuration这将显示数据库凭据和其他 WordPress 配置详细信息。
查询 WordPress 数据库:
> WordPress MCP: Query Database这使您可以对 WordPress 数据库执行自然语言查询。
通过聊天测试 MCP 集成:
@wordpress What is the database name in wp-config.php?在 VS Code 聊天界面中使用,测试 MCP 集成。其他有用的查询:
@wordpress 数据库用户名是什么?
@wordpress 显示活动的插件
@wordpress 什么主题是活跃的?
@wordpress 有哪些自定义帖子类型可用?
Related MCP Servers
- Asecurity-licenseAqualityA Model Context Protocol server that helps large language models process code repositories by providing file tree generation, code merging, and code analysis capabilities.Last updated -322MIT License
- -security-license-qualityA standardized foundation for building Model Context Protocol servers that integrate with VS Code, using Python with stdio transport for seamless AI tool integration.Last updated -
WordPress MCPofficial
Asecurity-licenseAqualityA WordPress plugin that implements the Model Context Protocol to enable AI models and applications to interact with WordPress sites in a structured and secure way.Last updated -58594- -security-license-qualityA Model Context Protocol server that enables AI assistants to manage WordPress sites and create content with AI-generated featured images.Last updated -741MIT License