Skip to content

fix: mark SPACE_ID as optional and document multi-space usage#341

Open
Gonzalo Fleming (gonzafg2) wants to merge 4 commits into
contentful:mainfrom
gonzafg2:fix/space-id-optional-multi-space
Open

fix: mark SPACE_ID as optional and document multi-space usage#341
Gonzalo Fleming (gonzafg2) wants to merge 4 commits into
contentful:mainfrom
gonzafg2:fix/space-id-optional-multi-space

Conversation

@gonzafg2
Copy link
Copy Markdown

Summary

  • Mark SPACE_ID as optional in the environment variables table and manifest.json, aligning documentation with the actual behavior in env.ts where it is already defined as z.string().optional()
  • Add "Working with Multiple Spaces" section to both READMEs with a configuration example for users managing multiple spaces from a single MCP server instance
  • Fix manifest.json: change SPACE_ID from required: true to required: false, so Claude Desktop (.dxt) users are not blocked from multi-space setups

Context

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 spaceId as a parameter (via BaseToolSchema), and createToolClient resolves space as params.spaceId ?? config.spaceId, multi-space usage already works — it's just not documented and the manifest incorrectly enforces a required SPACE_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

  • Verify npm run build succeeds (no code changes, only docs + manifest)
  • Verify npm run lint passes
  • Confirm the .dxt configuration flow in Claude Desktop no longer requires SPACE_ID
  • Manually test multi-space usage: configure without SPACE_ID, use list_spaces, then operate on different spaces

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
Copilot AI review requested due to automatic review settings March 17, 2026 00:19
@gonzafg2 Gonzalo Fleming (gonzafg2) requested a review from a team as a code owner March 17, 2026 00:19
Copy link
Copy Markdown

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

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_ID as optional in packages/mcp-server/manifest.json for .dxt/Claude Desktop configuration.
  • Update both READMEs to show SPACE_ID as 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.

Comment thread README.md Outdated
Comment thread packages/mcp-server/README.md Outdated
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.
Copy link
Copy Markdown

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

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_ID as optional in packages/mcp-server/manifest.json so .dxt configuration doesn’t force a single-space setup.
  • Update environment variable tables in both READMEs to show SPACE_ID as 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."
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.

2 participants