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
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.zipMy 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
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Abilities API Plugin (Required)
🏗️ 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 dependenciesMyTodoPostType- Manages the custom post type and data operationsMyTodoAdmin- Handles WordPress admin interface and form processingMyTodoMCPHandler- Manages MCP abilities registration and execution
🔧 Installation
- Install and activate the Abilities API plugin
- Upload this plugin to
/wp-content/plugins/my-todo/ - Activate the plugin through the 'Plugins' menu in WordPress
- 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
- Go to My ToDo in the admin menu
- 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
- Go to Users → Your Profile in WordPress admin
- Scroll to Application Passwords section
- Enter a name (e.g., "MCP Tools")
- Click Add New Application Password
- 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:
- Go to My ToDo → MCP Settings
- Enter your MCP server URL
- Save settings
Todos will automatically sync after add/delete operations.
📚 Documentation
- MCP_TOOLS_GUIDE.md - Complete usage guide with examples
- CHANGELOG.md - Version history and changes
- Abilities API Docs - Core framework 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:
- Discover available tools via
/wp/v2/abilities - Understand requirements via JSON schemas
- Execute operations with validation
- Handle errors with structured responses
🔒 Security
- All endpoints require WordPress authentication
- Add/Delete operations require
manage_optionscapability - 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_optionscapability (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