Koskamo

Python Code Validator MCP

An official MCP server by StateMind that validates, repairs, and executes Python code in a sandboxed environment. It performs static analysis including linting, type checking, and security scans, and can automatically fix code to pass provided examples, ensuring AI-generated code correctness.

Endpoint and access

No sign-in to connect and list tools. Individual tools may still need a vendor account, credentials, or permissions; check the documented prerequisites.

Python Code Validator MCP logo, by StateMindVendor evidenceStreamable HTTPNo sign-inEndpoint checked 2026-11-23Operated by StateMind
You need:Needs an API key.
MCP endpoint (Streamable HTTP)
https://api.statemind.ai/mcp
Vendor documentation

What its tools do

3 tools, grouped by the hints the server advertises. Hints are self-declared, not verified behavior.

Can change data (1)

3 of 3 have a description · 3 of 3 declare behavior hints · 3 of 3 with parameters document them all

Checks and signals

Each line is separate evidence, not a trust score.

  • Passed Endpoint answered the live check ·
  • Passed Official MCP Registry namespace is tied to statemind.ai ·
  • Passed Endpoint is on the registry namespace domain ·
  • Uptime 100% over 90 days
  • Availability 2 of 2 checks passed in 30 days

About Python Code Validator MCP

The Python Code Validator MCP server, operated by StateMind, provides tools for validating, repairing, and executing Python code within a sandboxed environment. It supports static analysis tasks such as linting, type checking, and security scans. The server can also automatically fix code to ensure it passes provided examples, aiming to improve the correctness of AI-generated scripts.

This server is suitable for developers who need to verify Python syntax, scan for security vulnerabilities or exposed credentials, and repair code defects. It allows for the execution of code against specific test cases to ensure functionality. The tools available are execute_python, repair_python, and validate_python.

Connection to the server does not require a sign-in. However, individual tools may still require a vendor account, credentials, or specific permissions. An API key is required to use the service. Users should check the documented prerequisites for each tool to understand specific access constraints.

What you can do with it

  • Validate Python code syntax and linting
  • Run code in a sandbox against examples
  • Automatically repair code to fix defects
  • Scan for security vulnerabilities and credentials

Source and maintenance

Vendor evidenceRegistry 1.22.0MIT
Last repository push
Latest release
v1.22.0
Maintenance checked

Protocol and capabilities

Server
python-code-validator 1.29.0
MCP protocol negotiated in check
2025-06-18
Tools
3 advertised
Resources
Not advertised
Resource templates
Not advertised
Prompts
Not advertised
Server-advertised capabilities
{
  "tools": {}
}

Server-provided instructions

Untrusted server output shown for inspection. It is not Koskamo guidance and is excluded from knowledge search.

Proves AI-generated Python does what you asked: syntax, lint, types, an AST security policy and a credential scan, then runs the code in a throwaway container against the examples you state and repairs it until they pass — returning a fix only when running it satisfies every one of them. Send what the code was supposed to do in options.examples (assertions or doctest lines): it is the only check that can fail code which parses, lints, types and runs. Validate every edit; run execute_python once a function is finished and again only when its behaviour changed. Repeating a call within ten minutes is answered from the previous answer and costs nothing.

Tools

3 advertised

validate_python — Validate Python
Advertised by the server during the last successful anonymous check.
Advertised read-only

Check Python source without running it: parse, lint (ruff), type-check (mypy), AST security policy, credential scan. Safe on code you do not trust. Use it on every Python file you generated or edited, before writing it to disk. Alternatives: repair_python to get the corrected source instead of the diagnosis; execute_python to prove the code runs. Auth: a key is required. A free key covers this call, 25 per day, then HTTP 429; get one with POST /v1/keys. Credits are bought without an account, 1 per call: GET /v1/pricing says where to send the xDAI. Or pay for this one call with no key at all: call it without one and the result carries x402 payment requirements ($0.01 in USD Coin on eip155:8453); sign them and repeat the call with the payment in _meta['x402/payment']. Arguments: code: the whole file, 1..200000 bytes of UTF-8 measured after encoding (empty is refused with 400, larger with 413); a fragment is fine, but line and column numbers in the answer count from 1 in what you sent. language: must be 'python'; anything else is 400, and the field may be omitted. Of options only transpile_to (e.g. 'javascript', which returns a translated copy in transpiled) acts here; timeout_s, max_iterations, optimize, examples and expected_output need a pass that rewrites or runs the code, so send code alone. Ignored options are not refused, so a call that sets them looks like it worked; and code that does not parse is answered rather than refused: valid=false with the syntax error located, which is the point. Returns valid, score 0..1, diagnostics (rule, message, line, column), security findings, fixes, fixed_code and runtime; see outputSchema. The code and its verdict are retained to improve the service.

validate_python input schema
{
  "type": "object",
  "$defs": {
    "Mode": {
      "enum": [
        "static",
        "repair",
        "execute"
      ],
      "type": "string",
      "title": "Mode",
      "description": "How much work the service is allowed to do.\n\n``static``\n    Never executes the submitted code. Parsing, linting and security\n    scanning only. This is the default and the only mode that is safe to\n    expose without a container sandbox.\n``repair``\n    Static mode plus deterministic auto-fixes and refactors.\n``execute``\n    Repair plus running the code inside a sandbox to prove it works."
    },
    "Options": {
      "type": "object",
      "title": "Options",
      "properties": {
        "examples": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Examples",
          "default": null,
          "description": "What the code is supposed to do, as doctest lines ('>>> f(2)' on one line, '4' on the next) or as plain assertions ('assert f(2) == 4'). In execute mode they are run in the sandbox: an example that does not hold is a 'python:example-mismatch' error and makes the response invalid, and repair searches for a single-token change that makes every one of them pass. This is the only way the service can tell code that runs from code that is right, so send it whenever you know what you asked for. Examples already written in the code ('>>> ' in any string) are used the same way without this option. Ignored in the other modes, which run nothing."
        },
        "optimize": {
          "type": "boolean",
          "title": "Optimize",
          "default": false,
          "description": "Run constant folding / dead-code elimination. Off by default: the optimiser rewrites the program, and a rewrite is only returned when it provably keeps every effectful construct."
        },
        "timeout_s": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 60,
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Timeout S",
          "default": null,
          "description": "Wall-clock budget for running the code. Omitted means the service's own default (MSVC_DEFAULT_TIMEOUT_S). Only execute mode runs anything; a deployment may cap this below the 60 the schema allows and refuses a larger value."
        },
        "transpile_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Transpile To",
          "default": null,
          "description": "Target language for a transpiled copy, e.g. 'javascript'. The copy is made from the code as it ends up, so in repair and execute mode it translates the repaired source rather than the submitted one."
        },
        "max_iterations": {
          "type": "integer",
          "title": "Max Iterations",
          "default": 3,
          "maximum": 10,
          "minimum": 1,
          "description": "How many fix/verify rounds the repair loop may take. Ignored in static mode, which changes nothing."
        },
        "expected_output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Output",
          "default": null,
          "description": "Exact stdout the code must produce in execute mode. A mismatch is an 'expected-output' diagnostic and makes the response invalid, even when the program exits cleanly. Ignored in the other modes, which produce no output."
        }
      },
      "description": "Per-request tuning knobs."
    },
    "Language": {
      "enum": [
        "python",
        "javascript",
        "typescript",
        "html",
        "sql",
        "solidity",
        "other"
      ],
      "type": "string",
      "title": "Language",
      "description": "Source languages a validator can accept."
    }
  },
  "title": "ValidateRequest",
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "title": "Code",
      "maxLength": 200000,
      "minLength": 1,
      "description": "The source to check, as a whole file where possible: diagnostics carry the line and column of the text you send, and a fragment hides the imports and definitions the type check needs. A deployment may accept fewer bytes than the 200000 here."
    },
    "options": {
      "$ref": "#/$defs/Options",
      "description": "Tuning knobs. Most of them only take effect in the mode that does the corresponding work; see each field."
    },
    "language": {
      "$ref": "#/$defs/Language",
      "default": "python",
      "description": "The language of the code. A service that does not handle it refuses the request rather than guessing; the enum is shared across services, so it lists more than any one of them accepts."
    }
  },
  "description": "A validation job submitted by an agent."
}
validate_python output schema
{
  "type": "object",
  "$defs": {
    "Meta": {
      "type": "object",
      "title": "Meta",
      "required": [
        "service",
        "version"
      ],
      "properties": {
        "ai": {
          "anyOf": [
            {
              "$ref": "#/$defs/AIReport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "api": {
          "type": "string",
          "title": "Api",
          "default": "v1"
        },
        "mode": {
          "$ref": "#/$defs/Mode",
          "default": "static"
        },
        "engine": {
          "type": "object",
          "title": "Engine",
          "additionalProperties": {
            "type": "string"
          }
        },
        "service": {
          "type": "string",
          "title": "Service"
        },
        "version": {
          "type": "string",
          "title": "Version"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Request Id",
          "default": null
        },
        "duration_ms": {
          "type": "integer",
          "title": "Duration Ms",
          "default": 0
        }
      },
      "description": "Provenance of a response, so results stay reproducible."
    },
    "Mode": {
      "enum": [
        "static",
        "repair",
        "execute"
      ],
      "type": "string",
      "title": "Mode",
      "description": "How much work the service is allowed to do.\n\n``static``\n    Never executes the submitted code. Parsing, linting and security\n    scanning only. This is the default and the only mode that is safe to\n    expose without a container sandbox.\n``repair``\n    Static mode plus deterministic auto-fixes and refactors.\n``execute``\n    Repair plus running the code inside a sandbox to prove it works."
    },
    "AIReport": {
      "type": "object",
      "title": "AIReport",
      "properties": {
        "calls": {
          "type": "integer",
          "title": "Calls",
          "default": 0
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail",
          "default": null
        },
        "backend": {
          "type": "string",
          "title": "Backend",
          "default": ""
        },
        "outcome": {
          "type": "string",
          "title": "Outcome",
          "default": "not-consulted"
        },
        "consulted": {
          "type": "boolean",
          "title": "Consulted",
          "default": false
        },
        "duration_ms": {
          "type": "integer",
          "title": "Duration Ms",
          "default": 0
        }
      },
      "description": "What the optional AI refinement backend contributed.\n\nAbsent from a response when no backend is configured. Present but with\n``consulted=False`` when the deterministic fixers settled the code on their\nown, so a caller can tell \"the model was never needed\" apart from \"the\nmodel was asked and came back empty-handed\"."
    },
    "Severity": {
      "enum": [
        "error",
        "warning",
        "info"
      ],
      "type": "string",
      "title": "Severity",
      "description": "Severity of a single finding."
    },
    "Diagnostic": {
      "type": "object",
      "title": "Diagnostic",
      "required": [
        "severity",
        "rule",
        "message"
      ],
      "properties": {
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "default": null
        },
        "rule": {
          "type": "string",
          "title": "Rule"
        },
        "column": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Column",
          "default": null
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        }
      },
      "description": "A correctness problem found in the code."
    },
    "RuntimeReport": {
      "type": "object",
      "title": "RuntimeReport",
      "properties": {
        "ran": {
          "type": "boolean",
          "title": "Ran",
          "default": false
        },
        "stderr": {
          "type": "string",
          "title": "Stderr",
          "default": ""
        },
        "stdout": {
          "type": "string",
          "title": "Stdout",
          "default": ""
        },
        "sandbox": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sandbox",
          "default": null
        },
        "timed_out": {
          "type": "boolean",
          "title": "Timed Out",
          "default": false
        },
        "returncode": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Returncode",
          "default": null
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms",
          "default": null
        }
      },
      "description": "Outcome of executing the code in a sandbox."
    },
    "SecurityFinding": {
      "type": "object",
      "title": "SecurityFinding",
      "required": [
        "tool",
        "id",
        "severity",
        "message"
      ],
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "cwe": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cwe",
          "default": null
        },
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "default": null
        },
        "tool": {
          "type": "string",
          "title": "Tool"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        },
        "confidence": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence",
          "default": null
        }
      },
      "description": "A security problem reported by one of the scanners."
    }
  },
  "title": "ValidateResponse",
  "required": [
    "valid",
    "score",
    "meta"
  ],
  "properties": {
    "meta": {
      "$ref": "#/$defs/Meta"
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "title": "Fixes"
    },
    "score": {
      "type": "number",
      "title": "Score",
      "maximum": 1,
      "minimum": 0
    },
    "valid": {
      "type": "boolean",
      "title": "Valid"
    },
    "runtime": {
      "$ref": "#/$defs/RuntimeReport"
    },
    "security": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SecurityFinding"
      },
      "title": "Security"
    },
    "fixed_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fixed Code",
      "default": null
    },
    "transpiled": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Transpiled",
      "default": null
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Diagnostic"
      },
      "title": "Diagnostics"
    }
  },
  "description": "The result an agent gets back and pays for."
}
validate_python annotations
{
  "title": "Validate Python",
  "readOnlyHint": true,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}
repair_python — Repair Python
Advertised by the server during the last successful anonymous check.
Advertised read-only

Everything validation does, plus deterministic fixes: the corrected source comes back in fixed_code, and the original is kept whenever the fix cannot be proven safe. The code is still never run. Use it when validation failed and you want the fix rather than the diagnosis. Alternatives: validate_python when the diagnosis is enough; execute_python when the fix has to be proven to run. Auth: a key is required. This call needs a paid key and answers HTTP 402 without one. Credits are bought without an account, 3 per call: GET /v1/pricing says where to send the xDAI. Or pay for this one call with no key at all: call it without one and the result carries x402 payment requirements ($0.03 in USD Coin on eip155:8453); sign them and repeat the call with the payment in _meta['x402/payment']. Arguments: code: the whole file, 1..200000 bytes of UTF-8 measured after encoding (empty is refused with 400, larger with 413); a fragment is fine, but line and column numbers in the answer count from 1 in what you sent. language: must be 'python'; anything else is 400, and the field may be omitted. options.max_iterations (1..10, default 3) caps the fix/verify rounds: raise it for a file with several independent faults, leave it for a snippet. options.optimize (default false) additionally folds constants and drops dead code, and is only worth setting when you asked for a rewrite anyway. options.transpile_to (e.g. 'javascript') returns a translation of the *repaired* source in transpiled, not of what you sent. fixed_code is null when nothing could be proven safe to change, so treat null as 'no fix', not as an error. options.timeout_s, options.examples and options.expected_output do nothing here: nothing is run, so there is no clock, no stdout, and no way to check an example. Returns valid, score 0..1, diagnostics (rule, message, line, column), security findings, fixes, fixed_code and runtime; see outputSchema. The code and its verdict are retained to improve the service.

repair_python input schema
{
  "type": "object",
  "$defs": {
    "Mode": {
      "enum": [
        "static",
        "repair",
        "execute"
      ],
      "type": "string",
      "title": "Mode",
      "description": "How much work the service is allowed to do.\n\n``static``\n    Never executes the submitted code. Parsing, linting and security\n    scanning only. This is the default and the only mode that is safe to\n    expose without a container sandbox.\n``repair``\n    Static mode plus deterministic auto-fixes and refactors.\n``execute``\n    Repair plus running the code inside a sandbox to prove it works."
    },
    "Options": {
      "type": "object",
      "title": "Options",
      "properties": {
        "examples": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Examples",
          "default": null,
          "description": "What the code is supposed to do, as doctest lines ('>>> f(2)' on one line, '4' on the next) or as plain assertions ('assert f(2) == 4'). In execute mode they are run in the sandbox: an example that does not hold is a 'python:example-mismatch' error and makes the response invalid, and repair searches for a single-token change that makes every one of them pass. This is the only way the service can tell code that runs from code that is right, so send it whenever you know what you asked for. Examples already written in the code ('>>> ' in any string) are used the same way without this option. Ignored in the other modes, which run nothing."
        },
        "optimize": {
          "type": "boolean",
          "title": "Optimize",
          "default": false,
          "description": "Run constant folding / dead-code elimination. Off by default: the optimiser rewrites the program, and a rewrite is only returned when it provably keeps every effectful construct."
        },
        "timeout_s": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 60,
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Timeout S",
          "default": null,
          "description": "Wall-clock budget for running the code. Omitted means the service's own default (MSVC_DEFAULT_TIMEOUT_S). Only execute mode runs anything; a deployment may cap this below the 60 the schema allows and refuses a larger value."
        },
        "transpile_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Transpile To",
          "default": null,
          "description": "Target language for a transpiled copy, e.g. 'javascript'. The copy is made from the code as it ends up, so in repair and execute mode it translates the repaired source rather than the submitted one."
        },
        "max_iterations": {
          "type": "integer",
          "title": "Max Iterations",
          "default": 3,
          "maximum": 10,
          "minimum": 1,
          "description": "How many fix/verify rounds the repair loop may take. Ignored in static mode, which changes nothing."
        },
        "expected_output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Output",
          "default": null,
          "description": "Exact stdout the code must produce in execute mode. A mismatch is an 'expected-output' diagnostic and makes the response invalid, even when the program exits cleanly. Ignored in the other modes, which produce no output."
        }
      },
      "description": "Per-request tuning knobs."
    },
    "Language": {
      "enum": [
        "python",
        "javascript",
        "typescript",
        "html",
        "sql",
        "solidity",
        "other"
      ],
      "type": "string",
      "title": "Language",
      "description": "Source languages a validator can accept."
    }
  },
  "title": "ValidateRequest",
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "title": "Code",
      "maxLength": 200000,
      "minLength": 1,
      "description": "The source to check, as a whole file where possible: diagnostics carry the line and column of the text you send, and a fragment hides the imports and definitions the type check needs. A deployment may accept fewer bytes than the 200000 here."
    },
    "options": {
      "$ref": "#/$defs/Options",
      "description": "Tuning knobs. Most of them only take effect in the mode that does the corresponding work; see each field."
    },
    "language": {
      "$ref": "#/$defs/Language",
      "default": "python",
      "description": "The language of the code. A service that does not handle it refuses the request rather than guessing; the enum is shared across services, so it lists more than any one of them accepts."
    }
  },
  "description": "A validation job submitted by an agent."
}
repair_python output schema
{
  "type": "object",
  "$defs": {
    "Meta": {
      "type": "object",
      "title": "Meta",
      "required": [
        "service",
        "version"
      ],
      "properties": {
        "ai": {
          "anyOf": [
            {
              "$ref": "#/$defs/AIReport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "api": {
          "type": "string",
          "title": "Api",
          "default": "v1"
        },
        "mode": {
          "$ref": "#/$defs/Mode",
          "default": "static"
        },
        "engine": {
          "type": "object",
          "title": "Engine",
          "additionalProperties": {
            "type": "string"
          }
        },
        "service": {
          "type": "string",
          "title": "Service"
        },
        "version": {
          "type": "string",
          "title": "Version"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Request Id",
          "default": null
        },
        "duration_ms": {
          "type": "integer",
          "title": "Duration Ms",
          "default": 0
        }
      },
      "description": "Provenance of a response, so results stay reproducible."
    },
    "Mode": {
      "enum": [
        "static",
        "repair",
        "execute"
      ],
      "type": "string",
      "title": "Mode",
      "description": "How much work the service is allowed to do.\n\n``static``\n    Never executes the submitted code. Parsing, linting and security\n    scanning only. This is the default and the only mode that is safe to\n    expose without a container sandbox.\n``repair``\n    Static mode plus deterministic auto-fixes and refactors.\n``execute``\n    Repair plus running the code inside a sandbox to prove it works."
    },
    "AIReport": {
      "type": "object",
      "title": "AIReport",
      "properties": {
        "calls": {
          "type": "integer",
          "title": "Calls",
          "default": 0
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail",
          "default": null
        },
        "backend": {
          "type": "string",
          "title": "Backend",
          "default": ""
        },
        "outcome": {
          "type": "string",
          "title": "Outcome",
          "default": "not-consulted"
        },
        "consulted": {
          "type": "boolean",
          "title": "Consulted",
          "default": false
        },
        "duration_ms": {
          "type": "integer",
          "title": "Duration Ms",
          "default": 0
        }
      },
      "description": "What the optional AI refinement backend contributed.\n\nAbsent from a response when no backend is configured. Present but with\n``consulted=False`` when the deterministic fixers settled the code on their\nown, so a caller can tell \"the model was never needed\" apart from \"the\nmodel was asked and came back empty-handed\"."
    },
    "Severity": {
      "enum": [
        "error",
        "warning",
        "info"
      ],
      "type": "string",
      "title": "Severity",
      "description": "Severity of a single finding."
    },
    "Diagnostic": {
      "type": "object",
      "title": "Diagnostic",
      "required": [
        "severity",
        "rule",
        "message"
      ],
      "properties": {
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "default": null
        },
        "rule": {
          "type": "string",
          "title": "Rule"
        },
        "column": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Column",
          "default": null
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        }
      },
      "description": "A correctness problem found in the code."
    },
    "RuntimeReport": {
      "type": "object",
      "title": "RuntimeReport",
      "properties": {
        "ran": {
          "type": "boolean",
          "title": "Ran",
          "default": false
        },
        "stderr": {
          "type": "string",
          "title": "Stderr",
          "default": ""
        },
        "stdout": {
          "type": "string",
          "title": "Stdout",
          "default": ""
        },
        "sandbox": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sandbox",
          "default": null
        },
        "timed_out": {
          "type": "boolean",
          "title": "Timed Out",
          "default": false
        },
        "returncode": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Returncode",
          "default": null
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms",
          "default": null
        }
      },
      "description": "Outcome of executing the code in a sandbox."
    },
    "SecurityFinding": {
      "type": "object",
      "title": "SecurityFinding",
      "required": [
        "tool",
        "id",
        "severity",
        "message"
      ],
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "cwe": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cwe",
          "default": null
        },
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "default": null
        },
        "tool": {
          "type": "string",
          "title": "Tool"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        },
        "confidence": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence",
          "default": null
        }
      },
      "description": "A security problem reported by one of the scanners."
    }
  },
  "title": "ValidateResponse",
  "required": [
    "valid",
    "score",
    "meta"
  ],
  "properties": {
    "meta": {
      "$ref": "#/$defs/Meta"
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "title": "Fixes"
    },
    "score": {
      "type": "number",
      "title": "Score",
      "maximum": 1,
      "minimum": 0
    },
    "valid": {
      "type": "boolean",
      "title": "Valid"
    },
    "runtime": {
      "$ref": "#/$defs/RuntimeReport"
    },
    "security": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SecurityFinding"
      },
      "title": "Security"
    },
    "fixed_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fixed Code",
      "default": null
    },
    "transpiled": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Transpiled",
      "default": null
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Diagnostic"
      },
      "title": "Diagnostics"
    }
  },
  "description": "The result an agent gets back and pays for."
}
repair_python annotations
{
  "title": "Repair Python",
  "readOnlyHint": true,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}
execute_python — Execute Python
Advertised by the server during the last successful anonymous check.

Everything repair does, and then RUNS the code in a throwaway container — no network, read-only filesystem, killed at options.timeout_s — reporting exit code, stdout and stderr. Any '>>>' examples in the code are run too, and one that does not print what it says is an error the other tools cannot see. This is a side effect: do not submit code you do not want executed. Use it when you need proof that the code runs, or that it does what it says. Alternatives: validate_python for the diagnosis and repair_python for the fix, neither of which runs anything. Auth: a key is required. This call needs a paid key and answers HTTP 402 without one. Credits are bought without an account, 10 per call: GET /v1/pricing says where to send the xDAI. Or pay for this one call with no key at all: call it without one and the result carries x402 payment requirements ($0.1 in USD Coin on eip155:8453); sign them and repeat the call with the payment in _meta['x402/payment']. Arguments: code: the whole file, 1..200000 bytes of UTF-8 measured after encoding (empty is refused with 400, larger with 413); a fragment is fine, but line and column numbers in the answer count from 1 in what you sent. language: must be 'python'; anything else is 400, and the field may be omitted. options.max_iterations (1..10, default 3) caps the fix/verify rounds: raise it for a file with several independent faults, leave it for a snippet. options.optimize (default false) additionally folds constants and drops dead code, and is only worth setting when you asked for a rewrite anyway. options.transpile_to (e.g. 'javascript') returns a translation of the *repaired* source in transpiled, not of what you sent. fixed_code is null when nothing could be proven safe to change, so treat null as 'no fix', not as an error. options.timeout_s (seconds, default 5) is the wall clock for the run; the schema allows up to 60 but this deployment caps it at 30 and refuses a larger value with 400. options.expected_output compares stdout byte for byte and adds an 'expected-output' diagnostic (valid=false) when it differs, which is how you ask for 'it did the right thing' rather than 'it ran'. options.examples is the same question for code with no output: pass what you asked for as doctest lines ('>>> total([1, 2])' then '3') or assertions ('assert total([1, 2]) == 3'), and each is run against the code -- one that does not hold is a 'python:example-mismatch' error, and repair looks for a single-token change that makes them all pass. Send it whenever you know what you asked for: without it, code that runs but returns the wrong answer looks perfect from here. The program that runs is the repaired one, so read fixed_code before you trust runtime.stdout, and it runs exactly once however many rounds the repair took. Returns valid, score 0..1, diagnostics (rule, message, line, column), security findings, fixes, fixed_code and runtime; see outputSchema. The code and its verdict are retained to improve the service.

execute_python input schema
{
  "type": "object",
  "$defs": {
    "Mode": {
      "enum": [
        "static",
        "repair",
        "execute"
      ],
      "type": "string",
      "title": "Mode",
      "description": "How much work the service is allowed to do.\n\n``static``\n    Never executes the submitted code. Parsing, linting and security\n    scanning only. This is the default and the only mode that is safe to\n    expose without a container sandbox.\n``repair``\n    Static mode plus deterministic auto-fixes and refactors.\n``execute``\n    Repair plus running the code inside a sandbox to prove it works."
    },
    "Options": {
      "type": "object",
      "title": "Options",
      "properties": {
        "examples": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Examples",
          "default": null,
          "description": "What the code is supposed to do, as doctest lines ('>>> f(2)' on one line, '4' on the next) or as plain assertions ('assert f(2) == 4'). In execute mode they are run in the sandbox: an example that does not hold is a 'python:example-mismatch' error and makes the response invalid, and repair searches for a single-token change that makes every one of them pass. This is the only way the service can tell code that runs from code that is right, so send it whenever you know what you asked for. Examples already written in the code ('>>> ' in any string) are used the same way without this option. Ignored in the other modes, which run nothing."
        },
        "optimize": {
          "type": "boolean",
          "title": "Optimize",
          "default": false,
          "description": "Run constant folding / dead-code elimination. Off by default: the optimiser rewrites the program, and a rewrite is only returned when it provably keeps every effectful construct."
        },
        "timeout_s": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 60,
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Timeout S",
          "default": null,
          "description": "Wall-clock budget for running the code. Omitted means the service's own default (MSVC_DEFAULT_TIMEOUT_S). Only execute mode runs anything; a deployment may cap this below the 60 the schema allows and refuses a larger value."
        },
        "transpile_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Transpile To",
          "default": null,
          "description": "Target language for a transpiled copy, e.g. 'javascript'. The copy is made from the code as it ends up, so in repair and execute mode it translates the repaired source rather than the submitted one."
        },
        "max_iterations": {
          "type": "integer",
          "title": "Max Iterations",
          "default": 3,
          "maximum": 10,
          "minimum": 1,
          "description": "How many fix/verify rounds the repair loop may take. Ignored in static mode, which changes nothing."
        },
        "expected_output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Output",
          "default": null,
          "description": "Exact stdout the code must produce in execute mode. A mismatch is an 'expected-output' diagnostic and makes the response invalid, even when the program exits cleanly. Ignored in the other modes, which produce no output."
        }
      },
      "description": "Per-request tuning knobs."
    },
    "Language": {
      "enum": [
        "python",
        "javascript",
        "typescript",
        "html",
        "sql",
        "solidity",
        "other"
      ],
      "type": "string",
      "title": "Language",
      "description": "Source languages a validator can accept."
    }
  },
  "title": "ValidateRequest",
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "title": "Code",
      "maxLength": 200000,
      "minLength": 1,
      "description": "The source to check, as a whole file where possible: diagnostics carry the line and column of the text you send, and a fragment hides the imports and definitions the type check needs. A deployment may accept fewer bytes than the 200000 here."
    },
    "options": {
      "$ref": "#/$defs/Options",
      "description": "Tuning knobs. Most of them only take effect in the mode that does the corresponding work; see each field."
    },
    "language": {
      "$ref": "#/$defs/Language",
      "default": "python",
      "description": "The language of the code. A service that does not handle it refuses the request rather than guessing; the enum is shared across services, so it lists more than any one of them accepts."
    }
  },
  "description": "A validation job submitted by an agent."
}
execute_python output schema
{
  "type": "object",
  "$defs": {
    "Meta": {
      "type": "object",
      "title": "Meta",
      "required": [
        "service",
        "version"
      ],
      "properties": {
        "ai": {
          "anyOf": [
            {
              "$ref": "#/$defs/AIReport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "api": {
          "type": "string",
          "title": "Api",
          "default": "v1"
        },
        "mode": {
          "$ref": "#/$defs/Mode",
          "default": "static"
        },
        "engine": {
          "type": "object",
          "title": "Engine",
          "additionalProperties": {
            "type": "string"
          }
        },
        "service": {
          "type": "string",
          "title": "Service"
        },
        "version": {
          "type": "string",
          "title": "Version"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Request Id",
          "default": null
        },
        "duration_ms": {
          "type": "integer",
          "title": "Duration Ms",
          "default": 0
        }
      },
      "description": "Provenance of a response, so results stay reproducible."
    },
    "Mode": {
      "enum": [
        "static",
        "repair",
        "execute"
      ],
      "type": "string",
      "title": "Mode",
      "description": "How much work the service is allowed to do.\n\n``static``\n    Never executes the submitted code. Parsing, linting and security\n    scanning only. This is the default and the only mode that is safe to\n    expose without a container sandbox.\n``repair``\n    Static mode plus deterministic auto-fixes and refactors.\n``execute``\n    Repair plus running the code inside a sandbox to prove it works."
    },
    "AIReport": {
      "type": "object",
      "title": "AIReport",
      "properties": {
        "calls": {
          "type": "integer",
          "title": "Calls",
          "default": 0
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail",
          "default": null
        },
        "backend": {
          "type": "string",
          "title": "Backend",
          "default": ""
        },
        "outcome": {
          "type": "string",
          "title": "Outcome",
          "default": "not-consulted"
        },
        "consulted": {
          "type": "boolean",
          "title": "Consulted",
          "default": false
        },
        "duration_ms": {
          "type": "integer",
          "title": "Duration Ms",
          "default": 0
        }
      },
      "description": "What the optional AI refinement backend contributed.\n\nAbsent from a response when no backend is configured. Present but with\n``consulted=False`` when the deterministic fixers settled the code on their\nown, so a caller can tell \"the model was never needed\" apart from \"the\nmodel was asked and came back empty-handed\"."
    },
    "Severity": {
      "enum": [
        "error",
        "warning",
        "info"
      ],
      "type": "string",
      "title": "Severity",
      "description": "Severity of a single finding."
    },
    "Diagnostic": {
      "type": "object",
      "title": "Diagnostic",
      "required": [
        "severity",
        "rule",
        "message"
      ],
      "properties": {
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "default": null
        },
        "rule": {
          "type": "string",
          "title": "Rule"
        },
        "column": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Column",
          "default": null
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        }
      },
      "description": "A correctness problem found in the code."
    },
    "RuntimeReport": {
      "type": "object",
      "title": "RuntimeReport",
      "properties": {
        "ran": {
          "type": "boolean",
          "title": "Ran",
          "default": false
        },
        "stderr": {
          "type": "string",
          "title": "Stderr",
          "default": ""
        },
        "stdout": {
          "type": "string",
          "title": "Stdout",
          "default": ""
        },
        "sandbox": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sandbox",
          "default": null
        },
        "timed_out": {
          "type": "boolean",
          "title": "Timed Out",
          "default": false
        },
        "returncode": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Returncode",
          "default": null
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms",
          "default": null
        }
      },
      "description": "Outcome of executing the code in a sandbox."
    },
    "SecurityFinding": {
      "type": "object",
      "title": "SecurityFinding",
      "required": [
        "tool",
        "id",
        "severity",
        "message"
      ],
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "cwe": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cwe",
          "default": null
        },
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "default": null
        },
        "tool": {
          "type": "string",
          "title": "Tool"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        },
        "confidence": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence",
          "default": null
        }
      },
      "description": "A security problem reported by one of the scanners."
    }
  },
  "title": "ValidateResponse",
  "required": [
    "valid",
    "score",
    "meta"
  ],
  "properties": {
    "meta": {
      "$ref": "#/$defs/Meta"
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "title": "Fixes"
    },
    "score": {
      "type": "number",
      "title": "Score",
      "maximum": 1,
      "minimum": 0
    },
    "valid": {
      "type": "boolean",
      "title": "Valid"
    },
    "runtime": {
      "$ref": "#/$defs/RuntimeReport"
    },
    "security": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SecurityFinding"
      },
      "title": "Security"
    },
    "fixed_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fixed Code",
      "default": null
    },
    "transpiled": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Transpiled",
      "default": null
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Diagnostic"
      },
      "title": "Diagnostics"
    }
  },
  "description": "The result an agent gets back and pays for."
}
execute_python annotations
{
  "title": "Execute Python",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}

Prompts

Not advertised

No prompt definitions available.

Resources

Not advertised

No resource definitions available.

90-day uptime

A lightweight connection check about every six hours, sampled on hosts with many listings. It shows the server answered, not that its tools work.

100% (79 of 79 checks answered)

  1. 2026-11-02: 3 of 3 checks answered
  2. 2026-11-03: 4 of 4 checks answered
  3. 2026-11-04: 4 of 4 checks answered
  4. 2026-11-05: 4 of 4 checks answered
  5. 2026-11-06: 4 of 4 checks answered
  6. 2026-11-07: 2 of 2 checks answered
  7. 2026-11-09: 1 of 1 checks answered
  8. 2026-11-10: 2 of 2 checks answered
  9. 2026-11-11: 1 of 1 checks answered
  10. 2026-11-12: 1 of 1 checks answered
  11. 2026-11-14: 1 of 1 checks answered
  12. 2026-11-15: 2 of 2 checks answered
  13. 2026-11-16: 4 of 4 checks answered
  14. 2026-11-17: 5 of 5 checks answered
  15. 2026-11-18: 5 of 5 checks answered
  16. 2026-11-19: 4 of 4 checks answered
  17. 2026-11-20: 3 of 3 checks answered
  18. 2026-11-21: 4 of 4 checks answered
  19. 2026-11-22: 4 of 4 checks answered
  20. 2026-11-23: 3 of 3 checks answered
  21. 2026-11-24: 4 of 4 checks answered
  22. 2026-11-25: 4 of 4 checks answered
  23. 2026-11-26: 4 of 4 checks answered
  24. 2026-11-27: 4 of 4 checks answered
  25. 2026-11-28: 2 of 2 checks answered

30-day availability

Aggregated from read-only remote checks; this is not a tool-execution or security guarantee.

Successful checks
2 of 2 (100%)
Average latency
1273 ms
95th percentile latency
1316 ms

Maintenance history

Public check and source-refresh events. Editorial and ownership records remain private.

  • · probe · passed · 1321 ms · 3 tool(s)
  • · probe · passed · 1225 ms · metadata changed · 3 tool(s)
  • · repository · passed · updated
  • · repository · passed · metadata changed · updated
  • · repository · passed · metadata changed · updated
  • · registry · passed · metadata changed · Source metadata updated
  • · backfill · recorded · Pre-expansion baseline; unobserved rich metadata remains unknown

Connect from your client

Each snippet registers the same endpoint; pick the client you use.

This server is operated by the named third party. Listing and endpoint checks are not an endorsement or a security audit. Review the operator's permissions, terms, and data handling before connecting. How listings are checked and corrected.

Claude Code

Run this once in a terminal. It registers the remote server. Use --scope project to write .mcp.json for the repo.
Claude Code configuration
claude mcp add --transport http python-code-validator-mcp https://api.statemind.ai/mcp

Codex

Run this once. Codex stores MCP servers in ~/.codex/config.toml (or .codex/config.toml in a trusted project).
Codex configuration
codex mcp add python-code-validator-mcp --url https://api.statemind.ai/mcp

Cursor

Merge this server into .cursor/mcp.json in your project, then enable python-code-validator-mcp in your MCP settings.
Cursor configuration
{
  "mcpServers": {
    "python-code-validator-mcp": {
      "url": "https://api.statemind.ai/mcp"
    }
  }
}

Cline

Merge this into cline_mcp_settings.json (Cline → MCP Servers → Configure).
Cline configuration
{
  "mcpServers": {
    "python-code-validator-mcp": {
      "type": "streamableHttp",
      "url": "https://api.statemind.ai/mcp",
      "disabled": false
    }
  }
}

VS Code

Merge this server into .vscode/mcp.json. Use MCP: List Servers to start python-code-validator-mcp and inspect its tools.
VS Code configuration
{
  "servers": {
    "python-code-validator-mcp": {
      "type": "http",
      "url": "https://api.statemind.ai/mcp"
    }
  }
}

Gemini CLI

Run this once. It writes .gemini/settings.json in the current project; pass --scope user for ~/.gemini/settings.json.
Gemini CLI configuration
gemini mcp add --transport http python-code-validator-mcp https://api.statemind.ai/mcp

Claude Desktop

Open Claude Settings > Connectors > Add custom connector, enter this server URL and enable it for the conversation. This is a manual remote-connector handoff, not a desktop JSON configuration.
Claude Desktop configuration
https://api.statemind.ai/mcp

Windsurf

Merge this into ~/.codeium/windsurf/mcp_config.json, then refresh MCP in Cascade. Windsurf remote servers use serverUrl, not url.
Windsurf configuration
{
  "mcpServers": {
    "python-code-validator-mcp": {
      "serverUrl": "https://api.statemind.ai/mcp"
    }
  }
}

Let your agent find its tools

Find servers like Python Code Validator MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.

Frequently asked questions

Can I use all tools without an account?
No. While connecting to the server requires no sign-in, individual tools may need a vendor account, credentials, or permissions. An API key is required. Check the documented prerequisites for each tool.
What tasks does this server support?
It supports validating Python code syntax and linting, scanning for security vulnerabilities and credentials, automatically repairing code to fix defects, and executing code in a sandbox against provided examples.
Does the server automatically fix code?
Yes. The repair_python tool can automatically fix code to pass provided examples, ensuring AI-generated code correctness. This helps in repairing code defects without manual intervention.

Do you run Python Code Validator MCP?

Prove ownership with a DNS record, a well-known file, or your Official MCP Registry entry, and your edits publish immediately. Proofs are re-checked weekly; admins can still hide or remove a listing.

Claim this listing