WP Manifestindependent plugin directory
manifest / developer / my-todo-sample-ability-api

My ToDo

mcp plugin endpoints test using wp mcp and ability api. server settings: https://github.com/hasanuzzamanbe/server-connect-claude

by Hasanuzzzaman · github.com/shamim0902/my-todo-sample-ability-api

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/shamim0902/my-todo-sample-ability-api/archive/refs/heads/master.zip

My ToDo Plugin

A modern, object-oriented WordPress todo list plugin that exposes its functionality as MCP (Model Context Protocol) tools via the WordPress Abilities API.

🚀 Features

  • ✅ Object-Oriented Architecture - Clean, maintainable code structure
  • ✅ Modular Design - Separated concerns across multiple classes
  • ✅ MCP Integration - Exposes tools via REST API for AI agents
  • ✅ Modern Admin Interface - Clean, responsive WordPress admin UI
  • ✅ Translation Ready - Full internationalization support
  • ✅ Security First - Proper sanitization, validation, and capability checks
  • ✅ Automatic Sync - Optional MCP server synchronization

📦 Requirements

🏗️ Architecture

The plugin follows modern WordPress development practices with a clean OOP structure:

my-todo/
├── my-todo.php                          # Main plugin file
├── includes/
│   ├── class-my-todo-plugin.php         # Main plugin class (Singleton)
│   ├── class-my-todo-post-type.php      # Post type handler
│   ├── class-my-todo-admin.php          # Admin interface
│   └── class-my-todo-mcp-handler.php    # MCP abilities handler
├── languages/
│   └── my-todo.pot                      # Translation template
└── .gitignore                           # Git ignore rules

Class Responsibilities

  • MyTodoPlugin - Main plugin orchestrator, handles initialization and dependencies
  • MyTodoPostType - Manages the custom post type and data operations
  • MyTodoAdmin - Handles WordPress admin interface and form processing
  • MyTodoMCPHandler - Manages MCP abilities registration and execution

🔧 Installation

  1. Install and activate the Abilities API plugin
  2. Upload this plugin to /wp-content/plugins/my-todo/
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Access via My ToDo menu in WordPress admin

🛠️ Available MCP Tools

1. List Todos

Name: my-todo/list
Endpoint: GET /wp/v2/abilities/my-todo/list/run
Description: Retrieves all todo items
Input: None
Output: Array of todos with id and title

2. Add Todo

Name: my-todo/add
Endpoint: POST /wp/v2/abilities/my-todo/add/run
Description: Creates a new todo item
Input: { "title": "Todo text" }
Output: { "success": true, "id": 123 }
Permission: Requires manage_options

3. Delete Todo

Name: my-todo/delete
Endpoint: POST /wp/v2/abilities/my-todo/delete/run
Description: Deletes a todo by ID
Input: { "id": 123 }
Output: { "success": true, "deleted": 123 }
Permission: Requires manage_options

📖 Usage

Via WordPress Admin

  1. Go to My ToDo in the admin menu
  2. Add, view, and delete todos using the simple interface

Via REST API

See MCP_TOOLS_GUIDE.md for complete API documentation and examples.

Quick Test

# Edit the test script with your credentials
nano test-mcp-tools.sh

# Run the test
./test-mcp-tools.sh

🔐 Authentication

All REST API endpoints require authentication:

  • Application Passwords (recommended)
  • Cookie authentication (same-origin)
  • Custom authentication plugins

Creating an Application Password

  1. Go to Users → Your Profile in WordPress admin
  2. Scroll to Application Passwords section
  3. Enter a name (e.g., "MCP Tools")
  4. Click Add New Application Password
  5. Copy the generated password

🧪 Testing

Run the included test script:

cd /path/to/my-todo/
./test-mcp-tools.sh

Or test manually with cURL:

# List all abilities
curl -u 'username:app-password' \
  https://your-site.local/wp-json/wp/v2/abilities

# List todos
curl -u 'admin:lmub 2Kuv YYku bM8y Bzn7 H1DT' \
  https://localhost:10003/wp-json/wp/v2/abilities/my-todo/list/run


# Add todo
curl -X POST \
  -u 'username:app-password' \
  -H "Content-Type: application/json" \
  -d '{"input":{"title":"New todo"}}' \
  https://your-site.local/wp-json/wp/v2/abilities/my-todo/add/run

⚙️ MCP Server Sync (Optional)

Configure automatic sync to an external MCP server:

  1. Go to My ToDo → MCP Settings
  2. Enter your MCP server URL
  3. Save settings

Todos will automatically sync after add/delete operations.

📚 Documentation

🤖 AI Agent Integration

This plugin follows the Model Context Protocol (MCP) standard, making it compatible with AI agents that support MCP.

AI agents can:

  1. Discover available tools via /wp/v2/abilities
  2. Understand requirements via JSON schemas
  3. Execute operations with validation
  4. Handle errors with structured responses

🔒 Security

  • All endpoints require WordPress authentication
  • Add/Delete operations require manage_options capability
  • Input validation via JSON Schema
  • Output validation via JSON Schema
  • Proper sanitization and escaping
  • Nonce verification for admin forms

🐛 Troubleshooting

Abilities not showing up?

  • Ensure Abilities API plugin is installed and activated
  • Check that your WordPress REST API is accessible
  • Verify you're authenticated when accessing endpoints

Permission errors?

  • Ensure your user has manage_options capability (usually Administrator role)
  • Check that your Application Password is valid

404 errors?

  • Verify permalink settings (not set to "Plain")
  • Check that REST API is not blocked by security plugins

📝 License

This plugin is licensed under the GPL v2 or later.

👨‍💻 Author

Hasanuzzzaman


Version: 3.1
Last Updated: 2025