feat: move MCP to /mcp and add teammate operations (#500)

* feat(operations): move MCP to /mcp and add search, comment, metadata, version, and upload operations

- Serve the MCP server at /mcp instead of /api/mcp
- Add search_assets, copy_assets, get_folder_instructions, list_comments,
  create_comment, resolve_comment, list_metadata_fields,
  update_asset_metadata, create_version_stack, list_versions, and
  remove_version on the agent, MCP, and CLI
- Add create_file and create_version (agent, MCP) with Creation Context
  metadata, and complete_upload (MCP) for presigned two-step uploads
- Replace the native agent create_file/create_version tools with
  Operation-backed ones
- Route the comment-complete, metadata, copy, version stack, and
  AGENTS.md read REST endpoints through their Operations

* docs(readme): add built-in MCP server and CLI to features list
This commit is contained in:
Yiling-J
2026-10-27 14:37:26 +08:00
committed by GitHub
parent 50fbd97953
commit b3cae4f2b0
81 changed files with 4111 additions and 1397 deletions
@@ -0,0 +1,40 @@
import { z } from 'zod'
import { defineOperation } from '../define'
export const createComment = defineOperation({
name: 'create_comment',
title: 'Create Comment',
description:
'Post a review comment on a file, or reply to an existing comment thread. The comment is ' +
'posted as you, and the people involved are notified. For a video or audio file, set ' +
'"second" to pin the comment to a timecode. For a version stack, the comment goes on its ' +
'latest version.',
input: z.object({
assetId: z.string().min(1).describe('The file or version stack to comment on.'),
message: z.string().trim().min(1).max(10_000).describe('The comment text.'),
replyToId: z
.string()
.min(1)
.optional()
.describe('ID of the comment to reply to (from list_comments). Omit for a new thread.'),
second: z
.number()
.min(0)
.optional()
.describe('Timecode in seconds on a video or audio file. Omit for other files.'),
}),
output: z.object({
id: z.string().describe('The new comment ID.'),
assetId: z.string().describe('The file the comment is on (the latest version for a stack).'),
replyToId: z.string().nullable().describe('The thread it replies to, if any.'),
}),
surfaces: ['agent', 'mcp', 'cli'],
annotations: { readOnly: false, destructive: false },
cli: {
command: ['comment', 'add'],
description: 'Comment on a file, or reply to a comment with --reply-to.',
positional: ['assetId', 'message'],
flags: { replyToId: ['--reply-to'], second: ['-t', '--at'] },
format: (output) => `Posted comment ${output.id}`,
},
})