Description
Connect a coding agent to commercetools Projects through managed Commerce MCP Servers with Merchant Center sign-in, configured per repository, for building and configuring a solution. Points to the documentation for the Knowledge MCP and for other Commerce MCP uses. Use when connecting a coding agent to a commercetools Project, adding another Project to a repository, or continuing that setup after sign-in.
Installation
In any Claude Code session, run the following commands one at a time:
-
Add the commercetools AI marketplace:
/plugin marketplace add commercetools/commercetools-ai-plugins -
Install the commercetools AI plugin (Skills + Subagents + MCP):
/plugin install commercetools@commercetools
If you've updated the plugin or installed it in another window and need the current session to pick up the latest version:
/reload-plugins
commercetools/commercetools-ai-plugins. Then, click on the plugin and click Install.Instructions Included
commercetools MCP
| Server | Gives an agent | Access |
|---|---|---|
| Knowledge MCP | Documentation search, GraphQL and OpenAPI schemas, query validation | Public, no sign-in. Bundled with this plugin. |
| Commerce MCP | Tools that read and change Project data | Needs access to a Project. Managed (hosted by commercetools, configured in the Merchant Center) or self-hosted (you run the open-source package). |
Connect your development environment
Other uses
Answer other Commerce MCP and Knowledge MCP questions from the documentation:
- Managed MCP Servers for other agents and applications: overview, in the Merchant Center, connecting a client
- Self-hosted Commerce MCP
- Knowledge MCP: recommended workflows
Checklist
- Development-environment connections follow the repository connection
- Other Commerce MCP and Knowledge MCP questions answered from the linked documentation
References
Repository connection
Your coding agent reads and configures a Project while you build. Each developer signs in as themselves, so no secret sits in the repository.
Connect one Project first. Offer more once that one works.
Rules
- Create the server in the Merchant Center UI. Creating it through the API needs API client credentials, which is what this setup avoids.
- Write the connection with the script (step 3), not by hand. It checks the URL against the
project, merges into
.mcp.jsonwithout touching other servers, and prints the next step. Don't use an agent's ownmcp addcommand either. - Relay the printed next step; don't run it. Sign-in needs the user's browser, and the tools
only load when this conversation is reopened in a new process, which you can't do. Reopening keeps
the conversation, so the setup continues where it stopped. Don't offer
!-prefixed in-session commands instead. - Tools follow the environment. Development gets All: letting the agent set up and configure the project is the point, and read-only would defeat it. Production gets All read, always. Other environments are the user's call.
- Production is not detectable. The Project resource has no environment flag, on REST or
GraphQL. Never infer it from configuration: implementations mirror settings across environments,
and misconfigured production projects are common. Ask for further projects (step 2), and treat
prod,productionorlivein the project key or name as production. The absence of a marker means nothing. - Don't research or search. Look for configuration only in the repository and the paths your agent's section names, never across the filesystem. Don't invent scoping (no launcher scripts, wrappers, aliases, or config directories inside the workspace), and never add test entries to the user's configuration to learn a format.
Steps
-
Check what exists. A
mcp.{region}.commercetools.comURL in the agent's MCP configuration is a connection. After sign-in, the reopened conversation continues here.-
Its tools are available: call
read_project. It proves the connection end to end and returns the Project's display name:Connected to{projectKey}:{project display name}.Connect another project?
Suggest setting that name on the MCP Server in the Merchant Center. For another project, continue with step 2.
-
Its tools aren't available: sign-in or approval is missing. Run the step 3 script again with the same URL. It changes nothing and prints the next step.
-
No connection: continue with step 2.
-
-
Create the server. Ask for the Project:
Paste the Merchant Center URL of the project you want to connect. Normally your development project.
https://mc.{region}.commercetools.com/{projectKey}/welcomeDon't have it? Log in at https://identity.commercetools.com/ and copy the URL from your browser.An API host plus project key works too. Extract region and project key, and check the region against the hosts list. If it isn't there, ask again rather than guessing.For every project after the first, also ask:
Which environment is{projectKey}: development, staging, production, or something else?Then send the user to the form:
Create the MCP server:https://mc.{region}.commercetools.com/{projectKey}/settings/mcp-servers/new- Authorization method: OAuth / Identity
- Server key:
coding-agent - Tools: Group select → All for a development project, All read for production
- After saving, make sure the server is enabled with the toggle on its detail page
Then paste the MCP server URL here.For production, or a key or name with a production marker, say it plainly:
{projectKey}is production. Use All read, so nothing can be changed there through the agent.Leave Name and Description empty. Step 1 fills in the name from a verified value. Field details: Create an MCP Server.Group selections pick up new tools automatically. That suits development, and All read stays read-only as they arrive. Tool selection guards against accidents. The security boundary is the signer's Merchant Center permissions; see tool filtering. -
Write the connection. For Claude Code, VS Code with Copilot and GitHub Copilot CLI, run this from this skill's root, with the repository root as
--dir:node scripts/connect-repository-mcp.mjs --url "<MCP server URL>" --project "<projectKey>" --dir "<repository root>" --agent "<claude-code|vscode|copilot-cli>" --model "<current-model>"It names the connectionct-{projectKey}, which prefixes every tool call and approval prompt so the target Project stays visible. Relay its "Tell the user" block verbatim, then stop.An error is a hard stop: report it, and don't edit the file by hand. If the run itself is blocked, give the user the same command with the script's absolute path. Don't report the connection as working beforeread_projectsucceeds.For other agents, see their section.
Per agent
.mcp.json, written
by the script. The file uses the portable format all three read, so one committed file serves a
mixed team.Claude Code
--agent claude-code, also in desktop-hosted sessions: the script detects those itself.- Terminal: the printed command signs in, then reopens this conversation with
claude --continue, which asks once to approve the server. - Desktop app: sessions there can't sign in, but load the server without approval. The printed command only signs in from a terminal; the user then comes back to this conversation. Don't tell them to exit or close anything.
Visual Studio Code with Copilot
--agent vscode. There is no terminal step: in a trusted workspace, VS Code starts the server
when the next chat message is sent. MCP: List Servers in the Command Palette shows its state..vscode/mcp.json (top-level servers) instead of
.mcp.json, add the entry there by hand, as "ct-{projectKey}": { "type": "http", "url": "<url>" }.GitHub Copilot CLI
--agent copilot-cli. The printed step reopens this conversation with copilot --continue,
where the user signs in with /mcp auth ct-{projectKey}. Project-level servers load after folder
trust. copilot mcp login doesn't exist, copilot mcp add writes only to the user configuration,
and copilot mcp list and copilot -p skip project-level servers, so none of them can check the
file.OpenAI Codex
Not covered by the script: Codex has no per-project MCP configuration. Say so first:
Codex has no per-project MCP configuration. This goes in~/.codex/config.tomland will be available in your other Codex projects too. Add it?
codex mcp add ct-<projectKey> --url <url> && codex mcp login ct-<projectKey> && codex resume --last "Signed in. Continue the commercetools MCP setup: verify the new connection, then ask whether to connect another project"
codex mcp login ct-<projectKey>Cursor
url. The
user signs in from Cursor's MCP settings.Other agents
Ask the user where their agent keeps MCP configuration and how it signs in.
Checklist
- Existing connections checked first; an available one verified with
read_project - One Project connected before offering more
- OAuth / Identity, not API client credentials
- All for development, All read for production, stated for every project
- Environment asked for every project after the first; a production marker treated as production
- Nothing inferred from Project configuration
- Connection written with
scripts/connect-repository-mcp.mjs, not by hand; an error treated as a hard stop - The printed next step relayed verbatim, not run; success claimed only after
read_project