1L

10up/localwp-agent-tools

开发工具官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

52 stars 8 forks 质量 83 趋势 27GPL-2.0

10up/localwp-agent-tools 是从 https://github.com/10up/localwp-agent-tools. 导入的 MCP 服务器候选

概览

10up/localwp-agent-tools 是从 https://github.com/10up/localwp-agent-tools. 导入的 MCP 服务器候选

概述(AI 翻译)

一个本地插件,提供 MCP 服务器和项目上下文,用于 AI 驱动的 WordPress 开发。可支持 Claude Code、Cursor、Windsurf、VS Code Copilot 及任何 MCP 客户端。

它的作用

当你在本地网站点击“启用”时,插件:

  1. 将站点注册到MCP服务器——这是运行在Local主进程中的单一HTTP服务器,为AI工具提供WP-CLI、错误日志、配置和站点管理的访问
  2. 编写MCP配置(.mcp.json、.cursor/mcp.json等)——自动配置正确的HTTP端点和每个代理的每个安装承载令牌(见下文认证)
  3. 生成项目上下文(CLAUDE.md、.cursorrules等)——包括PHP/MySQL版本、活跃插件、主题和文件结构
  4. 更新 .gitignore — MCP 配置文件现在携带一个秘密(承载令牌)与生成的上下文文件并存,因此所有配置文件都被 git 忽略,且无提交

然后在你选择的AI工具中打开网站文件夹,就可以开始使用了。

建筑

MCP服务器作为Local的Electron主进程内的单一HTTP服务器运行——每个站点没有独立的Node.js进程。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

LocalWP Agent Tools

A Local add-on that provides an MCP server and project context for AI-powered WordPress development. Works with Claude Code, Cursor, Windsurf, VS Code Copilot, and any MCP client.

What It Does

When you click “Enable” on a site in Local, the add-on:

  1. Registers the site with the MCP server — a single HTTP server running in Local’s main process that gives AI tools access to WP-CLI, error logs, configuration, and site management
  2. Writes MCP config (.mcp.json, .cursor/mcp.json, etc.) — auto-configured with the correct HTTP endpoint and the per-install bearer token for each agent (see Authentication below)
  3. Generates project context (CLAUDE.md, .cursorrules, etc.) — site context including PHP/MySQL versions, active plugins, theme, and file structure
  4. Updates .gitignore — the MCP config files now carry a secret (the bearer token) alongside the generated context files, so all of them are git-ignored and none are committed

Then open the site folder in your AI tool of choice and you’re ready to go.

Architecture

The MCP server runs as a single HTTP server inside Local’s Electron main process — no separate Node.js processes per site. It serves two kinds of endpoint:

http://localhost:{port}/sites/mcp             # global — all of Local
http://localhost:{port}/sites/{siteId}/mcp    # one specific site

The server uses the MCP Streamable HTTP transport. The port is stable across restarts (persisted at ~/.local-agent-tools/port, default 24842).

Sites remain registered even when stopped, so the MCP endpoint is always reachable. Tools that need running services (WP-CLI, database) return appropriate errors; file-based tools (config, logs, site info) work regardless. Config is refreshed on each tool call, so starting a site automatically makes database tools work without reconnecting.

Authentication

Every request to the MCP server needs an Authorization: Bearer header. That header is the only channel; there is no ?token= URL parameter.

The add-on creates the token on first start and stores it at ~/.local-agent-tools/token, with mode 0600 in a 0700 directory. The token survives restarts, and the server checks it in constant time.

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "local-wp-global": { "type": "http", "url": "http://localhost:24842/sites/mcp", "headers": { "Authorization": "Bearer <token from ~/.local-agent-tools/token>" } } } }