feat(mcp): serve Operations over MCP and a generic /api/ops endpoint (#495)

Add a stateless Streamable HTTP MCP server at /api/mcp that exposes every
mcp-surface Operation with its input/output schemas and annotations, and
POST /api/ops/:name for the CLI. Both require an API token (session
cookies are rejected), run Operations as the token's user, honor demo
read-only mode, and record via mcp/cli/api in audit logs.

Also make list_projects toggleable in agent settings and document MCP
client setup.
This commit is contained in:
Yiling-J
2026-10-27 08:09:09 +08:00
committed by GitHub
parent 76057ccd21
commit 4d61786799
20 changed files with 866 additions and 18 deletions
@@ -82,6 +82,11 @@ const BUILTIN_TOOLS = [
name: () => m.agent_tool_read_asset_name(),
description: () => m.agent_tool_read_asset_desc(),
},
{
id: 'list_projects',
name: () => m.agent_tool_list_projects_name(),
description: () => m.agent_tool_list_projects_desc(),
},
{
id: 'list_assets',
name: () => m.agent_tool_list_assets_name(),
+2
View File
@@ -609,6 +609,8 @@
"agent_tool_read_skill_desc": "Allows the agent to load and read skill definitions to perform specialized actions.",
"agent_tool_read_asset_name": "Read Asset",
"agent_tool_read_asset_desc": "Allows the agent to view and inspect images, video frames, and document pages.",
"agent_tool_list_projects_name": "List Projects",
"agent_tool_list_projects_desc": "Allows the agent to list the projects you have access to and find their root folders.",
"agent_tool_list_assets_name": "Browse Shumai",
"agent_tool_list_assets_desc": "Allows the agent to list folders and browse files in Shumai.",
"agent_tool_create_folder_name": "Create Folder",
+2
View File
@@ -609,6 +609,8 @@
"agent_tool_read_skill_desc": "允许智能体加载和读取技能定义以执行特定操作。",
"agent_tool_read_asset_name": "读取资源",
"agent_tool_read_asset_desc": "允许智能体查看和分析图片、视频画面和文档页面。",
"agent_tool_list_projects_name": "列出项目",
"agent_tool_list_projects_desc": "允许智能体列出您有权访问的项目并找到其根文件夹。",
"agent_tool_list_assets_name": "浏览 Shumai",
"agent_tool_list_assets_desc": "允许智能体列出文件夹并浏览 Shumai 中的文件。",
"agent_tool_create_folder_name": "创建文件夹",