feat(mcp): support mcp resources (#2215)

* feat(mcp): support mcp resources

* feat(web): split MCP resources into tab

* docs: add MCP resources PR review

* feat(mcp): productionize resource support

* feat(mcp): scope local agent tools and resources

* fix(web): gate space embedding models behind login

* fix(web): prevent clipped space model CTA

* test: update preproc resource tool expectations

* fix(web): expose skill authoring tools in selector

---------

Co-authored-by: yang.xiang <yang.xiang@advancegroup.com>
Co-authored-by: Hyu <chenhyu@proton.me>
Co-authored-by: Junyan Qin <rockchinq@gmail.com>
This commit is contained in:
advancer-young
2026-06-30 19:16:30 +08:00
committed by GitHub
parent 2618e06492
commit 096ec1a8ce
39 changed files with 4103 additions and 201 deletions
+61
View File
@@ -563,6 +563,11 @@ export interface MCPServerRuntimeInfo {
* server runs inside Box. Absent when Box is unavailable. */
box_session_id?: string;
box_enabled?: boolean;
resource_count: number;
resources: MCPResource[];
resource_template_count?: number;
resource_templates?: MCPResourceTemplate[];
resource_capabilities?: Record<string, unknown>;
}
export type MCPServer =
@@ -617,11 +622,67 @@ export interface MCPTool {
parameters?: object;
}
export interface MCPResource {
uri: string;
name: string;
title?: string;
description: string;
mime_type: string;
size?: number;
icons?: object[];
annotations?: Record<string, unknown>;
_meta?: Record<string, unknown>;
}
export interface MCPResourceTemplate {
uri_template: string;
name: string;
title?: string;
description: string;
mime_type: string;
icons?: object[];
annotations?: Record<string, unknown>;
_meta?: Record<string, unknown>;
}
export interface MCPResourceContent {
uri: string;
mime_type: string;
type: 'text' | 'blob';
text?: string;
blob?: string | null;
bytes?: number;
truncated?: boolean;
binary_omitted?: boolean;
_meta?: Record<string, unknown>;
}
export interface ApiRespMCPResources {
resources: MCPResource[];
resource_templates?: MCPResourceTemplate[];
resource_capabilities?: Record<string, unknown>;
}
export interface ApiRespMCPResourceContents {
contents: MCPResourceContent[];
server_name?: string;
server_uuid?: string;
uri?: string;
source?: string;
bytes?: number;
truncated?: boolean;
cache_hit?: boolean;
warnings?: string[];
}
export interface PluginTool {
name: string;
description: string;
human_desc: string;
parameters: object;
source?: 'builtin' | 'plugin' | 'mcp' | 'skill';
source_name?: string;
source_id?: string;
}
export interface ApiRespTools {
@@ -67,6 +67,8 @@ export enum DynamicFormItemType {
PLUGIN_SELECTOR = 'plugin-selector',
BOT_SELECTOR = 'bot-selector',
TOOLS_SELECTOR = 'tools-selector',
RICH_TOOLS_SELECTOR = 'rich-tools-selector',
RESOURCES_SELECTOR = 'resources-selector',
WEBHOOK_URL = 'webhook-url',
EMBED_CODE = 'embed-code',
QR_CODE_LOGIN = 'qr-code-login',