# Python Code Validator MCP server

> Validates, repairs, and executes Python code against user-provided assertions or doctests within a secure, network-isolated sandbox.

- Repository: https://github.com/jkanselaar/python-code-validator
- Page: https://hostedmcp.org/servers/jkanselaar/python-code-validator
- Transport: remote
- Stars: 0
- License: MIT
- Latest version: 1.22.0

## Install

### Claude Code

```sh
claude mcp add --transport http python-code-validator https://api.statemind.ai/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "python-code-validator": {
      "url": "https://api.statemind.ai/mcp"
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "python-code-validator": {
      "type": "http",
      "url": "https://api.statemind.ai/mcp"
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.python-code-validator]
url = "https://api.statemind.ai/mcp"
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "python-code-validator": {
      "httpUrl": "https://api.statemind.ai/mcp"
    }
  }
}
```

## FAQ

### How does the validator handle code that produces the wrong output?

The validator uses provided intent, such as assertions or doctest lines, to run the code in a sandbox; if the code fails these examples, it returns a mismatch error.

### Is there a way to use the service for free?

Yes, you can get a free key that allows for 25 static checks per day without needing an account.

### Does the service check for security vulnerabilities?

Yes, it includes an AST security policy that detects hidden calls behind dynamic imports and runtime attribute lookups, along with a bandit pass and credential scan.

### Can I avoid being charged for repeating the same validation request?

Yes, if you ask the same question twice within ten minutes, the service provides the first answer for free.
