# Tiny Chess - A Complete Chess Engine in 4 KB of Python

> A real chess engine in one 4 KB Python file: best move for any FEN, legal move lists, mate and stalemate detection. Deterministic, zero dependencies.

Tiny Chess - A Complete Chess Engine in 4 KB of Python is a paid AI agent skill on Agensi by muhammad zildan, in Game Development. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $3 (one-time purchase)
- Creator: [muhammad zildan](https://www.agensi.io/creators/mhmmdzildan03)
- Category: [Game Development](https://www.agensi.io/skills/game-development)
- Version: 1.0
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/tiny-chess-a-complete-chess-engine-in-4-kb-of-python
- Tags: game-development, education-learning

## About this skill

A complete chess engine that fits in 4 KB of Python - small enough to read in one sitting, strong enough to find mate in one.

Ask it for the best move in any position (FEN in, UCI move out), every legal move, or whether a position is checkmate or stalemate. Inside: negamax search with alpha-beta pruning, a Zobrist transposition table with bound flags, check extensions, capture quiescence, and MVV-LVA move ordering. It plays under a fixed 200,000-node budget instead of a clock, so it is fully deterministic - the same position always gets the same move.

Verified behaviour: exactly 20 legal moves from the starting position, finds the back-rank mate in one (a1a8) and Scholar's mate (h5f7).

Honest simplifications from the size budget, stated up front: no en passant, promotions are always to a queen, castling rights are honoured as given in the FEN.

Written from scratch for the make.fun tiny-chess bounty and strengthened through self-play testing (70% score against its own predecessor). Python 3.9+, standard library only.

## Requires

- Python 3.9+
- AI agent with shell access

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Tiny Chess - A Complete Chess Engine in 4 KB of Python skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does Tiny Chess - A Complete Chess Engine in 4 KB of Python do?

A real chess engine in one 4 KB Python file: best move for any FEN, legal move lists, mate and stalemate detection. Deterministic, zero dependencies.

### Which AI agents support Tiny Chess - A Complete Chess Engine in 4 KB of Python?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Tiny Chess - A Complete Chess Engine in 4 KB of Python?

Connect your AI agent to Agensi through MCP, then ask it to use Tiny Chess - A Complete Chess Engine in 4 KB of Python on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
