restheart
The Agent-Ready Backend for MongoDB.
Links
README
From the repo.
RESTHeart
What RESTHeart is
Every application built on MongoDB ends up with the same backend layer: routes that map to collections, permission checks on each endpoint, pagination and filtering logic, a way to push updates to clients in real time. That layer is largely mechanical, and writing it by hand for each project is where a lot of backend code goes.
RESTHeart generates that layer directly from the database. Point it at a MongoDB instance and it exposes the data through REST, GraphQL, WebSocket, and SSE APIs, with authentication, authorization, and real-time change streams already in place. Permissions and behavior are configured declaratively; custom logic is added only for the parts a data API cannot express, through plugins written in Java, Kotlin, JavaScript, or TypeScript.

Example
curl "https://demo.restheart.org/messages?filter={\"from\":\"Bob\"}&pagesize=1"
No route was written for /messages. It is a MongoDB collection, and the query parameters (filter, pagesize, sorting) map directly to MongoDB's query language.
Core capabilities
- REST API: full CRUD, aggregations, filtering, sorting, pagination, generated from the database schema
- GraphQL: schema-driven mapping to MongoDB queries
- WebSocket: change streams exposed as real-time data sync
- SSE: Server-Sent Events for dashboards, IoT feeds, and event streams
- Authentication and Authorization: JWT, OAuth2, LDAP, MongoDB-based users, ACL rules defined as data, not code
- Plugin framework: custom services, interceptors, and initializers in Java, Kotlin, JavaScript, or TypeScript, for the logic a declarative API cannot cover
- Metrics and monitoring: a Prometheus-compatible endpoint plus a browser dashboard at
/metrics-ui, tracking request rates, latency percentiles, and HTTP status distribution - IoT / MQTT: ingest device telemetry directly into MongoDB (coming soon)
Distributed as a Docker image and a GraalVM native binary. Built on Java 25, Undertow, and virtual threads.
Running it
Fully managed, no installation required, and including Sophia, an MCP server and browser assistant that exposes RESTHeart's docs and plugin API to AI coding assistants such as Claude Code, Cursor, or VS Code:
Or self-hosted, since the core is free and open source:
curl https://raw.githubusercontent.com/SoftInstigate/restheart/master/docker-compose.yml \
--output docker-compose.yml && docker compose up --attach restheart
curl http://localhost:8080/ping
Full documentation: https://restheart.org/docs/
License
RESTHeart core is licensed under the GNU AGPL v3.
restheart-commons, the Maven artifact plugins depend on to reach the Approved Interfaces, is licensed under the Apache License 2.0. Plugins that depend only on restheart-commons, without linking against RESTHeart's AGPL-licensed core, can be distributed under any license, including proprietary ones. See PLUGIN_EXCEPTION.md for the exact terms of this permission.
Collected info
- ★ 878 stars
- ⎇ 177 forks
- Language: Java
- Source updated: 6/22/2026
Config for your environment
Replace {MCP_ENDPOINT_URL} with this MCP’s endpoint URL (from its repo or docs above). No API key — you connect directly.
Tool
OS
Config file: ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-server": {
"url": "{MCP_ENDPOINT_URL}"
}
}
}Paste into mcpServers in the config file. Restart Cursor after saving.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.