Edit Page

restheart-ai

RESTHeart Cloud
Prefer not to run it yourself? RESTHeart Cloud is this, hosted, with sign-up, payments and an MCP server already on. Free to start. Get started →

restheart-ai makes the capabilities your application already has โ€” collections, aggregations, change streams, GraphQL apps โ€” discoverable and callable by AI agents, without building a second integration for each one.

An agent asks what exists, gets back how to call it, and makes the request itself through RESTHeart’s normal API. Your existing authentication and ACL decide what it may see and do: the same permissions that govern your REST clients govern agents, with no agent-specific rules to write and no separate stack to keep in sync. Opt a new aggregation into MCP and it is available to agents immediately โ€” there is no tool to implement.

Semantic search is one of those capabilities, not a separate product: expose a $vectorScan/$vectorSearch aggregation and an agent searches your data by meaning as just another call.

It ships with RESTHeart โ€” no separate install, no extra JAR to add.

Note
restheart-ai is available starting from RESTHeart v9.9.
Warning
RESTHeart 9.9 has not been released yet โ€” restheart-ai currently only exists in development snapshot builds. Until 9.9 is out, build RESTHeart yourself from the 9.x branch: git clone https://github.com/SoftInstigate/restheart.git && cd restheart && git checkout 9.x && ./mvnw clean package. The restheart-ai.jar you need is produced at core/target/plugins/restheart-ai.jar.

Two capabilities, meant to be used together:

flowchart LR
  Agent["AI Agent"]

  subgraph AI["restheart-ai"]
    direction TB
    MCP["MCP Server\ntools: list_apis ยท call_api ยท how_to_call\nresources: read ยท subscribe"]
    VS["Vector Search\nindexes ยท chunking ยท embeddings ยท rerank"]
  end

  API["RESTHeart REST / GraphQL API"]
  M[(MongoDB)]

  Agent -- discovers, reads, subscribes --> MCP
  MCP -- how to call it, data, change notifications --> Agent
  MCP -- describes --> API
  MCP -- reads in-process, same ACL --> M
  Agent -- the real request --> API
  VS -- powers $vectorScan / $vectorSearch on --> API
  API --> M
  • MCP Server โ€” connectivity. Exposes your collections, aggregations, change streams, and GraphQL apps to an AI agent through the Model Context Protocol: the agent discovers what exists and how to call it, then makes the real request itself, through RESTHeart’s normal REST/GraphQL API and its normal ACL. No wrapper service, no hand-written tool definitions. Built on the framework-level McpAware interface, which any plugin โ€” yours included โ€” can implement.

  • Vector Search โ€” semantics. Vector search indexes, automatic document chunking (RAG), embeddings (MongoDB autoEmbed or your own provider โ€” OpenAI, Voyage AI, Ollama), $vectorScan for mongot-free semantic search, and reranking.

Together, they compose: a semantic-search aggregation is exposed through MCP exactly like any other aggregation โ€” no extra integration work on either side.

Where to start

Capability Reference Tutorial

MCP Server

Overview

Expose a Collection and an Aggregation

Vector Search

Overview

Semantic Search Tutorial