McpConfigConverter
public class McpConfigConverter
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:29–265MCP 配置转换器,让智能体以受控方式调用外部能力。位于 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
方法摘要Method Summary
构造器详情Constructor Detail
McpConfigConverter
public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist)
初始化 McpConfigConverter 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
sandboxType | String | 沙箱类型(类型 `String`)。The sandbox type. |
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:41–44McpConfigConverter
public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist, SandboxService sandboxService)
初始化 McpConfigConverter 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
sandboxType | String | 沙箱类型(类型 `String`)。The sandbox type. |
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
sandboxService | SandboxService | 沙箱服务(类型 `SandboxService`)。The sandbox service. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:46–50McpConfigConverter
public McpConfigConverter(Map<String, Object> serverConfigs, String sandboxType, Set<String> whitelist, Set<String> blacklist, SandboxService sandboxService, Sandbox sandbox)
初始化 McpConfigConverter 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
sandboxType | String | 沙箱类型(类型 `String`)。The sandbox type. |
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
sandboxService | SandboxService | 沙箱服务(类型 `SandboxService`)。The sandbox service. |
sandbox | Sandbox | 沙箱(类型 `Sandbox`)。The sandbox. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:52–65方法详情Method Detail
bind
public McpConfigConverter bind(Sandbox sandbox)
设置该参数。
Performs the bind operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandbox | Sandbox | 沙箱(类型 `Sandbox`)。The sandbox. |
McpConfigConverterio/agentscope/runtime/sandbox/tools/McpConfigConverter.java:67–75getServerConfigs
public Map<String, Object> getServerConfigs()
获取 getServerConfigs。
Returns the server configs.
Map<String, Object>io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:77–79setServerConfigs
public void setServerConfigs(Map<String, Object> serverConfigs)
设置 setServerConfigs。
Sets the server configs.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:81–83getWhitelist
public Set<String> getWhitelist()
获取 getWhitelist。
Returns the whitelist.
Set<String>io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:85–87setWhitelist
public void setWhitelist(Set<String> whitelist)
设置 setWhitelist。
Sets the whitelist.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:89–91getBlacklist
public Set<String> getBlacklist()
获取 getBlacklist。
Returns the blacklist.
Set<String>io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:93–95setBlacklist
public void setBlacklist(Set<String> blacklist)
设置 setBlacklist。
Sets the blacklist.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:97–99getSandboxService
public SandboxService getSandboxService()
获取沙箱服务。
Returns the sandbox service.
SandboxServiceio/agentscope/runtime/sandbox/tools/McpConfigConverter.java:101–103setSandboxService
public void setSandboxService(SandboxService sandboxService)
设置沙箱服务。
Sets the sandbox service.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxService | SandboxService | 沙箱服务(类型 `SandboxService`)。The sandbox service. |
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:105–107toBuiltinTools
public List<MCPTool> toBuiltinTools()
返回到内置工具。
Returns the to builtin tools.
List<MCPTool>io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:109–129fromDict
public static McpConfigConverter fromDict(Map<String, Object> configDict, Set<String> whitelist, Set<String> blacklist)
执行 fromDict 方法。
Performs the from dict operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
configDict | Map<String, Object> | 配置 Dict(类型 `Map`)。The config dict. |
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
McpConfigConverterio/agentscope/runtime/sandbox/tools/McpConfigConverter.java:199–203fromDict
public static McpConfigConverter fromDict(Map<String, Object> configDict)
设置该参数。
Performs the from dict operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
configDict | Map<String, Object> | 配置 Dict(类型 `Map`)。The config dict. |
McpConfigConverterio/agentscope/runtime/sandbox/tools/McpConfigConverter.java:205–207fromString
public static McpConfigConverter fromString(String configStr, Set<String> whitelist, Set<String> blacklist)
执行 fromString 方法。
Performs the from string operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
configStr | String | 配置 Str(类型 `String`)。The config str. |
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
McpConfigConverterio/agentscope/runtime/sandbox/tools/McpConfigConverter.java:209–214fromString
public static McpConfigConverter fromString(String configStr)
设置该参数。
Performs the from string operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
configStr | String | 配置 Str(类型 `String`)。The config str. |
McpConfigConverterio/agentscope/runtime/sandbox/tools/McpConfigConverter.java:216–218builder
public static Builder builder()
返回构建器实例。
Returns the builder.
Builderio/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.