R2 is an open source REST Resource server. It comes with a ready to use REST API. Developer can add/edit resources to the server using R2 Console
Needs a JDK (8 to 17). Maven is bundled in server/maven.
dev build # build parser + console from source into server/
dev start # http://localhost:7000/console (login admin/admin)
dev stop
On Linux/macOS/Git Bash use ./dev.sh with the same commands.
dev mason builds Mason (the runtime that apps run on) from a checkout (MASON_HOME, default ../mason) with Maven and puts the jar into the app template; run dev build afterwards. The template currently embeds a Mason build that includes the open Mason PRs (Kotlin runner, error log, pooled tag state, request status, param map, JAXB cache).
| Folder | What it is |
|---|---|
parser/ |
XML resource parser (builds openapi-rest-model jar into server/lib) |
console/ |
Console webapp and REST API for apps, resources, deployment (builds console.war) |
server/ |
Tomcat based server. Apps you create are generated into server/webapps, server/databases, server/backend (git-ignored) |
mcp/ |
MCP server so an AI agent can create apps, define/hot-deploy resources and call them (see mcp/README.md) |
cli/ |
mtg command line client |
docs/ |
Documentation |
claude mcp add r2-dev -- node mcp/server.mjs
Then ask the agent to create an app, a table and a resource. mcp/test-log.md records the Dev server validation run and the issues it found.
R2 console comes with following features.
- REST Resource Management
- Hot deployment for REST Resources
- Resource editor with autocomplete and query testing (using open source project)
- Open API documentation generated.
API Integration with third party services like AWS, Facebook, Twitter, Firebase, PayPal, Mailchimp and more. Communication with multiple services in a single request using API Gateways.
Convert OpenAPI Spec file into Resource Resource XML files. This project aims to generate compatible resource xmls for a given spec file json/yml.
The sample petstore yml file will convert to a number of resource xmls. https://editor.swagger.io/
REST Resource files are designed to address a REST resources individually. Each Resource file maps to its own URI. This makes resources easily identifiable and managable.
https://metamug.com/docs/resource-file
https://github.com/OAI/OpenAPI-Specification
Mason v3.4 available on Maven central
