agentscope.app.hubMCPCard
class MCPCard(BaseModel)
agentscope/app/hub/_mcp/_card.py:10–177MCP 卡片,把智能体接入外部消息渠道与企业平台。位于 agentscope.app.hub 包。
A card is a template, not a connectable client:
:attr:config_template carries ${...} placeholders whose values
the user supplies at install time, described by
:attr:inputs_schema.
Two identifiers, deliberately separate:
- :attr:
idaddresses the card on its hub and is what :attr:refembeds. It may be any opaque string. - :attr:
nameis the default name of the installed client, which must match[a-zA-Z0-9_-]+because it composes the model-facing tool namemcp__{name}__{tool}. Cards are not rejected for a bad name — the install call is, so browsing a registry with odd slugs still works.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
hub_id | str | 中心标识字段。 | Field(title='Hub ID', description='The id of the hub this card came from.') |
id | str | 标识字段。 | Field(default='', title='ID', description='The identifier addressing this card on its hub. Defaults to ``name`` for registries that expose no separate id.') |
name | str | 名称字段。 | Field(title='Name', description='The default name of the installed MCP client.') |
display_name | str | None | 展示名称字段。 | Field(default=None, title='Display Name', description='The user-facing name, falling back to ``name``.') |
description | str | `description` 字段。 | Field(default='', title='Description', description='The user-facing description of the MCP.') |
tags | list[str] | 标签字段。 | Field(default_factory=list, title='Tags', description='The tags categorizing this card.') |
version | str | None | 版本字段。 | Field(default=None, title='Version', description='The card version reported by the hub.') |
updated_at | float | None | 已更新 at字段。 | Field(default=None, title='Updated At', description='The last-updated timestamp (Unix epoch seconds).') |
author | str | None | `author` 字段。 | Field(default=None, title='Author', description='Who published the MCP, when the hub says.') |
icon_url | str | None | `icon_url` 字段。 | Field(default=None, title='Icon URL', description='An image representing the MCP. ``None`` when the hub offers none — the UI is expected to fall back rather than show a broken image.') |
url | str | None | URL字段。 | Field(default=None, title='URL', description="The MCP's page on the hub's website, for a 'view on the hub' link. ``None`` when the hub has no web presence.") |
readme | str | None | `readme` 字段。 | Field(default=None, title='Readme', description="The server's long-form documentation, shown in the detail view where a skill shows its ``SKILL.md``. ``None`` when the hub publishes none.") |
installs | int | None | `installs` 字段。 | Field(default=None, title='Installs', description='How many times this MCP has been installed. ``None`` when the hub does not count installs, which is not the same as zero — render it only when set.') |
downloads | int | None | `downloads` 字段。 | Field(default=None, title='Downloads', description='How many times this MCP has been downloaded. ``None`` when the hub does not count downloads.') |
is_stateful | bool | `is_stateful` 字段。 | Field(default=True, title='Stateful', description='Whether the installed client requires explicit connect() and close(). Forwarded to ``MCPClient.is_stateful``.') |
auth | Literal['none', 'inputs'] | 认证字段。 | Field(default='inputs', title='Auth', description='How the user authenticates: ``none`` for public servers, ``inputs`` for the ``inputs_schema`` form. Reserved as a discriminator so an ``oauth`` flow can be added later without breaking the API.') |
inputs_schema | dict | `inputs_schema` 字段。 | Field(default_factory=dict, title='Inputs Schema', description='A JSON Schema (``type: object``) describing the values the user must supply. Secret fields carry the standard ``writeOnly: true`` and ``format: password`` keywords so the frontend renders them masked.') |
config_template | StdioMCPConfig | HttpMCPConfig | 配置模板字段。 | Field(discriminator='type', title='Config Template', description='The MCP config whose string leaves may hold ``${name}`` placeholders referring to ``inputs_schema`` properties.') |
属性详情Attribute Detail
hub_id
str = Field(title='Hub ID', description='The id of the hub this card came from.')中心标识字段。声明为 str。
The id of the hub this card came from.
agentscope/app/hub/_mcp/_card.py:29id
str = Field(default='', title='ID', description='The identifier addressing this card on its hub. Defaults to ``name`` for registries that expose no separate id.')标识字段。声明为 str。
The identifier addressing this card on its hub.
agentscope/app/hub/_mcp/_card.py:34name
str = Field(title='Name', description='The default name of the installed MCP client.')名称字段。声明为 str。
The default name of the installed MCP client.
agentscope/app/hub/_mcp/_card.py:43display_name
str | None = Field(default=None, title='Display Name', description='The user-facing name, falling back to ``name``.')展示名称字段。声明为 str | None。
The user-facing name, falling back to name.
agentscope/app/hub/_mcp/_card.py:48description
str = Field(default='', title='Description', description='The user-facing description of the MCP.')description 字段。声明为 str。
The user-facing description of the MCP.
agentscope/app/hub/_mcp/_card.py:54tags
list[str] = Field(default_factory=list, title='Tags', description='The tags categorizing this card.')标签字段。声明为 list[str]。
The tags categorizing this card.
agentscope/app/hub/_mcp/_card.py:60version
str | None = Field(default=None, title='Version', description='The card version reported by the hub.')版本字段。声明为 str | None。
The card version reported by the hub.
agentscope/app/hub/_mcp/_card.py:66updated_at
float | None = Field(default=None, title='Updated At', description='The last-updated timestamp (Unix epoch seconds).')已更新 at字段。声明为 float | None。
The last-updated timestamp (Unix epoch seconds).
agentscope/app/hub/_mcp/_card.py:72author
str | None = Field(default=None, title='Author', description='Who published the MCP, when the hub says.')author 字段。声明为 str | None。
Who published the MCP, when the hub says.
agentscope/app/hub/_mcp/_card.py:78icon_url
str | None = Field(default=None, title='Icon URL', description='An image representing the MCP. ``None`` when the hub offers none — the UI is expected to fall back rather than show a broken image.')icon_url 字段。声明为 str | None。
An image representing the MCP.
agentscope/app/hub/_mcp/_card.py:84url
str | None = Field(default=None, title='URL', description="The MCP's page on the hub's website, for a 'view on the hub' link. ``None`` when the hub has no web presence.")URL字段。声明为 str | None。
The MCP's page on the hub's website, for a 'view on the hub' link.
agentscope/app/hub/_mcp/_card.py:94readme
str | None = Field(default=None, title='Readme', description="The server's long-form documentation, shown in the detail view where a skill shows its ``SKILL.md``. ``None`` when the hub publishes none.")readme 字段。声明为 str | None。
The server's long-form documentation, shown in the detail view where a skill shows its SKILL.md.
agentscope/app/hub/_mcp/_card.py:103installs
int | None = Field(default=None, title='Installs', description='How many times this MCP has been installed. ``None`` when the hub does not count installs, which is not the same as zero — render it only when set.')installs 字段。声明为 int | None。
How many times this MCP has been installed.
agentscope/app/hub/_mcp/_card.py:113downloads
int | None = Field(default=None, title='Downloads', description='How many times this MCP has been downloaded. ``None`` when the hub does not count downloads.')downloads 字段。声明为 int | None。
How many times this MCP has been downloaded.
agentscope/app/hub/_mcp/_card.py:123is_stateful
bool = Field(default=True, title='Stateful', description='Whether the installed client requires explicit connect() and close(). Forwarded to ``MCPClient.is_stateful``.')is_stateful 字段。声明为 bool。
Whether the installed client requires explicit connect() and close().
agentscope/app/hub/_mcp/_card.py:132auth
Literal['none', 'inputs'] = Field(default='inputs', title='Auth', description='How the user authenticates: ``none`` for public servers, ``inputs`` for the ``inputs_schema`` form. Reserved as a discriminator so an ``oauth`` flow can be added later without breaking the API.')认证字段。声明为 Literal['none', 'inputs']。
How the user authenticates: none for public servers, inputs for the inputs_schema form.
agentscope/app/hub/_mcp/_card.py:141inputs_schema
dict = Field(default_factory=dict, title='Inputs Schema', description='A JSON Schema (``type: object``) describing the values the user must supply. Secret fields carry the standard ``writeOnly: true`` and ``format: password`` keywords so the frontend renders them masked.')inputs_schema 字段。声明为 dict。
A JSON Schema (type: object) describing the values the user must supply.
agentscope/app/hub/_mcp/_card.py:152config_template
StdioMCPConfig | HttpMCPConfig = Field(discriminator='type', title='Config Template', description='The MCP config whose string leaves may hold ``${name}`` placeholders referring to ``inputs_schema`` properties.')配置模板字段。声明为 StdioMCPConfig | HttpMCPConfig。
The MCP config whose string leaves may hold ${name} placeholders referring to inputs_schema properties.
agentscope/app/hub/_mcp/_card.py:163