MCP Code Mode
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_system_contextA | Get comprehensive system context before writing code. CALL THIS FIRST to understand:
Returns detailed system information formatted for code generation. |
| run_pythonA | Execute Python code to accomplish ANY task. This is a universal tool - write Python to do what you need:
Args: code: Python code to execute. Use print() for output. description: Brief task description (for logging) timeout: Max execution time in seconds auto_install: Auto-install missing packages Returns: Execution result with stdout, stderr, status, and any generated images Example: code = ''' import requests resp = requests.get("https://api.github.com/users/octocat") data = resp.json() print(f"User: {data['login']}") print(f"Repos: {data['public_repos']}") ''' |
| run_python_streamA | Execute Python code with REAL-TIME STREAMING OUTPUT. Perfect for long-running tasks where you want to see progress as it happens:
Output streams in real-time as the code executes, so you see results immediately instead of waiting for the entire execution to complete. Args: code: Python code to execute. Use print() liberally for progress updates. description: Brief task description (for logging) timeout: Max execution time in seconds auto_install: Auto-install missing packages Returns: Streaming output followed by execution summary, with any generated images Example: code = ''' import time for i in range(5): print(f"Processing item {i+1}/5...") time.sleep(1) print("✓ Done!") ''' The output will appear line-by-line as the code runs, not all at once at the end. |
| run_with_retryA | Execute Python code with intelligent retry and error analysis. On failure, this tool:
IMPORTANT: Use record_semantic_failure() if code runs successfully but doesn't accomplish the objective. This helps the system learn from non-error failures. Use this for more robust execution when errors are expected or when learning from previous similar tasks. Args: code: Python code to execute description: Task description (helps find relevant semantic learnings) max_retries: Max retry attempts (same code) timeout: Execution timeout in seconds Returns: Detailed execution result with retry info and suggestions from both error and semantic learnings |
| add_learningA | Record a learning from a code execution for future reference. When you figure out how to fix an error, record it here. Future executions will suggest this solution for similar errors. Args: error_pattern: Text/regex that matches the error message solution: What fixed the problem context: When this solution applies tags: Comma-separated tags (e.g., "network,ssl,https") Example: add_learning( error_pattern="SSL: CERTIFICATE_VERIFY_FAILED", solution="Add verify=False to requests.get() or install certifi", context="HTTPS requests on systems with certificate issues", tags="ssl,https,certificates" ) Returns: Confirmation message |
| record_semantic_failureA | Record a semantic failure: when code executed successfully but didn't accomplish the goal. This is different from error-based learning. Use this when:
Args: objective: What you were trying to accomplish failed_approach: What you tried that didn't work (even though it ran) successful_approach: What actually worked to accomplish the objective context: Why the first approach failed or additional context tags: Comma-separated tags (e.g., "api,authentication,retry") Example: record_semantic_failure( objective="Display image in Goose app", failed_approach="Used print() to output file path", successful_approach="Returned base64 encoded image as MCP content object", context="MCP clients need structured content objects, not just paths", tags="goose,mcp,display,images" ) Returns: Confirmation message |
| get_learningsA | View recorded learnings from past executions. Args: search: Optional search term to filter learnings Returns: Summary of learnings, optionally filtered |
| pip_installA | Pre-install a Python package. Use this to install packages before execution if you know you'll need them, or if auto-install missed something. Args: package_name: The pip package name to install Returns: Installation result |
| configureA | View or update Code Mode configuration. Args: action: "view" to see config, "set" to update a value key: Config key to update (for action="set") value: New value (for action="set") Available settings:
Examples: configure() # View current config configure(action="set", key="execution_mode", value="docker") configure(action="set", key="default_timeout", value="120") Returns: Current configuration or update confirmation |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| context_resource | System context as a resource |
| learnings_resource | All learnings as a resource |
| config_resource | Current configuration as a resource |
Latest Blog Posts
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/anaseqal/codemode'
If you have feedback or need assistance with the MCP directory API, please join our Discord server