NEW Run MX Script in your browser — no install required. Open playground

Open source · MIT licensed

Lightweight scripting
for one-file web APIs.

MX Script is a lightweight scripting language for building one-file web APIs. Routes, JSON, JWT, sessions, SQL, AI — all first-class. No framework, no build step, no node_modules. mx run app.mx and you’re shipping.

No install required for the playground · Live at try.mxscript.com

server { port: 8080 }
let db = sql.open("./app.db")
sql.migrate(db, ["CREATE TABLE IF NOT EXISTS links (code TEXT PRIMARY KEY, url TEXT, hits INT DEFAULT 0)"])

post /shorten {
  let r = body_validate(request, {
    type: "object", required: ["url"],
    properties: { url: { type: "string", min_length: 8 } }
  })
  if (!r.ok) { return r.response }
  let code = id.nanoid(7)
  sql.insert(db, "links", { code: code, url: r.body.url, hits: 0 })
  return status(201, { code: code, target: r.body.url })
}

get /:code {
  let link = sql.find_one(db, "links", { code: request.params.code })
  if (link == null) { return problem(404, "Not found") }
  sql.update(db, "links", { hits: link.hits + 1 }, { code: link.code })
  return redirect(link.url)
}

One command. Any platform.

Homebrew $ brew install jlkdevelop/tap/mx
or any platform with Go
Go $ go install github.com/jlkdevelop/mxscript@latest

After installing, run mx --version to confirm. Full docs at github.com/jlkdevelop/mxscript.

HTTP routes

First-class GET / POST / PUT / DELETE / PATCH with path params, query, headers, and JSON body.

Middleware

Compose request pipelines with the use keyword. Auth, logging, CORS — write it once, reuse everywhere.

Sessions + JWT

Signed cookies, JWT (HS256), HMAC, and SHA-256 built in. No npm install dance.

AI built in

ai.complete and ai.embed work out of the box with any OpenAI-compatible endpoint.

File I/O

read_file, write_file, list_files. Static asset serving via the static directive.

Zero deps

One binary. No node_modules. No package.json. No build step. Run a .mx file and ship.

Pick the channel that fits your workflow.

One file. One binary. One command to ship.

MX Script collapses the gap between “I want a JSON endpoint that does one useful thing” and “it’s deployed.” A lightweight scripting language for one-file web APIs — ~200 stdlib functions, zero npm install, one binary.

01

Batteries included

HTTP routes, JSON, JWT, sessions, SQL, AI tool calling, WebSockets, background jobs — first-class syntax. No framework to bolt on.

02

Single binary

One Go binary, ~5 MB, zero runtime dependencies. brew install, go install, or download a tarball — you're done.

03

Built in the open

MIT-licensed. Every commit on GitHub. Every release a tag. Roadmap public. No surprise pivots, no hidden enterprise tier.

Why it exists

Most modern web work pays a tax: before you write the thing you actually wanted to build, you assemble a runtime, a framework, a router, a build tool, a deploy story, and twenty config files. The simple case — “I want a JSON endpoint that does one useful thing” — gets buried under setup.

MX Script collapses that. The language is the framework. Routes, middleware, sessions, JSON, JWT, SQL, and AI tool calling are first-class. There's no npm install, no package.json, no node_modules. One file. mx run app.mx. You're shipping.

It's intentionally small — ~200 builtins covering the 80% case for HTTP services. The interpreter is a single Go binary; the language is jlkdevelop/mxscript; this site is itself written in MX Script (view source).

Get unstuck. Get going.

Three paths from 'I just installed it' to 'I shipped a real app'. Pick whichever matches how you learn.

Built in the open. Help shape what's next.

MX Script is MIT-licensed and developed publicly. Every commit, every issue, every release is on GitHub. Here's how you can pitch in:

This site is built in MX Script.

Every page, every route, every byte of HTML you're reading was generated by an .mx file. The site grows in parallel with the language — every missing capability becomes the next feature.

Read the source →