fix: mark SPACE_ID as optional and document multi-space usage#341
fix: mark SPACE_ID as optional and document multi-space usage#341Gonzalo Fleming (gonzafg2) wants to merge 4 commits into
Conversation
SPACE_ID is already treated as optional in env.ts (z.string().optional()), but the README listed it as required and manifest.json enforced it. This caused users with multiple spaces to run redundant server instances. Changes: - Update env vars table: SPACE_ID marked as optional with clarified description - Add "Working with Multiple Spaces" section with configuration example - Fix manifest.json: SPACE_ID required changed from true to false Refs contentful#314
There was a problem hiding this comment.
Pull request overview
Updates the MCP server’s packaging metadata and documentation to support multi-space Contentful usage by making SPACE_ID optional and explaining how to target spaces per tool call.
Changes:
- Mark
SPACE_IDas optional inpackages/mcp-server/manifest.jsonfor.dxt/Claude Desktop configuration. - Update both READMEs to show
SPACE_IDas optional in the environment variable table. - Add a “Working with Multiple Spaces” section to both READMEs with an example config.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/mcp-server/manifest.json | Makes SPACE_ID optional and updates its description for multi-space setups. |
| packages/mcp-server/README.md | Updates env var table + adds multi-space usage documentation. |
| README.md | Mirrors the package README changes for multi-space documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback: list_spaces, list_orgs, and get_space do not accept both spaceId and environmentId. Updated wording to distinguish space-scoped tools from organization-level tools.
There was a problem hiding this comment.
Pull request overview
Updates the MCP server’s packaging metadata and documentation to reflect that SPACE_ID is an optional default, enabling documented multi-space usage from a single server instance (especially for Claude Desktop .dxt installs).
Changes:
- Mark
SPACE_IDas optional inpackages/mcp-server/manifest.jsonso.dxtconfiguration doesn’t force a single-space setup. - Update environment variable tables in both READMEs to show
SPACE_IDas optional and described as a default. - Add a “Working with Multiple Spaces” section (with example config) to both READMEs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/mcp-server/manifest.json | Makes SPACE_ID optional in the .dxt user_config metadata and clarifies it as a default. |
| packages/mcp-server/README.md | Updates prerequisites/env-var table and adds multi-space usage documentation and example. |
| README.md | Mirrors the README updates at the repository root (env-var table + multi-space section). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review: get_space only requires spaceId (no environmentId). Changed "Space-scoped tools accept spaceId and environmentId" to "Most space-scoped tools accept spaceId and environmentId. Some tools like get_space only require spaceId."
Summary
SPACE_IDas optional in the environment variables table andmanifest.json, aligning documentation with the actual behavior inenv.tswhere it is already defined asz.string().optional()manifest.json: changeSPACE_IDfromrequired: truetorequired: false, so Claude Desktop (.dxt) users are not blocked from multi-space setupsContext
Users with access to multiple Contentful spaces currently have no documentation indicating they can use a single MCP server instance across all their spaces. Since every tool already accepts
spaceIdas a parameter (viaBaseToolSchema), andcreateToolClientresolves space asparams.spaceId ?? config.spaceId, multi-space usage already works — it's just not documented and the manifest incorrectly enforces a requiredSPACE_ID.This was confirmed in #314 (multi-environment support), where a maintainer clarified that the configured values are just defaults and can be overridden per tool call. However, the documentation was never updated to reflect this.
Test plan
npm run buildsucceeds (no code changes, only docs + manifest)npm run lintpasses.dxtconfiguration flow in Claude Desktop no longer requiresSPACE_IDSPACE_ID, uselist_spaces, then operate on different spaces