Skip to content

Conversation

@stevenceuppens
Copy link

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?

  • Add locale and fallbackLocale parameters to all resource tools (create, update, find, delete)
  • Pass locale parameters through to underlying Payload operations
  • Add comprehensive integration tests for localization features (6 new tests, all passing)
  • Update documentation with localization usage examples and MCP client configuration
  • Follow Payload REST API localization pattern for consistency

Testing:

pnpm test:int plugin-mcp
# All 15 tests passing (9 existing + 6 new localization tests)

Example Usage:

// Create content in English
{ "name": "createPosts", "arguments": { "title": "Hello", "locale": "en" }}

// Add Spanish translation
{ "name": "updatePosts", "arguments": { "id": "123", "title": "Hola", "locale": "es" }}

// Retrieve all translations
{ "name": "findPosts", "arguments": { "id": "123", "locale": "all" }}

Fixes #

- 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
@stevenceuppens stevenceuppens changed the title feat(plugin-mcp): add localization support to resource operations feat(mcp): add localization support to resource operations Oct 24, 2025
@stevenceuppens stevenceuppens changed the title feat(mcp): add localization support to resource operations feat: add localization support to MCP resource operations Oct 24, 2025
@DanRibbens DanRibbens requested a review from Copilot October 27, 2025 14:52
Copy link
Contributor

Copilot AI left a 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 locale and fallbackLocale parameters 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.

@kendelljoseph
Copy link
Contributor

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>
Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants