AS AgentScopeAPI 手册 / API Reference
类class agentscope.app.storage

MCPRecord

class MCPRecord(_RecordBase)
源码Source agentscope/app/storage/_model/_mcp.py:9–88

MCP 记录,在多次调用之间保存和恢复会话与记忆数据。位于 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_idstr
用户标识字段。
—
clientMCPClient
客户端字段。
—
display_namestr | None
展示名称字段。
Field(default=None)
descriptionstr
`description` 字段。
Field(default='')
authorstr | None
`author` 字段。
Field(default=None)
icon_urlstr | None
`icon_url` 字段。
Field(default=None)
urlstr | None
URL字段。
Field(default=None)
tagslist[str]
标签字段。
Field(default_factory=list)
valuesdict
值字段。
Field(default_factory=dict)
hub_idstr | None
中心标识字段。
Field(default=None)
card_idstr | None
卡片标识字段。
Field(default=None)
versionstr | None
版本字段。
Field(default=None)
enabledbool
已启用字段。
Field(default=True)

属性详情Attribute Detail

user_id

str

用户标识字段。声明为 str。

The user id field.

源码Source agentscope/app/storage/_model/_mcp.py:23

client

MCPClient

客户端字段。声明为 MCPClient。

The client field.

源码Source agentscope/app/storage/_model/_mcp.py:25

display_name

str | None = Field(default=None)

展示名称字段。声明为 str | None。

The display name field.

源码Source agentscope/app/storage/_model/_mcp.py:40

description

str = Field(default='')

description 字段。声明为 str。

The description field.

源码Source agentscope/app/storage/_model/_mcp.py:43

author

str | None = Field(default=None)

author 字段。声明为 str | None。

The author field.

源码Source agentscope/app/storage/_model/_mcp.py:46

icon_url

str | None = Field(default=None)

icon_url 字段。声明为 str | None。

The icon url field.

源码Source agentscope/app/storage/_model/_mcp.py:49

url

str | None = Field(default=None)

URL字段。声明为 str | None。

The url field.

源码Source agentscope/app/storage/_model/_mcp.py:52

tags

list[str] = Field(default_factory=list)

标签字段。声明为 list[str]。

The tags field.

源码Source agentscope/app/storage/_model/_mcp.py:55

values

dict = Field(default_factory=dict)

值字段。声明为 dict。

The values field.

源码Source agentscope/app/storage/_model/_mcp.py:65

hub_id

str | None = Field(default=None)

中心标识字段。声明为 str | None。

The hub id field.

源码Source agentscope/app/storage/_model/_mcp.py:76

card_id

str | None = Field(default=None)

卡片标识字段。声明为 str | None。

The card id field.

源码Source agentscope/app/storage/_model/_mcp.py:79

version

str | None = Field(default=None)

版本字段。声明为 str | None。

The version field.

源码Source agentscope/app/storage/_model/_mcp.py:83

enabled

bool = Field(default=True)

已启用字段。声明为 bool。

The enabled field.

源码Source agentscope/app/storage/_model/_mcp.py:86

属性详情Property Detail

name

def name() -> str
computed_field

获取名称。

client.name lifted to the top level so storage backends can index it.

返回Returns str
返回字符串结果。Returns a string.
源码Source agentscope/app/storage/_model/_mcp.py:33–38
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.