AS AgentScopeAPI 手册 / API Reference

McpConfigConverter

public class McpConfigConverter
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:29–265

MCP 配置转换器,让智能体以受控方式调用外部能力。位于 io.agentscope.runtime.sandbox.tools 包。核心成员包括 bind、getServerConfigs、setServerConfigs、getWhitelist、setWhitelist、getBlacklist。

A class in io.agentscope.runtime.sandbox.tools that lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.sandbox.tools.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.runtime.sandbox.tools that lets agents invoke external capabilities under control.

构造器摘要Constructor Summary

构造器Constructor说明Description
public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist)
初始化 `McpConfigConverter` 实例。
Creates a new instance.
public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist, SandboxService sandboxService)
初始化 `McpConfigConverter` 实例。
Creates a new instance.
public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist, SandboxService sandboxService, Sandbox sandbox)
初始化 `McpConfigConverter` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public McpConfigConverter bind(Sandbox sandbox)
设置该参数。
Performs the bind operation.
public Map<String, Object> getServerConfigs()
获取 `getServerConfigs`。
Returns the server configs.
public void setServerConfigs(Map<String, Object> serverConfigs)
设置 `setServerConfigs`。
Sets the server configs.
public Set<String> getWhitelist()
获取 `getWhitelist`。
Returns the whitelist.
public void setWhitelist(Set<String> whitelist)
设置 `setWhitelist`。
Sets the whitelist.
public Set<String> getBlacklist()
获取 `getBlacklist`。
Returns the blacklist.
public void setBlacklist(Set<String> blacklist)
设置 `setBlacklist`。
Sets the blacklist.
public SandboxService getSandboxService()
获取沙箱服务。
Returns the sandbox service.
public void setSandboxService(SandboxService sandboxService)
设置沙箱服务。
Sets the sandbox service.
public List<MCPTool> toBuiltinTools()
返回到内置工具。
Returns the to builtin tools.
public static McpConfigConverter fromDict(Map<String, Object> configDict, Set<String> whitelist, Set<String> blacklist)
static
执行 `fromDict` 方法。
Performs the from dict operation.
public static McpConfigConverter fromDict(Map<String, Object> configDict)
static
设置该参数。
Performs the from dict operation.
public static McpConfigConverter fromString(String configStr, Set<String> whitelist, Set<String> blacklist)
static
执行 `fromString` 方法。
Performs the from string operation.
public static McpConfigConverter fromString(String configStr)
static
设置该参数。
Performs the from string operation.
public static Builder builder()
static
返回构建器实例。
Returns the builder.

构造器详情Constructor Detail

McpConfigConverter

public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist)

初始化 McpConfigConverter 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
serverConfigsMap<String, Object>服务端 Configs(类型 `Map`)。The server configs.
sandboxTypeString沙箱类型(类型 `String`)。The sandbox type.
whitelistSet<String>whitelist(类型 `Set`)。The whitelist.
blacklistSet<String>blacklist(类型 `Set`)。The blacklist.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:41–44

McpConfigConverter

public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist, SandboxService sandboxService)

初始化 McpConfigConverter 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
serverConfigsMap<String, Object>服务端 Configs(类型 `Map`)。The server configs.
sandboxTypeString沙箱类型(类型 `String`)。The sandbox type.
whitelistSet<String>whitelist(类型 `Set`)。The whitelist.
blacklistSet<String>blacklist(类型 `Set`)。The blacklist.
sandboxServiceSandboxService沙箱服务(类型 `SandboxService`)。The sandbox service.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:46–50

McpConfigConverter

public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist, SandboxService sandboxService, Sandbox sandbox)

初始化 McpConfigConverter 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
serverConfigsMap<String, Object>服务端 Configs(类型 `Map`)。The server configs.
sandboxTypeString沙箱类型(类型 `String`)。The sandbox type.
whitelistSet<String>whitelist(类型 `Set`)。The whitelist.
blacklistSet<String>blacklist(类型 `Set`)。The blacklist.
sandboxServiceSandboxService沙箱服务(类型 `SandboxService`)。The sandbox service.
sandboxSandbox沙箱(类型 `Sandbox`)。The sandbox.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:52–65

方法详情Method Detail

bind

public McpConfigConverter bind(Sandbox sandbox)

设置该参数。

Performs the bind operation.

参数Parameters
名称Name类型Type说明Description
sandboxSandbox沙箱(类型 `Sandbox`)。The sandbox.
返回Returns McpConfigConverter
返回McpConfigConverter。Returns mcp config converter.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:67–75

getServerConfigs

public Map<String, Object> getServerConfigs()

获取 getServerConfigs。

Returns the server configs.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:77–79

setServerConfigs

public void setServerConfigs(Map<String, Object> serverConfigs)

设置 setServerConfigs。

Sets the server configs.

参数Parameters
名称Name类型Type说明Description
serverConfigsMap<String, Object>服务端 Configs(类型 `Map`)。The server configs.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:81–83

getWhitelist

public Set<String> getWhitelist()

获取 getWhitelist。

Returns the whitelist.

返回Returns Set<String>
返回设置。Returns set.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:85–87

setWhitelist

public void setWhitelist(Set<String> whitelist)

设置 setWhitelist。

Sets the whitelist.

参数Parameters
名称Name类型Type说明Description
whitelistSet<String>whitelist(类型 `Set`)。The whitelist.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:89–91

getBlacklist

public Set<String> getBlacklist()

获取 getBlacklist。

Returns the blacklist.

返回Returns Set<String>
返回设置。Returns set.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:93–95

setBlacklist

public void setBlacklist(Set<String> blacklist)

设置 setBlacklist。

Sets the blacklist.

参数Parameters
名称Name类型Type说明Description
blacklistSet<String>blacklist(类型 `Set`)。The blacklist.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:97–99

getSandboxService

public SandboxService getSandboxService()

获取沙箱服务。

Returns the sandbox service.

返回Returns SandboxService
返回SandboxService。Returns sandbox service.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:101–103

setSandboxService

public void setSandboxService(SandboxService sandboxService)

设置沙箱服务。

Sets the sandbox service.

参数Parameters
名称Name类型Type说明Description
sandboxServiceSandboxService沙箱服务(类型 `SandboxService`)。The sandbox service.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:105–107

toBuiltinTools

public List<MCPTool> toBuiltinTools()

返回到内置工具。

Returns the to builtin tools.

返回Returns List<MCPTool>
返回列出。Returns list.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:109–129

fromDict

public static McpConfigConverter fromDict(Map<String, Object> configDict, Set<String> whitelist, Set<String> blacklist)
static

执行 fromDict 方法。

Performs the from dict operation.

参数Parameters
名称Name类型Type说明Description
configDictMap<String, Object>配置 Dict(类型 `Map`)。The config dict.
whitelistSet<String>whitelist(类型 `Set`)。The whitelist.
blacklistSet<String>blacklist(类型 `Set`)。The blacklist.
返回Returns McpConfigConverter
返回McpConfigConverter。Returns mcp config converter.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:199–203

fromDict

public static McpConfigConverter fromDict(Map<String, Object> configDict)
static

设置该参数。

Performs the from dict operation.

参数Parameters
名称Name类型Type说明Description
configDictMap<String, Object>配置 Dict(类型 `Map`)。The config dict.
返回Returns McpConfigConverter
返回McpConfigConverter。Returns mcp config converter.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:205–207

fromString

public static McpConfigConverter fromString(String configStr, Set<String> whitelist, Set<String> blacklist)
static

执行 fromString 方法。

Performs the from string operation.

参数Parameters
名称Name类型Type说明Description
configStrString配置 Str(类型 `String`)。The config str.
whitelistSet<String>whitelist(类型 `Set`)。The whitelist.
blacklistSet<String>blacklist(类型 `Set`)。The blacklist.
返回Returns McpConfigConverter
返回McpConfigConverter。Returns mcp config converter.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:209–214

fromString

public static McpConfigConverter fromString(String configStr)
static

设置该参数。

Performs the from string operation.

参数Parameters
名称Name类型Type说明Description
configStrString配置 Str(类型 `String`)。The config str.
返回Returns McpConfigConverter
返回McpConfigConverter。Returns mcp config converter.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:216–218

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:220–222

嵌套类详情Nested Class Detail

Builder

public static class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.runtime.sandbox.tools 包。核心成员包括 serverConfigs、sandboxType、whitelist、blacklist、sandboxService、build。

A class in io.agentscope.runtime.sandbox.tools that lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.sandbox.tools.

基于官方固定版本源码静态生成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.