Skip to content

fix: keep the last 12 characters of the space ID in the MCP server name - #979

Merged
cchu-ld merged 4 commits into
mainfrom
cchu/mcp-server-name-length
Oct 27, 2026
Merged

cchu-ld merged 4 commits into
mainfrom
cchu/mcp-server-name-length

Conversation

@cchu-ld

@cchu-ld cchu-ld commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Follow-up to #968, which gave each agent space its own MCP server. That change is unreleased.

Describe the solution you've provided

Setup on a new agent space failed with:

The combination of MCP Server name and tool (LaunchDarkly-5e6cc58b-7570-467c-aedb-97503e355157_get-environment) exceeds the maximum allowed length of 64 characters.

AWS limits the server name, _ and each tool name to 64 characters combined. MCPServerNameFor used the full space UUID, which made the name 49 characters, so 18 of the 31 allowlisted tools didn't fit.

  • MCPServerNameFor now keeps the last 12 characters of the space ID, the last group of a UUID, for example LaunchDarkly-97503e355157 (25 characters). The longest tool, get-experiment-metric-results, now makes a 55-character name.
  • TestMCPServerNameForLeavesRoomForEveryTool checks every allowlisted tool against the 64-character limit. It fails for 18 tools without this change.

Additional context

go test ./internal/awsdevops/... passes.

Known gap, for a follow-up PR: a run that failed with this bug already registered a server named LaunchDarkly-<full space ID>, because AWS checks the length when it associates the server, not when it registers it. After this change, setup no longer finds that server by name, so a rerun registers a new one and leaves the old one in place. The follow-up tags each server with its agent space and removes these leftovers. Until then, deregister the leftover in the AWS console.

via LD Research 🤖

🤖 Generated with Claude Code


Note

Overview
Fixes AWS DevOps setup failures where registering MCP tools exceeded the 64-character limit on serverName_toolName.

MCPServerNameFor now uses only the last 12 characters of the agent space ID (the final UUID segment) instead of the full UUID, producing names like LaunchDarkly-97503e355157 so every allowlisted tool fits under the cap.

Test support adds MCPTools() (exported for tests) and new cases that assert the suffix behavior and that name + "_" + tool stays ≤ 64 for all MCP tools.

Reviewed by Cursor Bugbot for commit 987f848. Bugbot is set up for automated code reviews on this repo. Configure here.

AWS caps an MCP server name, "_" and a tool name at 64 characters. The
name from #968 holds the full space UUID (49 characters), so registration
failed for 18 of the 31 allowlisted tools. Keep the first 13 characters of
the space ID, and test that every allowlisted tool fits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cchu-ld
cchu-ld marked this pull request as ready for review October 27, 2026 19:13
@cchu-ld
cchu-ld requested a review from a team as a code owner October 27, 2026 19:13
@cchu-ld
cchu-ld requested review from btesfamariam and removed request for a team October 27, 2026 19:14
The last group of a UUID space ID has no dash, so the name reads as
LaunchDarkly-97503e355157.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cchu-ld cchu-ld changed the title fix: shorten the MCP server name so every tool fits in 64 characters fix: keep the last 12 characters of the space ID in the MCP server name Oct 27, 2026
@cchu-ld
cchu-ld requested a review from a team October 27, 2026 19:30
@cchu-ld
cchu-ld enabled auto-merge (squash) October 27, 2026 19:34
Comment thread internal/awsdevops/lookup.go Outdated
}

// mcpServerIDLength is how much of the space ID the server name keeps. AWS
// caps the name, "_" and a tool name at 64 characters, so a full UUID leaves

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'm confused by the 64 vs 12 comment and value

@cchu-ld cchu-ld Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So 64 is the character limit of a tool name, which is something like <mcp-server-id>_create-flag

The server-id value is LaunchDarkly-<agent-space-id>, where agent-space-id is something like dc00f70b-461c-496c-a320-b3ad0071798d. This PR truncates the <agent-space-id> to the last 12 characters so we get some more space to use in the 64 char limit.

I updated the comment to be a bit clearer hopefully.

cchu-ld and others added 2 commits October 27, 2026 12:42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cchu-ld
cchu-ld merged commit 2586bad into main Oct 27, 2026
10 checks passed
@cchu-ld
cchu-ld deleted the cchu/mcp-server-name-length branch October 27, 2026 19:54
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