Skip to content

Add MCP tools to create a shared library entry and rename a git token - #8856

Merged
andypalmi merged 8 commits into
mainfrom
feat/mcp-team-data-write-tools
Oct 12, 2026
Merged

andypalmi merged 8 commits into
mainfrom
feat/mcp-team-data-write-tools

Conversation

@andypalmi

@andypalmi andypalmi commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7709

Adds platform_create_library_entry, which saves an entry in a team's shared library, and platform_update_git_token, which renames a team git token. The third tool of the issue, platform_create_database_table, was #8633.

platform_update_git_token returns only { id, name, type }. The route's view never includes the stored token, and the route only reads name from the body, so the tool needs no redaction and cannot change the credential.

The library tool takes teamId (the shared library id is the team hashid) and lives in a new library.js. The git tool sits in teams.js next to platform_list_team_git_tokens.

Things I checked against the real routes:

  1. A repeated library POST with the same path and type overwrites body and meta and still returns 201, so the tool is idempotentHint: true and the description says it overwrites. The same path with a different type creates a second entry.
  2. The route returns 201 with an empty body, so the tool replies { entry: { path, type } }.
  3. body may be a string or an object, which the route stringifies. The route rejects a flows body that is not valid JSON with 400.
  4. The route rejects empty, . and .. segments. The tool still checks them itself, because the URL resolves . and .. segments, even encoded ones, before the route sees the name, so a/../b would be saved as b. It also encodes each segment.
  5. The route's 404 says when the shared library is not enabled for the team, and the tool passes it through. Viewers get 403.
  6. The git PUT's 404 says when git integration is not enabled for the team, and the tool passes it through.
  7. The tool requires a name of 1 to 255 characters after trimming. Renaming to the current name succeeds without changes, so it is idempotent.
  8. Id arguments go through the shared path guard from Reject path-breaking ids in MCP tool inputs #8843, so a crafted id cannot reach another route.

Issues found while testing, now fixed:

  1. Shared library routes return 404 to personal access tokens and MCP tokens #8847: the shared library routes returned 404 to every personal access token and OAuth token. Fixed in Let user tokens use the team shared library #8858.
  2. Shared library create accepts empty and trailing-slash entry names, and a non-JSON flows body that breaks reading it back #8853: the library create route accepted bad names and a non-JSON flows body. Fixed in Validate shared library entries on create #8884.
  3. Git token PUT returns 500 with a raw error for an invalid token id or a missing request body #8854: the git token PUT returned 500 for an invalid token id or a missing body. Fixed in Validate git token updates and return 404 for unknown ids #8885.
  4. Shared library and git token routes do not say the feature is disabled in their 404 #8855: the library and git token routes did not say the feature is disabled in their 404. Fixed in Name the disabled feature in git and shared library 404s #8886.
  5. Git token and shared library changes are not audit logged #8851: creates and renames were not audit logged. Fixed in Audit log git token and shared library changes #8882.

@andypalmi
andypalmi requested a review from cstns October 8, 2026 12:54
@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.03%. Comparing base (10a3702) to head (622dd8c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8856      +/-   ##
==========================================
+ Coverage   79.01%   79.03%   +0.01%     
==========================================
  Files         475      476       +1     
  Lines       25820    25838      +18     
  Branches     6867     6870       +3     
==========================================
+ Hits        20402    20420      +18     
  Misses       5418     5418              
Flag Coverage Δ
backend 79.03% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andypalmi
andypalmi enabled auto-merge (squash) October 12, 2026 13:48
@andypalmi
andypalmi merged commit 364d817 into main Oct 12, 2026
29 checks passed
@andypalmi
andypalmi deleted the feat/mcp-team-data-write-tools branch October 12, 2026 14:53

This branch was successfully deployed

1 active deployment
staging — 622dd8cd Deployed Oct 12, 2026 by andypalmi via Remove application #12409
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.

5.12-b Write tools, non-destructive (phase 2)

2 participants