agentscope.app.storageMCPRecord
class MCPRecord(_RecordBase)
agentscope/app/storage/_model/_mcp.py:9–88MCP 记录,在多次调用之间保存和恢复会话与记忆数据。位于 agentscope.app.storage 包,继承自 _RecordBase。核心成员包括 name。
This table is the desired state: a workspace's .mcp file is the
actual state, and the app converges the two. Every MCP a user owns
has a record here — installing from a hub and adding one by hand both
write one — because a workspace MCP with no record would be
indistinguishable from one the user removed.
The workspace relation is derived, not stored: it joins on the MCP
name, which is why :attr:MCPClient.name must be unique per user.
属性摘要Property Summary
| 属性Property | 说明Description |
|---|---|
namecomputed_field | 获取名称。 ``client.name`` lifted to the top level so storage backends can index it. Computed rather than stored, so it cannot go stale when the client is renamed, and records written before it existed need no migration. |
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
user_id | str | 用户标识字段。 | — |
client | MCPClient | 客户端字段。 | — |
display_name | str | None | 展示名称字段。 | Field(default=None) |
description | str | `description` 字段。 | Field(default='') |
author | str | None | `author` 字段。 | Field(default=None) |
icon_url | str | None | `icon_url` 字段。 | Field(default=None) |
url | str | None | URL字段。 | Field(default=None) |
tags | list[str] | 标签字段。 | Field(default_factory=list) |
values | dict | 值字段。 | Field(default_factory=dict) |
hub_id | str | None | 中心标识字段。 | Field(default=None) |
card_id | str | None | 卡片标识字段。 | Field(default=None) |
version | str | None | 版本字段。 | Field(default=None) |
enabled | bool | 已启用字段。 | Field(default=True) |
属性详情Attribute Detail
user_id
str用户标识字段。声明为 str。
The user id field.
agentscope/app/storage/_model/_mcp.py:23client
MCPClient客户端字段。声明为 MCPClient。
The client field.
agentscope/app/storage/_model/_mcp.py:25display_name
str | None = Field(default=None)展示名称字段。声明为 str | None。
The display name field.
agentscope/app/storage/_model/_mcp.py:40description
str = Field(default='')description 字段。声明为 str。
The description field.
agentscope/app/storage/_model/_mcp.py:43author
str | None = Field(default=None)author 字段。声明为 str | None。
The author field.
agentscope/app/storage/_model/_mcp.py:46icon_url
str | None = Field(default=None)icon_url 字段。声明为 str | None。
The icon url field.
agentscope/app/storage/_model/_mcp.py:49url
str | None = Field(default=None)URL字段。声明为 str | None。
The url field.
agentscope/app/storage/_model/_mcp.py:52tags
list[str] = Field(default_factory=list)标签字段。声明为 list[str]。
The tags field.
agentscope/app/storage/_model/_mcp.py:55values
dict = Field(default_factory=dict)值字段。声明为 dict。
The values field.
agentscope/app/storage/_model/_mcp.py:65hub_id
str | None = Field(default=None)中心标识字段。声明为 str | None。
The hub id field.
agentscope/app/storage/_model/_mcp.py:76card_id
str | None = Field(default=None)卡片标识字段。声明为 str | None。
The card id field.
agentscope/app/storage/_model/_mcp.py:79version
str | None = Field(default=None)版本字段。声明为 str | None。
The version field.
agentscope/app/storage/_model/_mcp.py:83enabled
bool = Field(default=True)已启用字段。声明为 bool。
The enabled field.
agentscope/app/storage/_model/_mcp.py:86属性详情Property Detail
name
def name() -> str
获取名称。
client.name lifted to the top level so storage backends can index it.
agentscope/app/storage/_model/_mcp.py:33–38