Repository navigation
fix: keep the last 12 characters of the space ID in the MCP server name - #979
Merged
Merged
Conversation
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>
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
enabled auto-merge (squash)
October 27, 2026 19:34
| } | ||
|
|
||
| // 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 |
Contributor
There was a problem hiding this comment.
i'm confused by the 64 vs 12 comment and value
Contributor
Author
There was a problem hiding this comment.
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ari-launchdarkly
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
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:
AWS limits the server name,
_and each tool name to 64 characters combined.MCPServerNameForused the full space UUID, which made the name 49 characters, so 18 of the 31 allowlisted tools didn't fit.MCPServerNameFornow keeps the last 12 characters of the space ID, the last group of a UUID, for exampleLaunchDarkly-97503e355157(25 characters). The longest tool,get-experiment-metric-results, now makes a 55-character name.TestMCPServerNameForLeavesRoomForEveryToolchecks 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.MCPServerNameFornow uses only the last 12 characters of the agent space ID (the final UUID segment) instead of the full UUID, producing names likeLaunchDarkly-97503e355157so every allowlisted tool fits under the cap.Test support adds
MCPTools()(exported for tests) and new cases that assert the suffix behavior and thatname + "_" + toolstays ≤ 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.