# PocketGrandmaster — The 4 KB Chess Engine

> A lightweight, 4KB dependency-free Python chess engine for move calculation, legal move generation, and mate detection.

PocketGrandmaster — The 4 KB Chess Engine is a paid AI agent skill on Agensi by Xue Cheng, in Game Development. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $19 (one-time purchase)
- Creator: [Xue Cheng](https://www.agensi.io/creators/xue-cheng)
- Category: [Game Development](https://www.agensi.io/skills/game-development)
- Version: 1.0
- Last updated: 2026-11-30
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/pocketgrandmaster-the-4-kb-chess-engine
- Tags: gaming, python, chess-engine, algorithms, chess, engine, uci, alpha-beta

## About this skill

A tiny, readable Python chess engine you can embed anywhere. Negamax alpha-beta search with quiescence, a transposition table, null-move pruning and killer-move ordering under a fixed 120,000-node budget. Give it a FEN and it returns a best move; also speaks a UCI subset (uci / isready / position / go / quit) and ships a self-checking demo that finds real mating moves. Honest strength: roughly 1250–1350 Elo — built for teaching, prototyping and embedding, not for beating grandmasters. Pure Python, no dependencies, no network calls.

## Requires

- Python

## Known limitations

1250-1350 Elo strength. No opening/endgame databases. UCI subset lacks time controls and pondering. No support for pawn structure or king-safety evaluation terms.

## 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 PocketGrandmaster — The 4 KB Chess Engine 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

### How does this skill differ from just asking an AI to suggest a chess move?

Unlike LLMs which often hallucinate illegal moves, Pocketgrandmaster uses a deterministic alpha-beta search algorithm to ensure every move is 100% legal and strategically sound according to standard chess rules.

### Are there any complex dependencies or system libraries I need to install to use this?

The skill is high-performance because it is dependency-free; it requires only Python 3.9+ and uses zero external libraries, making it compatible with almost any AI agent or environment that supports Python.

### What exactly is included in the purchase of the Pocketgrandmaster skill?

You receive the complete, single-file Python module (under 4KB) which includes the engine logic, move generator, and UCI-compatible interface, ready for immediate integration.

### What is the competitive strength of this engine compared to grandmaster-level software?

The engine plays at a casual club level (approximately 1250-1350 Elo), making it an ideal opponent for most human players or for validating puzzle logic in applications.

### Can I use this engine with an existing Chess GUI?

Yes, because it communicates using a subset of the standard Universal Chess Interface (UCI) protocol, you can easily hook it up to external chess GUIs or testing harnesses.

### What formats does the engine use for board positions and move outputs?

Pocketgrandmaster supports standard FEN (Forsyth-Edwards Notation) for input and UCI coordinate notation (e.g., 'e2e4') for output, ensuring compatibility with most chess data standards.

---

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.
