Jump to content

Universal Chess Interface

From Wikipedia, the free encyclopedia

The Universal Chess Interface (UCI) is an open communication protocol designed by Rudolf Huber and Stefan Meyer-Kahlen that enables chess engines to communicate with user interfaces.[1][2]

History

[edit]

The UCI protocol was released in November 2000. Designed by Rudolf Huber and Stefan Meyer-Kahlen, the author of Shredder. UCI rivals the older communication protocol XBoard/WinBoard.

In 2002, the chess software company Chessbase that markets Fritz, began to support UCI.

Design

[edit]

By design, UCI assigns some tasks to the user interface (i.e., presentation layer) which have traditionally been handled by the engine itself.[citation needed]

Stefan-Meyer Kahlen's UCI protocol in Shredder uses a variation of long algebraic notation for moves. A "nullmove" from an engine to a GUI should be sent as 0000.[3]

Examples

[edit]
  • e2e4 (white pawn push)
  • e7e5 (black pawn push)
  • e1g1 (white short castling)
  • e7e8q (for promotion)

In the case of Chess 960, castling moves are represented by the King capturing their own corresponding rook.[4]

Commands

[edit]

There are many commands used to communicate with an engine. [5]

UCI Commands List[5]
Command Usage Description Response
quit quit Closes the chess engine N/a
uci uci Tells the engine to switch to UCI mode uciok
ucinewgame ucinewgame Used to let the engine know that the next position it receives will be from a different game. N/a
isready isready Used to synchronize the engine. Use after sending a command that might take some time. readyok
setoption setoption name <id> [value <x>] Used to change the internal parameters of a chess engine. N/a
position position [fen <fenstring> | startpos ] moves <move1> .... <movei> Used to tell the engine to setup the provided position. N/a
go go [infinite | depth <depth> | nodes | mate] searchmoves <move1> .... <movei> ponder wtime <x> btime <x> winc <x> binc <x> movestogo <x> nodes <x> movetime <x> perft <x> Tells the engine to start calculation. bestmove <move> ponder <expected>
stop stop Tells the engine to halt calculation as soon as possible. N/a
ponderhit ponderhit Tells the engine that the player has played the expected move. N/a

Additional commands can be implemented per engine, the below commands are implemented by the Stockfish chess engine.[5]

Optional UCI Commands[5]
Command Usage Description Response
bench bench [ttSize] [threads] [limit] [fenFile] [limitType] Runs a benchmark test on the engine. Test data
speedtest speedtest [threads] [hash (MiB)] [runtime (s)] Measures the speed of the computer running the engine. Test data
d d Prints an ASCII representation of the board in the current state. ASCII Board
eval eval Displays the static evaluation of the board. Scaled Evaluation
compiler compiler Prints information about the engine's compiler. Compiler info
export_net export_net [filenameBigNet] [filenameSmallNet] Exports the currently loaded network into a file. N/a
flip flip Flips the side to move. N/a
help help In Stockfish, this command prints information about the chess engine and links to the Github. Help text.
license license Same as help command. Help text.

Features

[edit]

The uci_limitstrength parameter tells engines with this feature to play at a lower level. The uci_elo parameter specifies the Elo rating at which the engine will aim to play. Engines that have implemented uci_elo include Delfi, Fritz, Hiarcs, Houdini, Junior, Rybka, Shredder, Sjeng and Stockfish.

Variants

[edit]

The UCI has been modified to play some other games, and chess variants. Some of these are:[6]

  • Universal Shogi Interface (USI), a dialect for shogi;[7]
  • Universal Chinese Chess Interface (UCCI), a dialect for xiangqi.[8]

Each of these protocols may also define variants of Portable Game Notation (PGN) and Forsyth–Edwards Notation (FEN).

See also

[edit]

References

[edit]
  1. "Chess engines". Business World Online. 2017-04-06. Archived from the original on 2021-01-28. Retrieved 2018-06-14.
  2. Torres, JC (2014-06-23). "Lichess embraces blind players with new chess site features". SlashGear. Retrieved 2018-06-14.
  3. "UCI protocol". www.wbec-ridderkerk.nl. Retrieved 2018-06-14.
  4. Huber, Rudolf; Kahlen, Stefan-Meyer. "UCI Protocol". backscattering.de. Retrieved June 27, 2026.
  5. 1 2 3 4 "UCI & Commands | Stockfish Docs". Stockfish Documentation. 2025-11-23. Retrieved 2026-02-02.
  6. Evert. "UCI protocol for chess variants". TalkChess.com.
  7. "The Universal Shogi Interface (USI)". hgm.nubati.net.
  8. "中国象棋电脑应用规范(五):中国象棋通用引擎协议". www.xqbase.com.
[edit]