remote_mcp_execution
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| RemoteMCPExecutor llmling_agent.resource_providers.codemode.remote_mcp_execution Provides secure code execution with tool access. |
🛈 DocStrings¶
Code execution provider with secure tool isolation via FastAPI server.
RemoteMCPExecutor
dataclass
¶
Provides secure code execution with tool access.
Code Generation mode (ctx-zip style): - Tool functions are generated as Python files inside sandbox - User code imports tools directly, no HTTP server needed - Better for cloud sandboxes (E2B, etc.) that can't reach localhost
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
execution_env
instance-attribute
¶
execution_env: ExecutionEnvironment
Execution environment for running code.
toolset_generator
instance-attribute
¶
toolset_generator: ToolsetCodeGenerator
Code generator for tools.
use_code_generation
class-attribute
instance-attribute
¶
use_code_generation: bool = False
If True, use code generation approach instead of HTTP server.
__aenter__
async
¶
__aenter__() -> Self
Async context manager entry.
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
90 91 92 93 | |
__aexit__
async
¶
__aexit__(
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> None
Async context manager exit.
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
95 96 97 98 99 100 101 102 | |
execute_code
async
¶
execute_code(code: str) -> Any
Execute code with tools available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
str
|
Python code to execute |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Execution result from the environment |
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
79 80 81 82 83 84 85 86 87 88 | |
from_tools
classmethod
¶
from_tools(
tools: Sequence[Tool], env_config: ExecutionEnvironmentConfig, include_docstrings: bool = True
) -> RemoteMCPExecutor
Create provider from tools and environment configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
Sequence[Tool]
|
Tools to make available for code execution |
required |
env_config
|
ExecutionEnvironmentConfig
|
Execution environment configuration |
required |
include_docstrings
|
bool
|
Include function docstrings in documentation |
True
|
Returns:
| Type | Description |
|---|---|
RemoteMCPExecutor
|
RemoteMCPExecutor instance |
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
get_tool_description
¶
get_tool_description() -> str
Get comprehensive description of available tools.
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
68 69 70 71 72 73 74 75 76 77 | |
add_numbers
¶
add_numbers(x: int, y: int) -> int
Add two numbers.
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
110 111 112 | |
multiply_numbers
¶
multiply_numbers(x: int, y: int) -> int
Multiply two numbers.
Source code in src/llmling_agent/resource_providers/codemode/remote_mcp_execution.py
114 115 116 | |