MCP Adapter
OfficialMCP 어댑터
AI Building Blocks for WordPress 이니셔티브의 일부
WordPress 기능을 AI 에이전트를 위한 Model Context Protocol (MCP) 도구, 리소스 및 프롬프트로 노출하는 공식 WordPress MCP 통합 패키지입니다.
개요
이 어댑터는 WordPress Abilities API와 MCP 사양을 연결하여 AI 에이전트가 WordPress 기능과 상호작용할 수 있는 표준화된 방법을 제공합니다. HTTP 및 STDIO 전송 지원, 포괄적인 오류 처리, 사용자 정의 통합을 위한 확장 가능한 아키텍처를 포함합니다.
Related MCP server: MCP Adapter Implementation Example
기능
핵심 기능
Ability-to-MCP 변환: WordPress abilities를 MCP 도구, 리소스 및 프롬프트로 자동 변환합니다.
다중 서버 관리: 고유한 구성을 가진 여러 MCP 서버를 생성하고 관리합니다.
확장 가능한 전송 계층:
HTTP 전송: HTTP 기반 통신을 위한 MCP 2025-11-25 사양을 구현한 통합 전송 방식입니다.
STDIO 전송: 로컬 개발 및 CLI 통합을 위해 표준 입출력을 통한 프로세스 기반 통신을 제공합니다.
사용자 정의 전송 지원:
McpTransportInterface를 구현하여 특수한 통신 프로토콜을 생성합니다.다중 전송 구성: 여러 전송 방식을 동시에 사용하도록 서버를 구성합니다.
유연한 오류 처리:
기본 제공 오류 처리기: WordPress 호환 기본 오류 로깅이 포함되어 있습니다.
사용자 정의 오류 처리기: 사용자 정의 로깅, 모니터링 또는 알림 시스템을 위해
McpErrorHandlerInterface를 구현합니다.서버별 처리기: MCP 서버마다 다른 오류 처리 전략을 사용합니다.
관측성:
기본 제공 관측성: 구성 가능한 핸들러와 함께 기본 제공되는 제로 오버헤드 메트릭 추적 기능입니다.
사용자 정의 관측성 처리기: 모니터링 시스템과의 통합을 위해
McpObservabilityHandlerInterface를 구현합니다.
검증: 확장 가능한 검증 규칙으로 도구, 리소스 및 프롬프트에 대한 기본 제공 검증을 제공합니다.
권한 제어: 구성 가능한 전송 권한으로 노출된 모든 기능에 대한 세분화된 권한 검사를 제공합니다.
MCP 구성 요소 지원
도구: WordPress abilities를 AI 에이전트 상호작용을 위한 실행 가능한 MCP 도구로 변환합니다.
리소스: 상황별 정보 액세스를 위해 WordPress 데이터를 MCP 리소스로 노출합니다.
프롬프트: AI 안내 및 템플릿을 위해 abilities를 구조화된 MCP 프롬프트로 변환합니다.
서버 검색: MCP 프로토콜 표준을 따르는 MCP 서버의 자동 등록 및 검색을 제공합니다.
기본 제공 Abilities: 시스템 검사 및 ability 관리를 위한 핵심 WordPress abilities를 제공합니다.
CLI 통합: MCP 사양에 정의된 대로 STDIO 전송을 지원하는 WP-CLI 명령을 제공합니다.
아키텍처
구성 요소 구조에 대한 전체 설명은 아키텍처 개요를 참조하세요.
종속성
PHP: >= 7.4
WordPress: >= 6.9 (코어에 Abilities API 포함 — 별도 플러그인 불필요)
php-mcp-schema (
^0.1.0): MCP 프로토콜 유형을 위한 타입이 지정된 DTO
설치
MCP 어댑터는 WordPress 플러그인으로 배포됩니다. 다른 플러그인과 마찬가지로 설치하고 활성화하세요. 릴리스에는 필요한 모든 것이 포함되어 있으므로 연결할 오토로더나 실행할 빌드 단계가 없습니다.
WordPress 6.9 이상이 필요합니다. Abilities API는 코어의 일부이므로 별도로 설치할 플러그인은 없습니다.
수동 설치
GitHub 릴리스 페이지에서 최신 안정 버전 mcp-adapter.zip을 다운로드한 다음 플러그인 → 새 플러그인 추가 → 플러그인 업로드에서 업로드하고 활성화하세요.
WP-CLI 사용
wp plugin install https://github.com/WordPress/mcp-adapter/releases/latest/download/mcp-adapter.zip --activateWP-Env 사용
// .wp-env.json
{
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"plugins": [
"https://github.com/WordPress/mcp-adapter/releases/latest/download/mcp-adapter.zip"
]
}플러그인의 종속성으로 사용
WP\MCP 클래스는 MCP 어댑터 플러그인에서 제공되므로 플러그인 헤더의 Requires Plugins 필드를 사용하여 이 플러그인을 플러그인 종속성으로 선언하세요.
<?php
/**
* Plugin Name: My Plugin
* Description: Adds MCP tools for my feature.
* Requires Plugins: mcp-adapter
*/플러그인에서 MCP 어댑터 사용
plugins_loaded에서 가용성을 확인하고 초기화하여 어댑터가 시작되기 전에 모든 플러그인을 사용할 수 있도록 하세요.
add_action( 'plugins_loaded', function() {
if ( ! class_exists( 'WP\MCP\Core\McpAdapter' ) ) {
// MCP Adapter is not active — show an admin notice or return early.
return;
}
\WP\MCP\Core\McpAdapter::instance();
} );기본 사용법
MCP 어댑터는 계층적 아키텍처를 통해 등록된 WordPress abilities를 노출하는 기본 서버를 자동으로 생성합니다. 이를 통해 수동으로 서버를 구성할 필요 없이 즉시 MCP 기능을 사용할 수 있습니다.
작동 방식:
meta.public이true로 설정된wp_register_ability()를 통해 등록된 WordPress abilities는 기본 제공 어댑터 도구를 통해 기본 서버에서 검색 및 실행할 수 있습니다.meta.mcp.public을 명시적으로 설정하여 MPC에 대해서만 상위 수준 설정을 재정의합니다.false는 공개 ability를 비공개로,true는 비공개 ability를 MCP에 노출합니다.기본 서버에서 공개 abilities는
tools/list에 개별적으로 자동 등록되는 대신mcp-adapter/discover-abilities,mcp-adapter/get-ability-info및mcp-adapter/execute-ability를 통해 액세스됩니다.또는 사용자 정의 MCP 서버 만들기에서 abilities를 명시적으로 나열할 수 있습니다. 이 경우
meta.mcp.public플래그 없이 MCP 도구, 리소스 또는 프롬프트로 직접 노출할 수 있습니다.기본 서버는 HTTP 및 STDIO 전송을 모두 지원하며 여러 MCP 프로토콜 버전을 지원합니다.
기본 제공 오류 처리 및 관측성이 포함되어 있습니다.
HTTP를 통한 액세스:
/wp-json/mcp/mcp-adapter-default-serverSTDIO를 통한 액세스:
wp mcp-adapter serve --server=mcp-adapter-default-server
// Simply register a WordPress ability
add_action( 'wp_abilities_api_init', function() {
wp_register_ability( 'my-plugin/get-posts', [
'label' => 'Get Posts',
'description' => 'Retrieve WordPress posts with optional filtering',
'category' => 'site',
'input_schema' => [
'type' => 'object',
'properties' => [
'numberposts' => [
'type' => 'integer',
'description' => 'Number of posts to retrieve',
'default' => 5,
'minimum' => 1,
'maximum' => 100
],
'post_status' => [
'type' => 'string',
'description' => 'Post status to filter by',
'enum' => ['publish', 'draft', 'private'],
'default' => 'publish'
]
]
],
'output_schema' => [
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'ID' => ['type' => 'integer'],
'post_title' => ['type' => 'string'],
'post_content' => ['type' => 'string'],
'post_date' => ['type' => 'string'],
'post_author' => ['type' => 'string']
]
]
],
'execute_callback' => function( $input ) {
$args = [
'numberposts' => $input['numberposts'] ?? 5,
'post_status' => $input['post_status'] ?? 'publish'
];
return get_posts( $args );
},
'permission_callback' => function() {
return current_user_can( 'read' );
},
'meta' => [
'public' => true, // Expose to clients, including the default MCP server
],
]);
});
// With the meta.public flag, the ability is exposed through the default MCP server.
// In the default server configuration, discover it via `discover-abilities`
// and invoke it via `mcp-adapter/execute-ability` rather than expecting
// it to appear as its own entry in `tools/list`.
// To opt out of MCP while remaining public to other clients, explicitly set
// meta.mcp.public to false.
// To expose only through MCP, omit `meta.public` and set `meta.mcp.public` to true.
// Without either public flag, abilities are only accessible through custom MCP
// servers that explicitly list them.
// Note: how far `meta.public` reaches depends on the WordPress version. WordPress
// core starts applying `meta.public` to the REST API (`meta.show_in_rest`) in 7.1. On
// WordPress 6.9 and 7.0, this adapter honors `meta.public` for MCP, but REST API
// access still requires setting `meta.show_in_rest` to true.WordPress abilities 생성에 대한 자세한 내용은 Abilities API 개발자 문서를 참조하세요.
MCP 서버에 연결
MCP 어댑터는 여러 연결 방법을 지원합니다. MCP 클라이언트로 연결하는 예는 다음과 같습니다.
STDIO 전송 (로컬 개발)
로컬 개발 및 테스트의 경우 WP-CLI 명령을 사용하여 MCP 서버와 직접 상호작용할 수 있습니다.
# List all available MCP servers
wp mcp-adapter list
# Test the discover abilities tool to see all available WordPress abilities
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"mcp-adapter-discover-abilities","arguments":{}}}' | wp mcp-adapter serve --user=admin --server=mcp-adapter-default-server
# Test listing available tools
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | wp mcp-adapter serve --user=admin --server=mcp-adapter-default-serverMCP 클라이언트 구성
MCP 클라이언트(Claude Desktop, Claude Code, VS Code, Cursor 등)를 구성하여 WordPress MCP 서버에 연결합니다.
{
"mcpServers": {
"wordpress-default": {
"command": "wp",
"args": [
"--path=/path/to/your/wordpress/site",
"mcp-adapter",
"serve",
"--server=mcp-adapter-default-server",
"--user=admin"
]
},
"wordpress-custom": {
"command": "wp",
"args": [
"--path=/path/to/your/wordpress/site",
"mcp-adapter",
"serve",
"--server=your-custom-server-id",
"--user=admin"
]
}
}
}@automattic/mcp-wordpress-remote 프록시는 로컬에서 실행되며 AI 클라이언트의 STDIO 기반 MCP 통신을 WordPress가 이해하는 HTTP REST API 호출로 변환합니다. 인증은 WordPress 애플리케이션 비밀번호를 사용합니다.
{
"mcpServers": {
"wordpress-http-default": {
"command": "npx",
"args": [
"-y",
"@automattic/mcp-wordpress-remote@latest"
],
"env": {
"WP_API_URL": "http://your-site.test/wp-json/mcp/mcp-adapter-default-server",
"LOG_FILE": "/path/to/logs/mcp-adapter.log",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password"
}
},
"wordpress-http-custom": {
"command": "npx",
"args": [
"-y",
"@automattic/mcp-wordpress-remote@latest"
],
"env": {
"WP_API_URL": "http://your-site.test/wp-json/your-namespace/your-route",
"LOG_FILE": "/path/to/logs/mcp-adapter.log",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password"
}
}
}
}고급 사용법
사용자 정의 MCP 서버 만들기
고급 사용 사례의 경우 특정 구성으로 사용자 정의 MCP 서버를 만들 수 있습니다.
add_action( 'mcp_adapter_init', function( $adapter ) {
$adapter->create_server(
'my-server-id', // Unique server identifier
'my-namespace', // REST API namespace
'mcp', // REST API route
'My MCP Server', // Server name
'Description of my server', // Server description
'v1.0.0', // Server version
array( // Transport methods
\WP\MCP\Transport\HttpTransport::class,
),
\WP\MCP\Infrastructure\ErrorHandling\ErrorLogMcpErrorHandler::class, // Error handler
\WP\MCP\Infrastructure\Observability\NullMcpObservabilityHandler::class, // Observability handler
array( 'my-plugin/my-ability' ), // Abilities to expose as tools
array(), // Resources (optional)
array() // Prompts (optional)
);
} );사용자 정의 전송 구현
MCP 어댑터에는 프로덕션 준비가 된 HTTP 전송이 포함되어 있습니다. 사용자 정의 인증, 메시지 큐 또는 엔터프라이즈 통합과 같은 특수한 요구 사항이 있는 경우 사용자 정의 전송 프로토콜을 만들 수 있습니다.
자세한 구현 지침은 사용자 정의 전송 가이드를 참조하세요.
사용자 정의 전송 권한
MCP 어댑터는 전송 권한 콜백을 통한 사용자 정의 인증 논리를 지원합니다. 기본 is_user_logged_in() 검사 대신 MCP 서버에 대한 사용자 정의 인증을 구현할 수 있습니다.
자세한 인증 패턴은 전송 권한 가이드를 참조하세요.
사용자 정의 오류 처리기
MCP 어댑터에는 기본 WordPress 호환 오류 처리기가 포함되어 있지만 기존 로깅 시스템, 모니터링 도구와 통합하거나 특정 요구 사항을 충족하도록 사용자 정의 오류 처리를 구현할 수 있습니다.
자세한 구현 지침은 오류 처리 가이드를 참조하세요.
사용자 정의 관측성 처리기
MCP 어댑터에는 메트릭 및 이벤트 추적을 위한 기본 제공 관측성이 포함되어 있습니다. 모니터링 시스템, 분석 플랫폼 또는 성능 추적 도구와 통합하도록 사용자 정의 관측성 처리기를 구현할 수 있습니다.
자세한 메트릭 추적 및 사용자 정의 처리기 구현은 관측성 가이드를 참조하세요.
마이그레이션
마이그레이션 가이드: v0.5.0 — 주요 변경 사항 및 업그레이드 지침
마이그레이션 가이드: v0.3.0 — 전송, 관측성 및 훅 이름 변경 사항
라이선스
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseBqualityFmaintenanceA WordPress plugin that implements the Model Context Protocol to enable AI models and applications to interact with WordPress sites in a structured and secure way.536944ISC- FlicenseNot gradedqualityDmaintenanceEnables WordPress content management through the Model Context Protocol, allowing AI agents to create, read, update, and delete posts, metadata, taxonomies, and terms, as well as interact with Gutenberg blocks.1
- FlicenseNot gradedqualityFmaintenanceEnables WordPress content management (posts, metadata, taxonomies, Gutenberg blocks) via the Model Context Protocol, demonstrating MCP Adapter integration patterns.
- AlicenseNot gradedqualityCmaintenanceA comprehensive WordPress plugin that implements the Model Context Protocol (MCP) to expose WordPress functionality through standardized interfaces, enabling AI models and applications to interact with WordPress sites securely using multiple transport protocols and enterprise-grade authentication.36MIT
Related MCP Connectors
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
WordPress MCP server: publish posts, AI images, SEO and full site management, self-hosted
WordPress MCP server: generate SEO posts, AI images, autoblog & WooCommerce on your self-hosted site
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/WordPress/mcp-adapter'
If you have feedback or need assistance with the MCP directory API, please join our Discord server