Skip to main content
Glama

mcp-rs

A Rust implementation of a Model Context Protocol (MCP) server that gives AI clients tools for WordPress, databases (PostgreSQL, MySQL, MariaDB), and external MCP plugins.

Ask Claude to draft, schedule, and publish WordPress posts, upload media, or moderate comments. Install it with Scoop or Homebrew, answer a few questions in mcp-rs init, and it is registered with Claude Desktop, Claude Code, and GitHub Copilot.

English | ๆ—ฅๆœฌ่ชž

Version Implementation License

Overview

mcp-rs is an MCP server written in Rust. MCP clients such as Claude Desktop and Claude Code connect to it over STDIO, and other clients over HTTP. It offers:

  • 41 WordPress tools (posts, pages, custom post types, media, categories, tags and other taxonomies, comments, site settings) through the WordPress REST API

  • Read-only SQL tools for one PostgreSQL, MySQL, or MariaDB database (writes only when allowed)

  • The tools of external MCP servers, started as plugins (child process, Docker container, or Kubernetes Job)

  • For HTTP mode: API key or OAuth 2.1 authentication, per-caller tool limits, TLS/mTLS, rate limiting, and an audit log

Related MCP server: WP Database MCP Server

๐Ÿš€ Key Features

Core Capabilities

  • MCP over JSON-RPC 2.0: Protocol versions up to 2025-11-25 (with initialize), and 2026-07-28 (server/discover and per-request _meta, over STDIO and HTTP /mcp)

  • Transports: STDIO, and HTTP (with optional WebSocket on /ws)

  • Plugins: Add the tools of any MCP server that speaks STDIO, run as a child process, in a Docker container, or as a Kubernetes Job. See Plugins

  • Configuration: One TOML file, with ${VAR} for values from environment variables

  • Status Tool: mcp_rs_status shows the version, config file, log files, and what failed to start

WordPress Integration (41 Tools)

  • Posts & Pages Management: Create, read (full editable source), update, and delete posts and pages, with SEO metadata and scheduling; list revisions and restore one

  • Media Management: Upload with base64 (type, extension, and content validation), list, update metadata, delete, and set featured images

  • Categories & Tags Management: Create, update, and delete, with hierarchical categories

  • Comments: List by status (awaiting moderation, spam and others), approve, mark as spam, reply, and delete

  • YouTube & Social Embeds: Rich media integration with security validation

  • Site Settings: Read and update site settings and the front page configuration

  • Health Check: Verify connectivity, authentication, permissions, and media upload capability

  • Custom Post Types: Products, events and other post types that the site exposes in the REST API, when allowed in post_types, with their own taxonomies (docs)

  • Prompts: Ready-made requests in the client's menu: draft a post, review a post's SEO, moderate comments (and summarize a database table)

  • Multiple Sites: Use several WordPress sites from one mcp-rs; each tool takes a site argument (docs)

Live Demo Site

The examples/wordpress_site_builder_demo.rs example builds and updates the public WordPress demo site at redring.jp. It is a real-world showcase of how mcp-rs can bootstrap a site and organize content in production.

Security

  • Credentials Out of Files: mcp-rs init keeps the WordPress Application Password and the database password in the OS credential store. They can also be stored encrypted with AES-GCM-256 (PBKDF2 key derivation), or read from an environment variable

  • HTTP Mode Authentication: API keys, or OAuth 2.1 access tokens (JWT) issued by an external authorization server

  • Per-Caller Tool Limits: Allow each API key or token only the tools it needs (for example @read_only)

  • TLS/mTLS: HTTPS with a minimum TLS version, and optional client certificates

  • Network Policy, Anti-Replay and Intrusion Detection for the HTTP/WebSocket listener

  • Rate Limiting of tool calls

  • Audit Logging: Who called which tool, and the result

Database Integration (PostgreSQL, MySQL, MariaDB)

  • One Section to Connect: Add [database] to the configuration file (engine = "postgresql", or "mysql" or "mariadb" (v0.25.0 and later), host, database, user, and password = "${VAR}")

  • Read-Only by Default: execute_query (one SELECT, run in a read-only transaction that is rolled back) and get_schema

  • Writes Only When Allowed: execute_command (one INSERT, UPDATE, or DELETE) is offered only with allow_write = true

  • Bound Parameters: $1, $2, โ€ฆ (PostgreSQL) or ? (MySQL, MariaDB) are bound, never inserted into the SQL text, and strings are converted to the column's type

  • Limits: Rows per result (1,000), time per statement (30 s), and connections (5) by default

  • Audit Logging: Each call is recorded with its SQL; parameter values are not

Connect with a read-only database role. See the Database Integration Guide.

๐Ÿš€ Quick Start

You need a WordPress site with Application Passwords (Users > Profile > Application Passwords) that mcp-rs can reach over HTTPS. Rust is not needed: each release from v0.25.0 has ready-built mcp-rs for Windows (x64), macOS (Apple Silicon), and Linux (x64).

1. Install with a package manager (from v0.29.0). It installs the release's ready-built mcp-rs, and updates it with your other packages (scoop update, brew upgrade):

# Windows (Scoop)
scoop bucket add n-takatsu https://github.com/n-takatsu/scoop-bucket
scoop install n-takatsu/mcp-rs
# macOS (Apple Silicon) and Linux (x64) (Homebrew)
brew install n-takatsu/tap/mcp-rs

Or with the install script (from v0.26.0). It downloads the latest release, checks its SHA256, and puts mcp-rs in ~/.mcp-rs/bin (%USERPROFILE%\.mcp-rs\bin on Windows), without administrator rights or changing anything else. Run it again to update:

# Windows (PowerShell)
irm https://raw.githubusercontent.com/n-takatsu/mcp-rs/main/install/install.ps1 | iex
# macOS (Apple Silicon) and Linux (x64)
curl -fsSL https://raw.githubusercontent.com/n-takatsu/mcp-rs/main/install/install.sh | sh

2. Set up. Run mcp-rs init (the install script offers to run it). It asks for the site URL, the username and the Application Password (kept in the OS credential store, not in a file), writes the config file (~/.config/mcp-rs/config.toml), checks the connection and sign-in, and registers mcp-rs with Claude Desktop, Claude Code and GitHub Copilot (VS Code), asking before each change:

mcp-rs init
# Installed with the script: ~/.mcp-rs/bin/mcp-rs init
# (Windows: & "$env:USERPROFILE\.mcp-rs\bin\mcp-rs.exe" init)

3. Check. Restart the client as init shows, then ask it to call the mcp_rs_status tool. It shows the version, the config file in use, where the logs are written, anything that failed to start, and whether a newer version is out. mcp-rs check --config <path> checks a config file without a client.

To remove what init set up (the client registrations, the credential store entries, and optionally the config file), run mcp-rs uninstall. It asks before each change, and shows how to remove mcp-rs itself for the way you installed it.

The Getting Started guide covers the rest: reading the install script before running it, installing by hand or from source, setting up each client by hand, the config file, where the logs are, and what to check when a client cannot find the tools.

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Agent/Client   โ”‚โ”€โ”€โ”€โ–ถโ”‚    MCP Server       โ”‚โ”€โ”€โ”€โ–ถโ”‚   WordPress Site    โ”‚
โ”‚  (Claude Desktop,   โ”‚    โ”‚   (mcp-rs)          โ”‚    โ”‚   (REST API)        โ”‚
โ”‚   Custom AI, etc)   โ”‚    โ”‚                     โ”‚    โ”‚                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                      โ”‚
                                      โ–ผ
                           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                           โ”‚   Security Layer    โ”‚
                           โ”‚ โ€ข Authentication    โ”‚
                           โ”‚ โ€ข Tool Limits       โ”‚
                           โ”‚ โ€ข Rate Limiting     โ”‚
                           โ”‚ โ€ข Audit Log         โ”‚
                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“š Documentation

The documentation site is at n-takatsu.github.io/mcp-rs:

๐Ÿ› ๏ธ Development

Building from Source


## Development build

cargo build

## Production build with optimizations

cargo build --release

## Run tests

cargo test

## Run with specific configuration

cargo run -- --config configs/development/http-transport.toml

Code Examples

Examples are in the examples/ directory. For example, cargo run --example wordpress_api_test checks the connection to the WordPress site given by WORDPRESS_URL. When WORDPRESS_USERNAME and WORDPRESS_PASSWORD are also set, it checks the login and creates a draft post.

Testing


## Run all tests

cargo test

## Run with output

cargo test -- --nocapture  # Show test output (no-capture flag) # cSpell:ignore nocapture

## Run specific test module

cargo test wordpress_api

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add some amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

๐Ÿ“„ License

This project is dual-licensed under:

You may choose either license at your option.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


Built with โค๏ธ in Rust ๐Ÿฆ€

Available Tools

33 tools
create_advanced_postC

Create a new WordPress post or page with advanced options

Inputs: title (required), content (required), date, meta, +6 more.

create_categoryC

Create a new WordPress category

Inputs: name (required), slug, parent, description.

create_postA

Create a new WordPress post (basic). Defaults to draft status so nothing is published unintentionally.

Inputs: title (required), content (required), slug, status.

create_post_with_categories_tagsA

Create a new WordPress post with categories and tags. Defaults to draft status so nothing is published unintentionally.

Inputs: title (required), content (required), slug, tags, +3 more.

create_post_with_embedsB

Create WordPress post with embedded YouTube videos and social media content

Inputs: title (required), content (required), slug, tags, +5 more.

create_post_with_featured_imageB

Create a new WordPress post with featured image

Inputs: title (required), content (required), featured_media_id (required), slug, +1 more.

create_tagB

Create a new WordPress tag

Inputs: name (required), slug, description.

delete_categoryC
DestructiveIdempotent

Delete a WordPress category

Inputs: category_id (required), force.

delete_mediaA
DestructiveIdempotent

Delete WordPress media file. WordPress does not support moving media to the trash by default, so force: true is usually required

Inputs: media_id (required), force.

delete_postC
DestructiveIdempotent

Delete a WordPress post or page

Inputs: post_id (required), force, post_type.

delete_tagC
DestructiveIdempotent

Delete a WordPress tag

Inputs: tag_id (required), force.

get_all_contentB
Read-only

Retrieve both WordPress posts and pages

Inputs: no named parameters.

get_categoriesB
Read-only

Retrieve WordPress categories

Inputs: no named parameters.

get_commentsC
Read-only

Retrieve WordPress comments

Inputs: post_id.

get_mediaC
Read-only

Retrieve WordPress media files

Inputs: no named parameters.

get_media_itemA
Read-only

Retrieve a single WordPress media item by ID

Inputs: media_id (required).

get_pagesA
Read-only

Retrieve WordPress pages. Without search, filters or page options, it returns all pages; with them, one page and the total

Inputs: page, after, order, author, +5 more.

get_postA
Read-only

Retrieve a single WordPress post or page by ID, including its full content. By default the content is the editable source (with Gutenberg block markup), which can be passed back to update_post unchanged.

Inputs: post_id (required), format, post_type.

get_postsA
Read-only

Retrieve WordPress posts (published ones by default). Without search, filters or page options, it returns all posts; with them, one page and the total

Inputs: page, tags, after, order, +7 more.

get_settingsC
Read-only

Get WordPress site settings

Inputs: no named parameters.

get_tagsB
Read-only

Retrieve WordPress tags

Inputs: no named parameters.

mcp_rs_statusmcp-rs statusA
Read-only

Show the status of the mcp-rs server itself: version, mode, protocol version, config file, where the log and audit log are written, and the state of each handler and plugin. Use it to check the installed version or to find the log files.

Inputs: no named parameters.

set_front_pageB
DestructiveIdempotent

Set a static page as the front page

Inputs: page_id (required).

set_front_page_to_postsC
DestructiveIdempotent

Set front page to show latest posts

Inputs: posts_page_id.

update_categoryC
DestructiveIdempotent

Update an existing WordPress category

Inputs: category_id (required), name, slug, parent, +1 more.

update_mediaC
DestructiveIdempotent

Update WordPress media metadata (title, alt text, caption, description)

Inputs: media_id (required), post, title, caption, +2 more.

update_postC
DestructiveIdempotent

Update an existing WordPress post or page

Inputs: post_id (required), date, slug, tags, +6 more.

update_post_categories_tagsC
DestructiveIdempotent

Update categories and tags for an existing WordPress post or page

Inputs: post_id (required), tags, post_type, categories.

update_settingsC
DestructiveIdempotent

Update WordPress site settings

Inputs: title, language, timezone, description, +5 more.

update_tagC
DestructiveIdempotent

Update an existing WordPress tag

Inputs: tag_id (required), name, slug, description.

upload_mediaA

Upload media file to WordPress. Pass either file_data (base64) or file_path. The filename extension and file content must match mime_type. Size is capped at 10 MiB; with file_data, the transport's message size limit (including base64 overhead) usually applies first

Inputs: filename, file_data, file_path, mime_type.

wordpress_health_checkB
Read-only

Perform comprehensive WordPress environment health check

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    C2.9/5.0

    Scored across 33 tools

    Disambiguation2/5

    Several tools have heavily overlapping purposes: create_post, create_post_with_featured_image, create_post_with_categories_tags, create_advanced_post, and create_post_with_embeds all create posts, differing only by optional features. Retrieval tools also blur together: get_posts, get_all_content, get_post, and get_pages overlap, while get_media and get_media_item are easily confused. An agent would struggle to choose the correct tool without trial and error.

    Naming Consistency4/5

    Most names follow a predictable snake_case verb_noun pattern such as get_posts, create_category, update_tag, and delete_media. A few deviate with compound or noun-first forms like wordpress_health_check, mcp_rs_status, and create_post_with_featured_image, but the overall convention remains readable and mostly consistent.

    Tool Count2/5

    With 33 tools, the surface is heavy for a WordPress content-management server. The count is inflated by redundant post-creation variants and overlapping retrieval tools, so many tools do not clearly earn their place.

    Completeness3/5

    Core content operations are well covered: posts and pages can be retrieved, created, updated, and deleted; media and taxonomies have CRUD; settings and front-page configuration are present. However, comments are read-only, and there is no user, plugin, theme, or menu management, leaving notable gaps for broader WordPress administration.

    Maintenance

    ActivityActive
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers