Add Multi-Site Support for Managing Multiple WordPress Sites#7
Open
jack-arturo wants to merge 2 commits intoInstaWP:mainfrom
Open
Add Multi-Site Support for Managing Multiple WordPress Sites#7jack-arturo wants to merge 2 commits intoInstaWP:mainfrom
jack-arturo wants to merge 2 commits intoInstaWP:mainfrom
Conversation
Eliminated file system-based logging in src/wordpress.ts by disabling the logToFile function and removing related imports and directory setup. It was running in every folder in Cursor and it was driving me nuts.
- Implement SiteManager for handling multiple WordPress site configurations - Add support for numbered environment variables (WORDPRESS_1_URL, WORDPRESS_2_URL, etc.) - Create 3 new site management tools: list_sites, get_site, test_site - Add optional site_id parameter to all content and taxonomy tools - Update WordPress client to use SiteManager for multi-site requests - Add site aliases for easier site detection and targeting - Maintain backward compatibility with single-site configuration - Update documentation (README, CLAUDE.md) with multi-site examples - Update example config files with multi-site setup instructions Features: - Support up to 10 WordPress sites from a single MCP server - Automatic default site selection (first site or explicitly configured) - Site-specific authentication and API client management - Lazy initialization for optimal performance - Connection testing for individual sites This enhancement transforms the MCP server from single-site to multi-site capable, allowing users to manage multiple WordPress installations from one unified interface.
Contributor
|
Will the previously supported single site continue to work? |
Contributor
Author
|
It's backward compatible and doesn't change the original setup. It adds the ability to add multiple sites without spawning multiple MCP instances (which is a memory hog). |
Contributor
|
hey @jack-arturo - I forgot about this. PR, can you please resolve the conflict and update the branch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements comprehensive multi-site support for the WordPress MCP server, enabling users to manage multiple WordPress installations from a single MCP server instance.
Key Features
🌐 Multi-Site Management
list_sites,get_site,test_site🔧 Core Implementation
src/config/site-manager.ts): Centralized site configuration and client managementsrc/tools/site-management.ts): New tools for site discovery and testingsiteIdparameter📝 Configuration Options
WORDPRESS_N_URL: Site URL (required)WORDPRESS_N_USERNAME: WordPress username (required)WORDPRESS_N_PASSWORD: Application password (required)WORDPRESS_N_ID: Custom site identifier (optional)WORDPRESS_N_DEFAULT: Mark as default site (optional)WORDPRESS_N_ALIASES: Comma-separated aliases (optional)✨ Enhanced Features
site_idparameterTesting
Tested with two live WordPress sites (wpfusion.com and verygoodplugins.com):
site_idparametersite_idspecified)Documentation Updates
Breaking Changes
None. The implementation is fully backward compatible with existing single-site configurations.
Files Changed
src/config/site-manager.ts(new): Site management implementationsrc/tools/site-management.ts(new): Site management toolssrc/wordpress.ts: Updated to use SiteManagersrc/server.ts: Removed legacy WORDPRESS_API_URL checksrc/tools/index.ts: Added site management toolssrc/tools/unified-content.ts: Addedsite_idsupport to all toolsREADME.md: Multi-site documentationCLAUDE.md: Technical documentationclaude_desktop_config.json.example: Multi-site examples