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
The first thing you’ll need to grab if you don’t have it already is our command line tool:
Next you’ll need to download a copy of 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:
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:
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:
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:
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.
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.
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).
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.