-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: add localization support to MCP resource operations #14334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add locale and fallbackLocale parameters to all resource tools (create, update, find, delete) - Add comprehensive integration tests for localization features - Update documentation with localization usage examples and MCP client configuration - Follow Payload REST API localization pattern for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive localization support to the MCP plugin, enabling multilingual content management through MCP that matches Payload's REST API capabilities.
Key Changes:
- Added
localeandfallbackLocaleparameters to all resource operations (create, update, find, delete) - Implemented 6 new integration tests covering localization scenarios (all passing)
- Updated documentation with localization usage examples and MCP client setup guide
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/plugin-mcp/int.spec.ts | Added 6 comprehensive localization tests and updated getApiKey helper to support update/delete permissions |
| test/plugin-mcp/config.ts | Configured localization with en/es/fr locales and enabled update/delete operations for Posts collection |
| test/plugin-mcp/collections/Posts.ts | Marked title and content fields as localized |
| packages/plugin-mcp/src/mcp/tools/schemas.ts | Added locale and fallbackLocale parameters to find, create, update, and delete tool schemas |
| packages/plugin-mcp/src/mcp/tools/resource/update.ts | Implemented locale parameter handling in update operation and added to schema |
| packages/plugin-mcp/src/mcp/tools/resource/find.ts | Implemented locale parameter handling in find operation |
| packages/plugin-mcp/src/mcp/tools/resource/delete.ts | Implemented locale parameter handling in delete operation |
| packages/plugin-mcp/src/mcp/tools/resource/create.ts | Implemented locale parameter handling in create operation with schema restructuring |
| docs/plugins/mcp.mdx | Added comprehensive documentation for MCP client setup and localization features with examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This is a great start @stevenceuppens! I'll dig into more detail today. |
Updated documentation to accurately reflect that HTTP is the currently supported connection method, with REDIS and STDIO under consideration for future releases. Added a dedicated "Connection Methods" section with HTTP configuration example to provide clearer guidance for users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are test failures need to be addressed https://github.com/payloadcms/payload/actions/runs/18868951904/job/53872817402?pr=14334#step:12:13889
What?
Adds full localization support to the MCP plugin's resource operations (create, update, find, delete).
Why?
The MCP plugin did not expose Payload's localization capabilities. Users with multilingual content could not create or manage translations through MCP, limiting the plugin's usefulness for international projects. This brings MCP feature parity with Payload's REST API.
How?
localeandfallbackLocaleparameters to all resource tools (create, update, find, delete)Testing:
pnpm test:int plugin-mcp # All 15 tests passing (9 existing + 6 new localization tests)Example Usage:
Fixes #