Skip to main content
Glama

WordPress MCP Extension

适用于 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(用于开发)

用法

  1. 打开包含 WordPress 安装或 WordPress 安装子目录的文件夹
  2. 该扩展程序将自动搜索 wp-config.php 文件
  3. 使用命令WordPress MCP: Connect to WordPress明确连接到 WordPress 安装
  4. 享受增强的 WordPress 编码以及基于特定 WordPress 环境的智能协助

扩展设置

此扩展不需要任何额外的设置。

已知问题

  • PHP 序列化解析以简化方式实现,可能无法处理所有序列化数据格式
  • VS Code 关闭时数据库连接需要正确关闭

发行说明

0.1.0

WordPress MCP 扩展的初始版本具有基本的 WordPress 集成功能。


发展

构建扩展

npm install npm run compile

打包扩展

npm install -g vsce vsce package

这会在您的项目目录中创建一个.vsix文件,该文件可以在 VS Code 中安装。

测试扩展

安装扩展后,您可以使用以下命令测试其功能:

  1. 测试 WordPress 连接
    > WordPress MCP: Connect to WordPress
    此命令将搜索并连接到您的 WordPress 安装。
  2. 查看 WordPress 配置
    > WordPress MCP: Show WordPress Configuration
    这将显示数据库凭据和其他 WordPress 配置详细信息。
  3. 查询 WordPress 数据库
    > WordPress MCP: Query Database
    这使您可以对 WordPress 数据库执行自然语言查询。
  4. 通过聊天测试 MCP 集成
    @wordpress What is the database name in wp-config.php?
    在 VS Code 聊天界面中使用,测试 MCP 集成。其他有用的查询:
    • @wordpress 数据库用户名是什么?
    • @wordpress 显示活动的插件
    • @wordpress 什么主题是活跃的?
    • @wordpress 有哪些自定义帖子类型可用?
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

为 WordPress 实现模型上下文协议服务器,通过 WordPress 特定的智能增强 VS Code,包括数据库集成、代码完成和文档。

  1. 特征
    1. 要求
      1. 用法
        1. 扩展设置
          1. 已知问题
            1. 发行说明
              1. 0.1.0
            2. 发展
              1. 构建扩展
              2. 打包扩展
              3. 测试扩展

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.
              Last updated -
              12
              Python
              MIT License
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.
              Last updated -
              • Apple
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that exposes over 200+ APIs from API.market as MCP resources, allowing large language models to discover and interact with various APIs through natural language commands.
              Last updated -
              111
              2
              TypeScript
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              A flexible Model Context Protocol server that makes documentation or codebases searchable by AI assistants, allowing users to chat with code or docs by simply pointing to a git repository or folder.
              Last updated -
              1
              31
              19
              JavaScript
              MIT License

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/sharmashivanand/mcp-wordpress'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server