scarpet-webserver
by replaceitem
Scarpet-webserver lets scarpet scripts run HTTP servers inside a Minecraft server, so a script can answer web requests with its own routes and responses.
What it does
Webservers are defined in a scarpet-webserver.json config file, which the mod creates with a sample on first load. Each webserver is set up with its own unique id and port, and the example config shows how several servers can be listed together. The routes of a server are created by the script that starts it, and the server runs for as long as the script handles it.
Route callbacks receive a request parameter that carries the request values and details. A response is a value returned from the callback, and in most cases the body is an HTML page sent back to the browser. The mod adds two new value types: a map of header names to values, where a header with several values is returned as a list of strings, and a connection value that exposes the protocol, HTTP version, scheme, whether the connection is persistent or secure over HTTPS, and a unique id for the connection within the server lifetime. Values from a request are read with the query operator, since some of them are maps.
Carpet is a required dependency. The mod runs on the server only, so players join without installing it. It is published for Fabric alone, with files for 1.17 – 26.3 under the Apache License 2.0, and its source code and issue tracker are public. Snapshot builds are published as well.
Key features
Scripted routes
A script defines routes and the callbacks that answer them, so a webserver can present its own pages.
Request details
The request parameter gives a callback the request values, including headers and connection information.
Webserver config file
Each webserver is listed in scarpet-webserver.json with its own id and port, and the mod writes a sample file on first load.
Connection values
A connection value reports the protocol, HTTP version, scheme and whether the connection is persistent or secure.
Gallery
Compatibility
Latest build for each game version and loader.
26.x5 of 5 versions with builds
1.21.x12 of 12 versions with builds
1.20.x7 of 7 versions with builds
1.19.x5 of 5 versions with builds
1.18.x3 of 3 versions with builds
1.17.x2 of 2 versions with builds
This mod also publishes snapshot builds. Snapshots are not shown in the matrix.
Requirements
Dependencies declared by the latest file for each loader.
Required 1
Use cases
Who it’s for: Server owners and script authors who write scarpet scripts and want those scripts to answer HTTP requests. Only scripts from trusted authors should be used, and users run the mod at their own risk.
Questions
Does scarpet-webserver need Carpet?
Do players need to install scarpet-webserver?
Which versions does scarpet-webserver support?
Where is the webserver configured?
In the catalog
scarpet-webserver is one of 3,514 Library mods on ModsFinder, and one of 2,348 Library mods for Fabric. 8,071 mods support Minecraft 26.3.
More from replaceitem
Similar mods
What the author says
Warning: Only use this mod with scripts you trust or made yourself. Use this at your own risk. This server can then be used in a script.
Official listing
- Modrinth page
- modrinth.com/mod/scarpet-webserver
- Owner
- replaceitem
- Published
- 2024-01-16
- Updated on Modrinth
- 2026-06-16
- Facts verified
- 2026-10-15
