protogrid

Search / ai.statemind/python-code-validator

Python Code Validator

R1· needs a key

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

v1.22.0 · active · repository · descriptor JSON · versions

An agent can connect on its own if it already holds PYTHON_CODE_VALIDATOR_TOKEN.Remote endpoint behind a static API key or header. The registry never sees the value; the agent fills the placeholder.
Quality88good
Trust90of 100
Uptime, 30 days100%
Latency p50486 ms

Connect

8 clients · secrets stay placeholders
{
  "mcpServers": {
    "python-code-validator": {
      "type": "http",
      "url": "https://api.statemind.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${PYTHON_CODE_VALIDATOR_TOKEN}"
      }
    }
  }
}
claude mcp add --transport http python-code-validator https://api.statemind.ai/mcp --header "Authorization: Bearer ${PYTHON_CODE_VALIDATOR_TOKEN}"
[mcp_servers.python-code-validator]
url = "https://api.statemind.ai/mcp"
bearer_token_env_var = "PYTHON_CODE_VALIDATOR_TOKEN"
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "python-code-validator": {
      "type": "remote",
      "url": "https://api.statemind.ai/mcp",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer {env:PYTHON_CODE_VALIDATOR_TOKEN}"
      }
    }
  }
}
{
  "mcpServers": {
    "python-code-validator": {
      "type": "http",
      "url": "https://api.statemind.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${PYTHON_CODE_VALIDATOR_TOKEN}"
      }
    }
  },
  "deeplink": "cursor://anysphere.cursor-deeplink/mcp/install?name=python-code-validator&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vYXBpLnN0YXRlbWluZC5haS9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIgJHtQWVRIT05fQ09ERV9WQUxJREFUT1JfVE9LRU59In19"
}
{
  "servers": {
    "python-code-validator": {
      "type": "http",
      "url": "https://api.statemind.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${PYTHON_CODE_VALIDATOR_TOKEN}"
      }
    }
  }
}
{
  "mcpServers": {
    "python-code-validator": {
      "httpUrl": "https://api.statemind.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${PYTHON_CODE_VALIDATOR_TOKEN}"
      }
    }
  }
}
extensions:
  "python-code-validator":
    enabled: true
    name: "python-code-validator"
    type: streamable_http
    uri: "https://api.statemind.ai/mcp"
    headers:
      "Authorization": "Bearer ${PYTHON_CODE_VALIDATOR_TOKEN}"
    timeout: 300

Placeholders to fill from your own secret store: ${PYTHON_CODE_VALIDATOR_TOKEN}. The registry never accepts secret values.

Quality 88 / 100good

protocol75 · weight 25
  • warn
    protocol.modernnewest supported version is 2025-06-18; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
  • n/a
    protocol.statelessonly applies to 2026-07-28 servers
  • pass
    protocol.transportstreamable HTTP
  • n/a
    protocol.list_ttlonly applies to 2026-07-28 servers
authorizationn/a · weight 15
  • n/a
    auth.prm, auth.as_metadata, auth.cimdno remote uses OAuth
  • n/a
    auth.secret_in_urlno templated URL
tool hygiene93 · weight 30
  • pass
    tools.descriptionsevery tool has a description
  • warn
    tools.description_length3 tools have descriptions over 1,024 characters, which crowds the context
  • pass
    tools.schemasevery tool has an object input schema
  • pass
    tools.annotations3 of 3 tools declare readOnlyHint or destructiveHint
  • pass
    tools.directory_hintsevery tool declares readOnlyHint, destructiveHint, idempotentHint and openWorldHint
  • pass
    tools.token_costabout 4,705 tokens to load every tool
  • pass
    tools.api_dumptools are not a one-to-one API dump
stability100 · weight 15
  • pass
    stability.changesno tool changes in 30 days
  • pass
    stability.rug_pullno tool changed its meaning under the same name
dependenciesn/a · weight 15
  • n/a
    deps.known_vulns, deps.mcp_sdk_version, deps.resolvableno npm or PyPI package

3 tools, about 4,705 tokens to load them all · tool set ccadaf0317a1 · checked 2026-10-19 10:52 UTC

Tool changes

No tool definition changes recorded. A server's first observation is its baseline; later probes record what changes.

Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed. How it is computed.

Trust 90 / 100

provenance75
liveness100
freshness85
hygiene100

+repository +dns-namespace +reachable +uptime-100% ~updated-64d-ago

Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed. How it is computed.

Endpoints

remoteauthreachableuptime 30dp50protocollast ok
https://api.statemind.ai/mcp streamable-httpapi_key ${PYTHON_CODE_VALIDATOR_TOKEN}yes100%486 ms2025-06-182026-10-19

Tools (3)

execute_pythonEverything 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.
repair_pythonread-onlyEverything 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.
validate_pythonread-onlyCheck 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.

Schemas: list_tools.

Similar MCP servers

Official server.json
{
  "name": "ai.statemind/python-code-validator",
  "title": "Python Code Validator",
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "remotes": [
    {
      "url": "https://api.statemind.ai/mcp",
      "type": "streamable-http",
      "headers": [
        {
          "name": "Authorization",
          "isSecret": true,
          "isRequired": true,
          "description": "Bearer <key>. Get one for free, no account: curl -X POST https://api.statemind.ai/v1/keys"
        }
      ]
    }
  ],
  "version": "1.22.0",
  "repository": {
    "url": "https://github.com/jkanselaar/python-code-validator",
    "source": "github"
  },
  "description": "Proves AI-generated Python does what you asked: lint, types, security, sandbox run, exact fixes."
}