WordPress MCP Server
An MCP server for managing multiple WordPress sites via the WordPress REST API. It supports posts, categories, tags, media, comments, and site configuration through natural language.
README
WordPress MCP Server(セルフホスト・マルチサイト対応版)
自前運営の複数WordPressサイトを、WordPress標準のREST API (wp-json/wp/v2) 経由で
1つのMCPサーバーからまとめて操作するためのローカルサーバーです。
各ツール呼び出し時に site パラメータ(エイリアス)でどのサイトを操作するか指定します。
投稿の一覧・作成・更新・削除、カテゴリ/タグ管理、メディアアップロード、コメント承認などができます。
1. WordPress側の準備:サイトごとにアプリケーションパスワードを発行する
管理するサイトそれぞれで以下を行います。WordPress 5.6以降なら追加プラグイン不要です。
- 各WordPressサイトの管理画面にログイン
ユーザー→プロフィールを開く- ページ下部の「アプリケーションパスワード」欄に任意の名前(例:
claude-mcp)を入力し、 「新規追加」をクリック - 表示される
xxxx xxxx xxxx xxxx xxxx xxxx形式のパスワードをコピーしておく (この画面を閉じると二度と表示されません)
⚠️ サイトが
http://の場合、多くの環境でアプリケーションパスワード機能が無効化されます。 常時HTTPS化(SSL)されているサイトで利用してください。
⚠️ セキュリティプラグイン(Wordfenceなど)やレンタルサーバーのWAFが REST APIやBasic認証をブロックしている場合、事前に許可設定が必要です。
2. このサーバーのセットアップ
cd wordpress-mcp
npm install
sites.json.example を sites.json にコピーして、管理する全サイトの情報を書きます
(このファイルには全サイトの認証情報が入るので、絶対に公開・共有・Gitコミットしないでください。
.gitignore に含めています)。
cp sites.json.example sites.json
{
"blog-a": {
"url": "https://blog-a.example.com",
"username": "user-a",
"app_password": "xxxx xxxx xxxx xxxx xxxx xxxx"
},
"blog-b": {
"url": "https://blog-b.example.com",
"username": "user-b",
"app_password": "yyyy yyyy yyyy yyyy yyyy yyyy"
},
"blog-c": {
"url": "https://blog-c.example.com",
"username": "user-c",
"app_password": "zzzz zzzz zzzz zzzz zzzz zzzz"
}
}
キー(blog-aなど)が、会話中でサイトを指定するときのエイリアス名になります。好きな名前を付けてOKです。
サイトを増やしたいときは、このファイルにエントリを追加するだけです(コードの変更は不要)。
3. Claude Desktop / Claude Code に登録する
このサーバーは純粋なNode.js製で、OS依存のコードは使っていないため macでもWindowsでも同じように動作します。
唯一の前提条件は Node.js 18以降がインストールされていることです(node --version で確認)。
マルチサイト対応版はサーバー登録は1つだけで済みます(サイトの切り替えはツール呼び出し時のsiteパラメータで行うため)。
設定ファイルの場所はOSによって異なります。
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json(Claude Desktopの設定 → Developer → Edit Configから開くのが確実です)
macOSの場合の例:
{
"mcpServers": {
"wordpress-multisite": {
"command": "node",
"args": ["/Users/あなたの名前/wordpress-mcp/index.js"],
"env": {
"SITES_CONFIG_PATH": "/Users/あなたの名前/wordpress-mcp/sites.json"
}
}
}
}
Windowsの場合の例(パス区切りは \\ でエスケープするか / を使う):
{
"mcpServers": {
"wordpress-multisite": {
"command": "node",
"args": ["C:\\Users\\あなたの名前\\wordpress-mcp\\index.js"],
"env": {
"SITES_CONFIG_PATH": "C:\\Users\\あなたの名前\\wordpress-mcp\\sites.json"
}
}
}
}
SITES_CONFIG_PATH を省略した場合は、index.jsと同じフォルダにある sites.json を自動的に探しに行きます。
Windows版Claude Desktop(ストア/MSIXインストール)では、「Edit Config」ボタンが開くファイルと 実際に読み込まれるファイルが異なる既知の不具合が報告されています。設定してもツールが表示されない場合は、
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.jsonも確認してください。
Claude Codeの場合は claude mcp add コマンド、もしくは同様の設定を
プロジェクトの .mcp.json に追加してください(こちらはmac/Windows/Linuxで共通の仕組みです)。
設定後、Claude Desktop/Claude Codeを再起動すると wp_list_posts などのツールが使えるようになります。
4. 使い方
まず wp_list_sites で設定済みサイトのエイリアス一覧を確認し、以降のツール呼び出しで
site: "blog-a" のように指定します。
例:「blog-bの下書き一覧を見せて」「blog-cに新しい記事を下書きで作成して」
5. 使えるツール一覧
| ツール名 | 説明 |
|---|---|
wp_list_sites |
設定済みサイトのエイリアスとURL一覧を取得(最初に確認推奨) |
wp_list_posts |
記事の一覧・検索(ステータス、カテゴリ等で絞り込み可) |
wp_get_post |
記事詳細(本文含む)を取得 |
wp_create_post |
記事を新規作成(既定は下書き) |
wp_update_post |
既存記事を更新 |
wp_delete_post |
記事を削除(既定はゴミ箱、forceで完全削除) |
wp_list_categories |
カテゴリ一覧 |
wp_create_category |
カテゴリ作成 |
wp_list_tags |
タグ一覧 |
wp_upload_media_from_url |
URL指定で画像をメディアライブラリにアップロード |
wp_list_media |
メディア一覧 |
wp_list_comments |
コメント一覧(承認待ちの確認など) |
wp_moderate_comment |
コメントの承認/非承認/スパム/ゴミ箱操作 |
(wp_list_sites 以外は全て第一引数に site エイリアスが必要です)
6. 動作確認
SITES_CONFIG_PATH=/絶対パス/sites.json node index.js
「WordPress MCP server (multisite) がstdioで起動しました。登録サイト: ...」と表示され、 設定した全エイリアスが列挙されれば起動成功です。
7. 注意事項
wp_delete_postにforce: trueを渡すと完全削除され復元できません。実行前に必ず確認してください。- アプリケーションパスワードはユーザーの権限をそのまま引き継ぎます。専用の投稿者/編集者アカウントを 作って、そのアプリケーションパスワードを使うことをおすすめします。
- 記事本文(
content)はHTML(またはGutenbergブロックHTML)として扱われます。Markdownをそのまま 渡すとタグとして表示されてしまうので注意してください。 sites.jsonには全サイトの認証情報がまとまって入るため、ファイルのアクセス権限やバックアップの 取り扱いに注意してください。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.