WordPress MCP サーバー
AIアシスタントがWordPress REST APIを介してWordPressサイトとやり取りできるようにするモデルコンテキストプロトコル(MCP)サーバー。安全な認証により複数のWordPressサイトをサポートし、自然言語によるコンテンツ管理、投稿操作、サイト設定を可能にします。
特徴
マルチサイトサポート:複数のWordPressサイトに同時に接続
REST API 統合: WordPress REST API エンドポイントへのフルアクセス
安全な認証: 安全なAPIアクセスのためにアプリケーションパスワードを使用します
動的エンドポイント検出: 各サイトの利用可能なエンドポイントを自動的にマッピングします
柔軟な操作: GET、POST、PUT、DELETE、PATCHメソッドのサポート
エラー処理: 意味のあるメッセージによる適切なエラー処理
シンプルな構成: メンテナンスしやすいJSON構成ファイル
Related MCP server: WordPress MCP Server
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop 用の WordPress サーバーを自動的にインストールするには:
npx -y @smithery/cli install server-wp-mcp --client claude手動インストール
npm install server-wp-mcpツールリファレンス
wp_discover_endpoints
WordPress サイト上の利用可能なすべての REST API エンドポイントをマップします。
引数:
{
"site": {
"type": "string",
"description": "Site alias (as defined in configuration)",
"required": true
}
}**戻り値:**使用可能なエンドポイントとそのメソッドおよび名前空間のリスト。
wp_call_endpoint
WordPress サイトへの REST API リクエストを実行します。
引数:
{
"site": {
"type": "string",
"description": "Site alias",
"required": true
},
"endpoint": {
"type": "string",
"description": "API endpoint path",
"required": true
},
"method": {
"type": "string",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
"description": "HTTP method",
"default": "GET"
},
"params": {
"type": "object",
"description": "Request parameters or body data",
"required": false
}
}構成
アプリケーションパスワードの取得
WordPressの管理ダッシュボードにログインする
ユーザー → プロフィールへ移動
「アプリケーションパスワード」セクションまでスクロールします
アプリケーションの名前を入力します(例:「MCP Server」)
「新しいアプリケーションパスワードを追加」をクリックします
生成されたパスワードをコピーします(再度表示することはできません)
注意: アプリケーション パスワードには、WordPress 5.6 以降と HTTPS が必要です。
設定ファイルのセットアップ
WordPress サイトの詳細を含む JSON 構成ファイル (例: wp-sites.json ) を作成します。
{
"myblog": {
"URL": "https://myblog.com",
"USER": "yourusername",
"PASS": "abcd 1234 efgh 5678"
},
"testsite": {
"URL": "https://test.example.com",
"USER": "anotherusername",
"PASS": "wxyz 9876 lmno 5432"
}
}各サイトの構成には次のものが必要です。
URL: WordPress サイトの URL (http:// または https:// を含める必要があります)USER: WordPressユーザー名PASS: アプリケーションパスワード(スペースは自動的に削除されます)
構成キー (例: 「myblog」、「testsite」) は、サーバーと対話するときに使用するサイト エイリアスになります。
Claude Desktopでの使用
claude_desktop_config.jsonに追加します:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["path/to/server/dist/index.js"],
"env": {
"WP_SITES_PATH": "/absolute/path/to/wp-sites.json"
}
}
}
}WP_SITES_PATH環境変数は、構成ファイルの絶対パスを指している必要があります。
使用例
設定が完了したら、Claude にさまざまな WordPress 操作を実行するよう依頼できます。
投稿の一覧表示とクエリ
Can you show me all posts from myblog published in the last month?Find all posts on testsite tagged with "technology" and "AI"Show me draft posts from myblog that need reviewコンテンツの作成と編集
Create a new draft post on testsite titled "The Future of AI" with these key points: [points]Update the featured image on myblog's latest post about machine learningAdd a new category called "Tech News" to myblogコメントの管理
Show me all pending comments on myblog's latest postFind comments from testsite that might be spamList the most engaged commenters on myblogプラグイン管理
What plugins are currently active on myblog?Check if any plugins on testsite need updatesTell me about the security plugins installed on myblogユーザー管理
Show me all users with editor role on testsiteCreate a new author account on myblogUpdate user roles and permissions on testsiteサイトの設定と構成
What theme is currently active on myblog?Check the permalink structure on testsiteShow me the current media library settings on myblogメンテナンスと診断
Check if there are any broken links on myblogShow me the PHP version and other system info for testsiteList any pending database updates on myblogエラー処理
サーバーは次のような一般的なエラーを処理します:
無効な設定ファイルのパスまたは形式
無効なサイト構成
認証失敗
エンドポイントが見つからないか無効です
APIレート制限
ネットワークエラー
すべてのエラーは、問題の診断に役立つ説明メッセージとともに返されます。
セキュリティに関する考慮事項
wp-sites.jsonファイルを安全に保ち、バージョン管理にコミットしないでください。本番環境では機密データに環境変数を使用することを検討してください
設定ファイルをパブリックディレクトリの外に保存する
すべてのWordPressサイトでHTTPSを使用する
アプリケーションのパスワードを定期的に変更する
ユーザーロールを割り当てるときは、最小権限の原則に従ってください。
依存関係
@modelcontextprotocol/sdk - MCP プロトコルの実装
axios - APIリクエスト用のHTTPクライアント
ライセンス
マサチューセッツ工科大学
Appeared in Searches
- Tools or techniques for controlling a browser to test code changes
- A server for finding demographic data to create a buyer profile
- Information about Meta ads or advertising on Meta platforms
- A guide to CI/CD (Continuous Integration and Continuous Deployment)
- An agent for accessing marketing data and brand assets to grow a company