Вход

Проверяет сгенерированный код Python на соответствие требованиям: линтинг, типы, безопасность и запуск в песочнице. Инструменты предоставляют отчеты об ошибках, автоматические исправления и выполнение кода.

нужен ключ Удалённый · Streamable HTTP API-ключ Разработка ИИ и модели Безопасность Официальный реестр · 10 просмотров

Что умеет

Проверяет сгенерированный код Python на соответствие требованиям: линтинг, типы, безопасность и запуск в песочнице. Инструменты предоставляют отчеты об ошибках, автоматические исправления и выполнение кода.

Перевод каталога (LLM) · показать оригинал автора

Proves AI-generated Python does what you asked: lint, types, security, sandbox run, exact fixes.

Подключение

Удалённый сервер: клиент обращается по адресу, код на вашей машине не запускается.

Claude Desktop

claude_desktop_config.json

Cursor

~/.cursor/mcp.json

Windsurf

~/.codeium/windsurf/mcp_config.json

Вставьте блок mcpServers в файл конфигурации своего клиента. Ключи не входят в файл: вместо SET_LOCALLY подставьте свои значения.

{
    "mcpServers": {
        "ai-statemind-python-code-validator": {
            "url": "https://api.statemind.ai/mcp",
            "headers": {
                "Authorization": "Bearer SET_LOCALLY"
            }
        }
    }
}

Вызов без установки — через шлюз

Агент вызывает инструменты этого сервера через https://www.n2j.ru/mcphub/mcp: hub_call_tool {"server":"ai-statemind-python-code-validator","tool":"…","arguments":{…}} Сервер требует авторизации — ключ задаётся на стороне каталога.

https://api.statemind.ai/mcp

Инструменты

3 схем · ≈ 3 440 условных токенов

validate_python

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: c

Показать схему аргументов
{
    "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

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

Показать схему аргументов
{
    "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

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

Показать схему аргументов
{
    "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."
}