Skip to content

feat: add Harness File Store support#197

Open
sahilharness wants to merge 2 commits into
harness:mainfrom
anishharness:file-store-mcp-support
Open

feat: add Harness File Store support#197
sahilharness wants to merge 2 commits into
harness:mainfrom
anishharness:file-store-mcp-support

Conversation

@sahilharness
Copy link
Copy Markdown

Add File Store resources for metadata, uploads, and content reads through the existing registry-backed MCP tools.

Description

add file store support.
you can now

  • list out all files/folders in a scope
  • read content from a file
  • create a file
  • update content from a file
  • delete a file

Add File Store resources for metadata, uploads, and content reads through the existing registry-backed MCP tools.

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 14, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ thisrohangupta
❌ sahilharness
You have signed the CLA already but the status is still pending? Let us recheck it.

- Extract shared isFormDataBody into src/utils/type-guards.ts, removing
  duplicate definitions from harness-client.ts and registry/index.ts
- Refactor registry body-validation ternary to if/else for readability
- Fix create/update risk levels to match convention (low_write)
- Add missing delete operation (DELETE /ng/api/file-store/{identifier})
- Fix hydrateFileStoreUpdate leaking body/content fields into the GET
  request by filtering input to just identifier and scope fields
- Add diagnosticHint and relatedResources for agent discoverability
- Add delete and preflight-leak regression tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

AI-Session-Id: 5fee2ab6-dab8-4e3f-b487-d2c5eb3ff91c
AI-Tool: claude-code
AI-Model: unknown
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

  1. Mediumsrc/registry/toolsets/file-store.ts, src/tools/harness-create.ts, src/tools/harness-update.ts, src/tools/harness-delete.ts, src/tools/harness-describe.ts: file_store_item now advertises supportedScopes: ["account", "org", "project"] on a write-capable resource, but the public write tools still do not expose resource_scope and do not opt into URL-derived scope. That means harness_describe tells agents to set resource_scope, yet harness_create / harness_update / harness_delete can only hit account/org File Store writes through undocumented params.resource_scope; with configured defaults they otherwise fall back to project scope. This is a structured discoverability/runtime contract mismatch.
  2. Lowsrc/utils/url-parser.ts, src/registry/toolsets/file-store.ts, tests/utils/url-parser.test.ts: the PR adds File Store URL parsing, but the resource definition still has no deepLinkTemplate, so File Store responses cannot emit openInHarness links even though pasted URLs now parse. There is also no matching url-parser regression coverage for the new file-store segment / URL-default merge path, so this new discoverability surface is one-way and unverified.
  3. Lowsrc/registry/index.ts, README.md: the branch is currently red on pnpm docs:check because adding the new toolset changed the generated resource/toolset counts without regenerating README.md. CI’s pnpm test and pnpm typecheck steps passed on the PR head; docs sync is the remaining failure.

Overall, the File Store endpoint wiring itself is mostly aligned with the repo standards: declarative toolset registration, clean GET vs multipart-body separation, no body leakage in the update preflight, appropriate risk policies, and guarded output shaping for file downloads. The gaps are in shared-tool discoverability / round-trip UX rather than the endpoint mappings themselves.

Open in Web View Automation 

Sent by Cursor Automation: Sunil On Demand Architecture Review

description: "Harness File Store file or folder metadata. Supports listing, metadata lookup, create, and update.",
toolset: "file-store",
scope: "project",
supportedScopes: ["account", "org", "project"],
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.

file_store_item is now a write-capable resource that advertises account/org/project scope, but the public write tools still do not publish a top-level resource_scope input and they intentionally ignore URL-derived scope on create/update/delete. That means harness_describe(resource_type='file_store_item') now tells agents they can set resource_scope, while harness_create / harness_update / harness_delete can only reach those paths through undocumented params.resource_scope and otherwise fall back to configured project scope. I think this should either be made schema-visible on the write tools or kept out of the advertised multi-scope contract.

Comment thread src/utils/url-parser.ts
"experiments": { type: "chaos_experiment", contextField: "resource_id" },
"registries": { type: "registry", contextField: "registry_id" },
"artifacts": { type: "artifact", contextField: "artifact_id" },
"file-store": { type: "file_store_item", contextField: "file_id" },
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.

This adds File Store URL parsing, but I don't see the corresponding round-trip discoverability follow-through: file_store_item still has no deepLinkTemplate, so responses won't include openInHarness, and there are no matching tests/utils/url-parser.test.ts cases for the new file-store segment / applyUrlDefaults() path. Since URL parsing is a cross-cutting agent-discovery surface, I'd expect the parser, deep links, and regression coverage to land together.

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.

4 participants