AS AgentScopeAPI 手册 / API Reference
类class agentscope.mcp

StdioMCPConfig

class StdioMCPConfig(BaseModel)
源码Source agentscope/mcp/_config.py:9–41

stdio MCP 配置,保存相关配置项。位于 agentscope.mcp 包。

The STDIO MCP server configuration. Declared in agentscope.mcp.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
typeLiteral['stdio_mcp']
类型字段。
'stdio_mcp'
commandstr
命令到启动 MCP 服务端。
Field(title='Command', description='The command to start the MCP server.')
argslist[str] | None
参数字段。
Field(title='Args', description='The command line arguments to pass to the MCP server.', default=None)
envdict[str, str] | None
`env` 字段。
Field(title='Environment Variables', default=None, description='The environment variables to pass to the MCP server.')
cwdstr | Path | None
`cwd` 字段。
Field(default=None, title='CWD', description='The working directory to use when spawning the process.')
encoding_error_handlerLiteral['strict', 'ignore', 'replace']
`encoding_error_handler` 字段。
Field(default='strict', title='Encoding Error Handler', description='The text encoding error handler.')

属性详情Attribute Detail

type

Literal['stdio_mcp'] = 'stdio_mcp'

类型字段。声明为 Literal['stdio_mcp']。

The type field.

源码Source agentscope/mcp/_config.py:12

command

str = Field(title='Command', description='The command to start the MCP server.')

命令到启动 MCP 服务端。

The command to start the MCP server.

源码Source agentscope/mcp/_config.py:14

args

list[str] | None = Field(title='Args', description='The command line arguments to pass to the MCP server.', default=None)

参数字段。声明为 list[str] | None。

The command line arguments to pass to the MCP server.

源码Source agentscope/mcp/_config.py:19

env

dict[str, str] | None = Field(title='Environment Variables', default=None, description='The environment variables to pass to the MCP server.')

env 字段。声明为 dict[str, str] | None。

The environment variables to pass to the MCP server.

源码Source agentscope/mcp/_config.py:25

cwd

str | Path | None = Field(default=None, title='CWD', description='The working directory to use when spawning the process.')

cwd 字段。声明为 str | Path | None。

The working directory to use when spawning the process.

源码Source agentscope/mcp/_config.py:31

encoding_error_handler

Literal['strict', 'ignore', 'replace'] = Field(default='strict', title='Encoding Error Handler', description='The text encoding error handler.')

encoding_error_handler 字段。声明为 Literal['strict', 'ignore', 'replace']。

The text encoding error handler.

源码Source agentscope/mcp/_config.py:37
基于官方固定版本源码静态生成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.