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.
History 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 By design, UCI assigns some tasks to the user interface (i.e., presentation layer) which have traditionally been handled by the engine itself.
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.
Examples 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.
Commands There are many commands used to communicate with an engine. +UCI Commands ListCommandUsageDescriptionResponsequitquitCloses the chess engineuciuciTells the engine to switch to UCI modeuciokucinewgameucinewgameUsed to let the engine know that the next position it receives will be from a different game.isreadyisreadyUsed to synchronize the engine. Use after sending a command that might take some time.readyoksetoptionsetoption name <id> [value <x>]Used to change the internal parameters of a chess engine.positionposition [fen <fenstring> | startpos ] moves <move1> .... <movei>Used to tell the engine to setup the provided position.gogo [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.stopstopTells the engine to halt calculation as soon as possible.ponderhitponderhitTells the engine that the player has played the expected move. Additional commands can be implemented per engine, the below commands are implemented by the Stockfish chess engine. +Optional UCI CommandsCommandUsageDescriptionResponsebenchRuns a benchmark test on the engine.Test dataspeedtestspeedtest [threads] [hash (MiB)] [runtime (s)]Measures the speed of the computer running the engine.Test dataddPrints an ASCII representation of the board in the current state.ASCII BoardevalevalDisplays the static evaluation of the board.Scaled EvaluationcompilercompilerPrints information about the engine's compiler.Compiler infoexport_netexport_net [filenameBigNet] [filenameSmallNet]Exports the currently loaded network into a file.flipflipFlips the side to move.helphelpIn Stockfish, this command prints information about the chess engine and links to the Github.Help text.licenselicenseSame as help command.Help text.
Features 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 The UCI has been modified to play some other games, and chess variants. Some of these are: Universal Shogi Interface (USI), a dialect for shogi; Universal Chinese Chess Interface (UCCI), a dialect for xiangqi.
Each of these protocols may also define variants of Portable Game Notation (PGN) and Forsyth–Edwards Notation (FEN).
See also Chess Engine Communication Protocol (XBoard protocol) Shredder XBoard
References
External links List of UCI Engines (continuously updated)