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.
A real URL shortener. One file.
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)
}
Install
One command. Any platform.
$ brew install jlkdevelop/tap/mx
$ go install github.com/jlkdevelop/mxscript@latest
After installing, run mx --version to confirm. Full docs at github.com/jlkdevelop/mxscript.
What's in the box
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.
Available everywhere
Pick the channel that fits your workflow.
Homebrew tap
brew install jlkdevelop/tap/mx — auto-bumped on every release.
→VS Code Marketplace
Syntax highlighting, snippets, and language server. Search 'MX Script' in extensions.
→GitHub Action
uses: jlkdevelop/setup-mx@v1 — drops the mx CLI onto Linux/macOS/Windows runners.
→Vercel
mx build --vercel emits a ready-to-deploy Go project. First-class Vercel support.
→About MX Script
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.
Batteries included
HTTP routes, JSON, JWT, sessions, SQL, AI tool calling, WebSockets, background jobs — first-class syntax. No framework to bolt on.
Single binary
One Go binary, ~5 MB, zero runtime dependencies. brew install, go install, or download a tarball — you're done.
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).
Help
Get unstuck. Get going.
Three paths from 'I just installed it' to 'I shipped a real app'. Pick whichever matches how you learn.
Quickstart
Three commands to a running server.
mx init my-api
cd my-api
mx run app.mx
Step 2
Templates
Nine starter projects via mx new <name>:
api— REST showcase (auth, paginate, uploads)shortener— URL shortener in 50 linestodo— JWT-authenticated SQLite todochat— WebSocket chat with browser UIai— tool-calling /chat endpointblog— SSR markdown blog with adminsaas— Stripe + magic-link + metricsdashboard— admin dashboard with live chartsreact— Vite + React frontend with MX backend
Examples
Curated, copy-pasteable snippets in examples/:
url_shortener.mx— 50-line CRUD showcasecrud.mx— REST API with api-key authagent.mx— 60-line tool-calling agentchat.mx— realtime WebSocket broadcastsaas_pro.mx— kitchen-sink SaaS
Get Involved
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:
⭐ Star the repo
The single biggest signal that MX Script is worth a stranger's time. Takes one click.
github.com/jlkdevelop/mxscript🐛 Report a bug
Hit a sharp edge? Open an issue with a minimal repro and it'll be on the next release.
Open an issue →🛠 Send a PR
Fix a typo, add a builtin, ship a new template. Read CONTRIBUTING.md for the rules — they're short.
Read CONTRIBUTING →💬 Discuss ideas
Have a feature in mind? Want to debate a design choice? GitHub Discussions is the place.
Start a discussion →📣 Share it
Tell one developer who'd appreciate ‘one file, zero boilerplate, AI built in.’
Share on X →👋 Reach out
Building something with MX Script? Want to collaborate? Find me on GitHub — I read every message.
github.com/jlkdevelopMeta moment
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 →