Back

Announcing an MCP Server for StatelyDB

Get ready to start Vibing

Author Photo
Alex Strand
, 4 minute read

StatelyDB is the only database specifically optimized for change which makes it a natural fit for generative AI. We’re excited to announce our new Model Context Protocol (MCP) Server for StatelyDB that helps developers quickly build Elastic Schema definitions. Get ready to start vibe coding!

Let’s dive in!

Installing the MCP Server for StatelyDB

You’ll need to download Claude Desktop. Once you’ve got Claude Desktop installed open up the MCP configuration by visiting Settings, then Developer and Edit Config. Add the following configuration snippet:

{
  "mcpServers": {
    "statelydb": {
      "command": "npx",
      "args": ["-y", "@stately-cloud/statelydb-mcp-server@latest"]
    }
  }
}

Open up Claude Desktop and you’re ready to go!

What Can I Do With It?

Here’s a quick run-down of the available tools and some example prompts:

statelydb-attempt-login

This tool attempts to authenticate the MCP Server with your Stately Cloud account. If you haven’t ever used Stately Cloud you can open up the Console and an account will be created on your first visit.

Sample prompt:

Let's login to StatelyDB

statelydb-verify-login

This tool will verify that you are authenticated. If you are, it’ll return metadata about your account like the Stores, Schemas and Organizations you have access to. If you aren’t, the language model will likely offer to log you in.

Sample prompts:

Am I logged in to StatelyDB?
What StatelyDB Stores do I have access to?
Which StatelyDB Stores are available in the ACME Organization?

statelydb-validate-schema

This tool checks if a given Elastic Schema definition is valid. This simple tool provides a valuable feedback mechanism that an LLM can use to iterate towards a correct outcome because validation errors about the schema are returned to the LLM.

Sample prompts:

Is this a valid StatelyDB schema?

import { itemType, string, uuid } from "@stately-cloud/schema";

itemType("RamenFlavors", {
  keyPath: "/ramens-:id",
  fields: {
    id: { type: uuid, initialValue: "uuid" },
    name: { type: string }
  }
});
My editor is showing me errors with my StatelyDB schema, can you fix issues and validate the fixes are correct?

itemType("RamenFlavors", {
    keyPath: "/ramens-:id"
    fields: [
        { id: uuid, initialValue: "uuid" },
        { name: string }
    ],
})

Note: The schema above is intentionally malformed in order to generate a corrective response from the LLM.

statelydb-validate-migrations

This tool ensures that any migrations defined in a proposed schema change are correct before publishing. This tool requires knowing about the ID of the published schema you want to make changes to.

Are the migrations for this StatelyDB schema valid? My target schema id is 12345

import { itemType, string, uuid, migrate } from "@stately-cloud/schema";

itemType("RamenFlavors", {
  keyPath: "/ramens-:id",
  fields: {
    id: { type: uuid, initialValue: "uuid" },
    name: { type: string },
    nickname: { type: string }
  }
});

migrate(1, "Add nickname field", (m) => {
    m.changeType("RamenFlavors", (t) => {
        t.AddField("nickname")
    })
});

statelydb-schema-put

This tool publishes a schema definition to a given schema ID! Be careful about allowing Claude Desktop to “Always” have access to run this tool.

I want to publish the schema we've been developing to schema ID 12345.

statelydb-schema-generate

This tool generates files for use with the StatelyDB SDK using a given published schema ID and schema version (or the latest published if omitted).

I'm building a NextJS app. Generate typescript code for schema ID 12345 and add the StatelyDB SDK to my project.

Bringing It Together

Here’s an example of how you can use the MCP Server for StatelyDB to conversationally create a schema, validate it for errors, publish it and generate source code. This is just a high-level example which doesn’t include the LLM responses, so you’ll want to try this out for yourself.

I want to create an application for tracking my coffee intake. We'll use StatelyDB as our database, with a Store ID of 12345 and a Schema ID of 6789.

Here's our plan:

1. Define a StatelyDB schema for tracking coffee intake. Learn about the StatelyDB schema format before attempting to create a schema definition.
2. Validate that the schema is valid. If it isn't, correct errors until it is.
3. Verify with me that we should publish the schema. If I agree, publish it.
4. Ask me which language I'd like to write my app in and then offer to generate code for use with the StatelySDK based on my schema.

Documentation for StatelyDB is available at https://docs.stately.cloud

Latest from our blog

/images/posts/encoding-sortable-binary-database-keys.png
Solving sorting for nested keys with mixed data types
Author Photo
Ben Hollis
August 25, 2025
/images/posts/aws-just-explained-why-you-need-elastic-schema.jpg
It's a lot of work that your database could do for you
Author Photo
Ben Hollis
August 7, 2025
/images/posts/sea-creatures-evolve-into-crabs-databases-evolve-into-dynamodb.jpg
As companies grow, their database infrastructure always ends up looking very familiar…
Author Photo
Ben Hollis
July 29, 2025
View all posts

Using DynamoDB today? Want to try StatelyDB?