Chess Web Engine Protocol 1.0
Chess engines,
meet the web.
An open JSON protocol for connecting chess applications to engine adapters through a JavaScript bridge.
{
"protocol": "cwep",
"version": "1.0",
"type": "analysisUpdate",
"requestId": "search-1",
"payload": {
"depth": 18,
"score": {
"kind": "cp", "value": 28,
"pov": "sideToMove"
},
"pv": ["e2e4", "c7c5"]
}
}
From host application to engine
The host loads a plugin page over HTTPS, discovers its capabilities and uses the JavaScript bridge for analysis. The Stockfish example runs in WebAssembly so a browser or WebView can analyze a position on the device.
Host application
Sends a FEN position and search limits.
CWEP adapter
Validates requests and returns analysis updates.
Chess engine
Searches the position using its own engine interface.
Protocol comparison
CWEP and UCI
Both carry positions, search limits, evaluations and principal variations. The Stockfish example uses CWEP at the web boundary and UCI inside the adapter.
| Aspect | CWEP 1.0 | UCI |
|---|---|---|
| Format | JSON messages with typed payloads | Text commands and responses |
| Transport | JavaScript bridge in a WebView, with same-document events for browsers | Typically a process’s standard input and output |
| Common use | Web and embedded WebView integrations | Desktop chess GUIs and engine tools |
Open source
An independent project.
CWEP is a privately maintained open-source initiative. The specification is MIT-licensed, and any engine can implement it. Chessory is a separate chess application that uses CWEP.