WordPress MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables interaction with WordPress sites through the REST API, supporting content management, post operations, user management, plugin administration, comment moderation, and site configuration across multiple WordPress installations.

WordPress MCP サーバー

AIアシスタントがWordPress REST APIを介してWordPressサイトとやり取りできるようにするモデルコンテキストプロトコル(MCP)サーバー。安全な認証により複数のWordPressサイトをサポートし、自然言語によるコンテンツ管理、投稿操作、サイト設定を可能にします。

特徴

  • マルチサイトサポート:複数のWordPressサイトに同時に接続
  • REST API 統合: WordPress REST API エンドポイントへのフルアクセス
  • 安全な認証: 安全なAPIアクセスのためにアプリケーションパスワードを使用します
  • 動的エンドポイント検出: 各サイトの利用可能なエンドポイントを自動的にマッピングします
  • 柔軟な操作: GET、POST、PUT、DELETE、PATCHメソッドのサポート
  • エラー処理: 意味のあるメッセージによる適切なエラー処理
  • シンプルな構成: メンテナンスしやすいJSON構成ファイル

インストール

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 } }

構成

アプリケーションパスワードの取得

  1. WordPressの管理ダッシュボードにログインする
  2. ユーザー → プロフィールへ移動
  3. 「アプリケーションパスワード」セクションまでスクロールします
  4. アプリケーションの名前を入力します(例:「MCP Server」)
  5. 「新しいアプリケーションパスワードを追加」をクリックします
  6. 生成されたパスワードをコピーします(再度表示することはできません)

注意: アプリケーション パスワードには、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 learning
Add a new category called "Tech News" to myblog

コメントの管理

Show me all pending comments on myblog's latest post
Find comments from testsite that might be spam
List the most engaged commenters on myblog

プラグイン管理

What plugins are currently active on myblog?
Check if any plugins on testsite need updates
Tell me about the security plugins installed on myblog

ユーザー管理

Show me all users with editor role on testsite
Create a new author account on myblog
Update user roles and permissions on testsite

サイトの設定と構成

What theme is currently active on myblog?
Check the permalink structure on testsite
Show me the current media library settings on myblog

メンテナンスと診断

Check if there are any broken links on myblog
Show me the PHP version and other system info for testsite
List any pending database updates on myblog

エラー処理

サーバーは次のような一般的なエラーを処理します:

  • 無効な設定ファイルのパスまたは形式
  • 無効なサイト構成
  • 認証失敗
  • エンドポイントが見つからないか無効です
  • APIレート制限
  • ネットワークエラー

すべてのエラーは、問題の診断に役立つ説明メッセージとともに返されます。

セキュリティに関する考慮事項

  • wp-sites.jsonファイルを安全に保ち、バージョン管理にコミットしないでください。
  • 本番環境では機密データに環境変数を使用することを検討してください
  • 設定ファイルをパブリックディレクトリの外に保存する
  • すべてのWordPressサイトでHTTPSを使用する
  • アプリケーションのパスワードを定期的に変更する
  • ユーザーロールを割り当てるときは、最小権限の原則に従ってください。

依存関係

  • @modelcontextprotocol/sdk - MCP プロトコルの実装
  • axios - APIリクエスト用のHTTPクライアント

ライセンス

マサチューセッツ工科大学

-
security - not tested
A
license - permissive license
-
quality - not tested

AIアシスタントがWordPress REST APIを介してWordPressサイトと連携できるようにします。安全な認証により複数のWordPressサイトをサポートし、自然言語によるコンテンツ管理、投稿操作、サイト設定を可能にします。

  1. Features
    1. Installation
      1. Installing via Smithery
      2. Manual Installation
    2. Tools Reference
      1. wp_discover_endpoints
      2. wp_call_endpoint
    3. Configuration
      1. Getting an Application Password
      2. Configuration File Setup
      3. Usage with Claude Desktop
      4. Example Usage
    4. Error Handling
      1. Security Considerations
        1. Dependencies
          1. License
            ID: pjw96aoyh6