MCP Code Executor
The MCP Code Executor server enables LLMs to execute Python code within configurable environments with the following capabilities:
Execute Python code: Run code snippets directly from LLM prompts
Manage dependencies: Install packages and verify installed packages
Configure environments: Dynamically set up and switch between Conda, virtualenv, or UV virtualenv environments
Handle large code blocks: Support incremental code generation through initializing, appending to, and executing code files
File operations: Name files, read existing code files, and verify content before execution
Environment information: Retrieve current environment configuration
Storage configuration: Customize storage location for code files
Allows LLMs to execute Python code within a specified Conda environment with access to libraries and dependencies
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Code Executorcalculate the average of these numbers: [45, 67, 89, 23, 56]"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Code Executor
The MCP Code Executor is an MCP server that allows LLMs to execute Python code within a specified Python environment. This enables LLMs to run code with access to libraries and dependencies defined in the environment. It also supports incremental code generation for handling large code blocks that may exceed token limits.
Features
Execute Python code from LLM prompts
Support for incremental code generation to overcome token limitations
Run code within a specified environment (Conda, virtualenv, or UV virtualenv)
Install dependencies when needed
Check if packages are already installed
Dynamically configure the environment at runtime
Configurable code storage directory
Related MCP server: LLM Python Code Sandbox
Prerequisites
Node.js installed
One of the following:
Conda installed with desired Conda environment created
Python virtualenv
UV virtualenv
Setup
Clone this repository:
git clone https://github.com/bazinga012/mcp_code_executor.gitNavigate to the project directory:
cd mcp_code_executorInstall the Node.js dependencies:
npm installBuild the project:
npm run buildConfiguration
To configure the MCP Code Executor server, add the following to your MCP servers configuration file:
Using Node.js
{
"mcpServers": {
"mcp-code-executor": {
"command": "node",
"args": [
"/path/to/mcp_code_executor/build/index.js"
],
"env": {
"CODE_STORAGE_DIR": "/path/to/code/storage",
"ENV_TYPE": "conda",
"CONDA_ENV_NAME": "your-conda-env"
}
}
}
}Using Docker
{
"mcpServers": {
"mcp-code-executor": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp-code-executor"
]
}
}
}Note: The Dockerfile has been tested with the venv-uv environment type only. Other environment types may require additional configuration.
Environment Variables
Required Variables
CODE_STORAGE_DIR: Directory where the generated code will be stored
Environment Type (choose one setup)
For Conda:
ENV_TYPE: Set tocondaCONDA_ENV_NAME: Name of the Conda environment to use
For Standard Virtualenv:
ENV_TYPE: Set tovenvVENV_PATH: Path to the virtualenv directory
For UV Virtualenv:
ENV_TYPE: Set tovenv-uvUV_VENV_PATH: Path to the UV virtualenv directory
Available Tools
The MCP Code Executor provides the following tools to LLMs:
1. execute_code
Executes Python code in the configured environment. Best for short code snippets.
{
"name": "execute_code",
"arguments": {
"code": "import numpy as np\nprint(np.random.rand(3,3))",
"filename": "matrix_gen"
}
}2. install_dependencies
Installs Python packages in the environment.
{
"name": "install_dependencies",
"arguments": {
"packages": ["numpy", "pandas", "matplotlib"]
}
}3. check_installed_packages
Checks if packages are already installed in the environment.
{
"name": "check_installed_packages",
"arguments": {
"packages": ["numpy", "pandas", "non_existent_package"]
}
}4. configure_environment
Dynamically changes the environment configuration.
{
"name": "configure_environment",
"arguments": {
"type": "conda",
"conda_name": "new_env_name"
}
}5. get_environment_config
Gets the current environment configuration.
{
"name": "get_environment_config",
"arguments": {}
}6. initialize_code_file
Creates a new Python file with initial content. Use this as the first step for longer code that may exceed token limits.
{
"name": "initialize_code_file",
"arguments": {
"content": "def main():\n print('Hello, world!')\n\nif __name__ == '__main__':\n main()",
"filename": "my_script"
}
}7. append_to_code_file
Appends content to an existing Python code file. Use this to add more code to a file created with initialize_code_file.
{
"name": "append_to_code_file",
"arguments": {
"file_path": "/path/to/code/storage/my_script_abc123.py",
"content": "\ndef another_function():\n print('This was appended to the file')\n"
}
}8. execute_code_file
Executes an existing Python file. Use this as the final step after building up code with initialize_code_file and append_to_code_file.
{
"name": "execute_code_file",
"arguments": {
"file_path": "/path/to/code/storage/my_script_abc123.py"
}
}9. read_code_file
Reads the content of an existing Python code file. Use this to verify the current state of a file before appending more content or executing it.
{
"name": "read_code_file",
"arguments": {
"file_path": "/path/to/code/storage/my_script_abc123.py"
}
}Usage
Once configured, the MCP Code Executor will allow LLMs to execute Python code by generating a file in the specified CODE_STORAGE_DIR and running it within the configured environment.
LLMs can generate and execute code by referencing this MCP server in their prompts.
Handling Large Code Blocks
For larger code blocks that might exceed LLM token limits, use the incremental code generation approach:
Initialize a file with the basic structure using
initialize_code_fileAdd more code in subsequent calls using
append_to_code_fileVerify the file content if needed using
read_code_fileExecute the complete code using
execute_code_file
This approach allows LLMs to write complex, multi-part code without running into token limitations.
Backward Compatibility
This package maintains backward compatibility with earlier versions. Users of previous versions who only specified a Conda environment will continue to work without any changes to their configuration.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Available Tools
9 toolsappend_to_code_fileA
Append content to an existing Python code file. Use this to add more code to a file created with initialize_code_file, allowing you to build up larger code bases in parts.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Full path to the file | |
| content | Yes | Content to append to the file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the tool appends content, it doesn't disclose important behavioral traits like whether it requires file existence, handles file permissions, what happens on errors, or if it overwrites existing content. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise with two sentences that each earn their place. The first sentence states the core purpose, and the second provides usage context and sibling tool reference. There's zero wasted text, and information is front-loaded appropriately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a mutation tool with no annotations and no output schema, the description should do more to explain behavioral aspects. While it clearly states the purpose and usage guidelines, it lacks information about error conditions, file requirements, or what happens when the operation completes. For a tool that modifies files, this leaves important contextual gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters (file_path and content) adequately. The description doesn't add any parameter-specific information beyond what's in the schema, such as file path format requirements or content encoding details. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Append content') and target resource ('existing Python code file'), distinguishing it from sibling tools like initialize_code_file (creates new files) and read_code_file (reads without modifying). It provides a precise verb+resource combination with clear scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use this tool ('to add more code to a file created with initialize_code_file') and provides a clear alternative context ('allowing you to build up larger code bases in parts'). It directly references a sibling tool for comparison, giving clear guidance on appropriate usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_installed_packagesC
Check if packages are installed in the conda environment
| Name | Required | Description | Default |
|---|---|---|---|
| packages | Yes | List of packages to check |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool checks installation status but doesn't describe what the output looks like (e.g., boolean per package, version details), error handling, or performance characteristics. This leaves significant gaps for an agent to understand how to interpret results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose with zero waste. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., success/failure indicators, detailed package info), which is critical for a check operation. For a tool with no structured output documentation, the description should compensate more.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the single parameter 'packages' clearly documented as 'List of packages to check'. The description adds no additional meaning beyond this, such as format examples (e.g., package names with versions) or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Check') and target ('packages are installed in the conda environment'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_environment_config' or 'install_dependencies', which might also provide package-related information.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether a conda environment must be active), exclusions, or comparisons to sibling tools like 'get_environment_config' that might offer broader environment information.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
configure_environmentC
Change the environment configuration settings
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Type of Python environment | |
| conda_name | No | Name of the conda environment (required if type is 'conda') | |
| venv_path | No | Path to the virtualenv (required if type is 'venv') | |
| uv_venv_path | No | Path to the UV virtualenv (required if type is 'venv-uv') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Change' implying a mutation, but doesn't specify permissions needed, whether changes are reversible, potential side effects, or error handling. This is inadequate for a configuration tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of environment configuration, no annotations, and no output schema, the description is insufficient. It lacks details on behavioral traits, usage context, and expected outcomes, making it incomplete for effective tool invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond the schema's details about environment types and paths, meeting the baseline for high coverage without extra value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Change the environment configuration settings' clearly states the action ('Change') and resource ('environment configuration settings'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_environment_config' (which likely reads rather than changes settings), leaving room for improvement in distinguishing functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, timing, or how it relates to sibling tools such as 'get_environment_config' or 'install_dependencies', leaving the agent without context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
execute_codeA
Execute Python code in the conda environment. For short code snippets only. For longer code, use initialize_code_file and append_to_code_file instead.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code to execute | |
| filename | No | Optional: Name of the file to save the code (default: generated UUID) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions the environment ('conda environment') and a constraint on code length, but lacks details on execution behavior (e.g., timeout, output handling, error propagation) or safety considerations. It adds some context but is incomplete for a code execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with zero waste: the first states the purpose and constraint, the second provides alternative guidance. It is front-loaded with essential information and appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description covers basic purpose and usage but lacks details on execution behavior, return values, or error handling. It is minimally viable for a code execution tool but has clear gaps in contextual information needed for reliable use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters ('code' and 'filename'). The description does not add any meaning beyond the schema, such as explaining what 'short code snippets' entail or how the filename is used. Baseline 3 is appropriate as the schema handles parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Execute Python code') and resource ('in the conda environment'), and explicitly distinguishes it from sibling tools by mentioning 'initialize_code_file and append_to_code_file' for longer code, making the purpose unambiguous and differentiated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool ('For short code snippets only') and when to use alternatives ('For longer code, use initialize_code_file and append_to_code_file instead'), offering clear context and exclusions without being misleading.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
execute_code_fileA
Execute an existing Python file. Use this as the final step after building up code with initialize_code_file and append_to_code_file.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Full path to the Python file to execute |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions that it executes a Python file, implying mutation/runtime effects, but lacks details on permissions, safety (e.g., sandboxing), error handling, or output behavior. It adds some context about being a 'final step' but misses key behavioral traits for an execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core purpose and followed by usage guidance. Every sentence earns its place with no wasted words, making it highly efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (executing code, which can have side effects), lack of annotations, and no output schema, the description is incomplete. It covers purpose and workflow but omits critical details like execution environment, return values, or error conditions, leaving gaps for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the 'file_path' parameter fully. The description does not add any meaning beyond what the schema provides (e.g., format examples or constraints), resulting in a baseline score of 3 as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Execute') and resource ('an existing Python file'), distinguishing it from siblings like 'execute_code' (which likely executes code directly) and 'read_code_file' (which only reads). It directly addresses what the tool does without being vague or tautological.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states when to use this tool ('as the final step after building up code with initialize_code_file and append_to_code_file'), providing clear context and naming specific alternatives (siblings) for the workflow. This gives strong guidance on its role versus other tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_environment_configB
Get the current environment configuration
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get' implies a read operation, but doesn't specify what 'environment configuration' includes (e.g., variables, paths, dependencies), whether it requires permissions, if it's cached or real-time, or what happens on errors. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence: 'Get the current environment configuration.' It's front-loaded with the core action and resource, with no wasted words or redundant information. This is appropriately sized and efficient for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on output format, error handling, or how it differs from siblings. Without annotations or output schema, more context on return values or behavioral traits would improve completeness, but it's not entirely incomplete for such a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description doesn't add parameter details, which is appropriate since there are none to explain. This meets the baseline of 4 for tools with zero parameters, as there's no need to compensate for missing schema information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get the current environment configuration' clearly states the verb ('Get') and resource ('environment configuration'), making the purpose understandable. However, it doesn't distinguish this tool from potential sibling tools like 'configure_environment' or 'check_installed_packages' that might also interact with environment settings, leaving some ambiguity about its specific scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. With siblings like 'configure_environment' (which might modify settings) and 'check_installed_packages' (which might list installed components), there's no indication of whether this tool is for read-only access, current runtime settings, or other specific contexts. It lacks explicit when/when-not instructions or named alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
initialize_code_fileA
Create a new Python file with initial content. Use this as the first step for longer code that may exceed token limits. Follow with append_to_code_file for additional code.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Initial content to write to the file | |
| filename | No | Optional: Name of the file (default: generated UUID) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states this creates a new file (implying a write operation) and mentions token limit considerations, but doesn't specify file system permissions, error handling, or what happens if the file already exists. It adds some context but lacks comprehensive behavioral details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (two sentences) with zero wasted words. The first sentence states the core purpose, and the second provides crucial usage guidance. Every sentence earns its place and is front-loaded with essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a creation tool with no annotations and no output schema, the description does well by explaining the tool's role in a multi-step workflow and referencing its sibling. However, it doesn't mention what the tool returns (e.g., success confirmation, file path) or potential error conditions, leaving some gaps in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain content formatting or filename conventions). Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Create a new Python file with initial content') and distinguishes it from its sibling 'append_to_code_file' by positioning it as 'the first step for longer code.' It explicitly names the resource (Python file) and verb (create), avoiding tautology.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool ('as the first step for longer code that may exceed token limits') and when to use an alternative ('Follow with append_to_code_file for additional code'). It clearly differentiates usage contexts between initialization and appending.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
install_dependenciesC
Install Python dependencies in the conda environment
| Name | Required | Description | Default |
|---|---|---|---|
| packages | Yes | List of packages to install |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('install') but doesn't reveal critical traits such as whether this requires admin permissions, if it's idempotent, potential side effects on the environment, or error handling. This leaves significant gaps for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose, making it easy to parse quickly, which is ideal for conciseness in tool descriptions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that performs installation (a mutation operation) with no annotations and no output schema, the description is inadequate. It lacks details on behavior, error cases, or what success looks like, leaving the agent under-informed about how to use it effectively in context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the 'packages' parameter fully documented in the schema. The description doesn't add any meaning beyond what the schema provides (e.g., package format examples or installation options), so it meets the baseline for high schema coverage without extra value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('install') and target ('Python dependencies in the conda environment'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from sibling tools like 'check_installed_packages' or 'configure_environment', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'check_installed_packages' for verification or 'configure_environment' for setup. There's no mention of prerequisites, typical use cases, or exclusions, leaving the agent with minimal contextual direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_code_fileA
Read the content of an existing Python code file. Use this to verify the current state of a file before appending more content or executing it.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Full path to the file to read |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It correctly identifies this as a read operation and mentions the file must be 'existing,' but doesn't disclose error handling, file size limitations, encoding considerations, or what happens with non-existent files. The description provides basic behavioral context but lacks important operational details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of two well-structured sentences that efficiently convey purpose and usage guidelines. Every word serves a clear function, with no redundant information or unnecessary elaboration. It's appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simple single-parameter read operation with no output schema, the description provides adequate context about when to use it and what it does. However, without annotations or output schema, it could benefit from more detail about return format, error conditions, or performance characteristics for a more complete picture.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the single parameter 'file_path' clearly documented as 'Full path to the file to read.' The description doesn't add any additional parameter semantics beyond what the schema provides, so it meets the baseline expectation when schema coverage is complete.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Read the content') and target resource ('an existing Python code file'), distinguishing it from siblings like append_to_code_file or execute_code_file. It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use this tool ('to verify the current state of a file before appending more content or executing it'), providing clear context for its application. It distinguishes this read operation from potential write or execute operations performed by sibling tools, offering practical guidance on tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose with no ambiguity. For example, initialize_code_file, append_to_code_file, and read_code_file handle different file operations, while execute_code and execute_code_file target different execution methods. The descriptions explicitly differentiate tools like execute_code (for short snippets) versus the file-based workflow.
All tool names follow a consistent verb_noun pattern using snake_case, such as append_to_code_file, check_installed_packages, and configure_environment. There are no deviations in naming style or convention across the set, making them predictable and readable.
With 9 tools, the count is well-scoped for a code execution server. Each tool earns its place by covering distinct aspects like file management, environment configuration, dependency handling, and code execution, without being overly sparse or bloated.
The tool set provides complete coverage for the code execution domain, including CRUD-like operations for files (initialize, append, read), environment management (configure, get config, install dependencies), and execution (code snippets, files). There are no obvious gaps, and the workflow from file creation to execution is fully supported.
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Run Python code in a secure sandbox without local setup. Declare inline dependencies and execute s…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn interactive Python code execution environment that allows users and LLMs to safely execute Python code and install packages in isolated Docker containers.40Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to execute Python code in isolated sandboxes with file operations and MCP integration, supporting multi-round execution and plot capture.1
- FlicenseAqualityDmaintenanceEnables LLMs to interact with Python environments, execute code, manage files, and handle packages through the Model Context Protocol.9
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to execute Python code securely in a sandboxed environment. Supports configurable restrictions like no network access and returns results including files.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bazinga012/mcp_code_executor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server