Create a Drizzle ORM Project Using the SingleStore MCP Server
On this page
You can easily create a Drizzle ORM project using the SingleStore MCP server and the VS Code MCP Client to connect to your SingleStore deployment and run queries.
Prerequisites
Connect to SingleStore using Drizzle ORM
The following example creates a Drizzle ORM project using the SingleStore MCP Server and the GitHub Copilot in VS Code MCP client, and performs the following tasks in response to a specified prompt:
-
Initializes a
npm
project and installs the required dependencies. -
Creates the required configuration files (Typescript config, Drizzle config, etc.
). -
Connects to a SingleStore deployment and runs the specified migration.
-
Creates a table named
stock
in the SingleStore database. -
Inserts a sample data set into the
stock
table. -
Queries the table.
-
-
Provides an overview of the steps performed.
The Copilot automates each of these steps, prompting the user only for a confirmation to proceed.
Step 1: Install the SingleStore MCP Server
Open an empty folder in VS Code and perform the following tasks:
-
Run the following command in the terminal to initialize the SingleStore MCP Server in VS Code:
uvx singlestore-mcp-server init -
Authenticate via browser OAuth (log in to the Cloud Portal).
-
Restart the MCP client (VS Code) to apply the changes.
Step 2: Add the SingleStore Drizzle ORM Context
After the changes are applied,
-
Select Add context in the Copilot Chat view.
-
From the list of resources, select MCP Resources.
-
(If required) Authenticate via browser OAuth.
And, then select Add context > MCP Resources. -
(If required) Start the SingleStore MCP server, select the icon in the chat view, and then select Start Server from the list.
-
-
Select get_
singlestore_ drizzle_ guide.
Step 3: Initialize the Project and Run the Application using Copilot
Upon adding the get_
MCP context, enter the following prompt (or similar) in the Chat view:
Note
Update the connection configuration (connection string) of your SingleStore Helios deployment before submitting the prompt.
Create a sample Drizzle project using SingleStore.The endpoint URL of the SingleStore deployment is:singlestore://<username>:<password>@<endpoint>:<port>/<database>.Create a table named stock, with the ID, Type, and quantity columns.Insert sample data into the table and then query the data.Also calculate the total stock of each Type.
After submitting the prompt, follow the instructions in the Chat view.
Note
The Copilot automates each of these steps, prompting the user only for a confirmation to proceed.
-
Initialize a new
npm
project.I'll help you create a Drizzle project with SingleStore integration.Let's break this down into steps:First, let's create a new workspace for the project:- Generating plan to create a new workspaceLet me help you create a Drizzle project with SingleStore integration.I'll create the necessary files and set up the project structure.First, let's initialize a new npm project and install the required dependencies:Run command in terminalnpm init -yInitializing a new npm project -
Install the required dependencies.
Now, let's install the required dependencies:Run command in terrminal:npm install drizzle-orm mysql2 dotenv && npm install -D drizzle-kit typescript ts-node @types/nodeInstalling required dependencies -
Generate the following necessary files:
-
tsconfig.
(TypeScript configuration)json -
schema.
(database schema)ts -
drizzle.
(Drizzle configuration)config. ts -
index.
(database connection and queries)ts -
.
(environment variables)env -
package.
(package scripts)json
Let's create the necessary TypeScript configuration:Created tsconfig.jsonNow, let's create our database schema:Created schema.tsLet's create the Drizzle configuration file:Created drizzle.config.tsLet's create our database connection and queries:Created index.tsLet's create the environment file with the SingleStore connection URL:Created .envLet's update the package.json scripts:Created package.json -
-
Run the migrations and start the application.
Now, let's run the migrations and start the application.First, we'll generate and push the migrations:Run command in terminalnpm run generate && npm run pushGenerating and pushing the database migrationsNow let's run the application.npm run startConnecting to database... Creating stock table... Successfully connected to the database Inserting sample data... Querying all stocks: [ { id: 4503599627370498, type: 'Furniture', quantity: 50 }, { id: 4503599627370499, type: 'Electronics', quantity: 75 }, { id: 4503599627370500, type: 'Clothing', quantity: 200 }, { id: 4503599627370497, type: 'Electronics', quantity: 100 }, { id: 4503599627370501, type: 'Furniture', quantity: 25 } ] Calculating total stock by type: [ { type: 'Electronics', totalQuantity: '175' }, { type: 'Clothing', totalQuantity: '200' }, { type: 'Furniture', totalQuantity: '75' } ]
-
Overview of the steps performed.
Let's break down what we've accomplished:* Successfully connected to the SingleStore database* Created the stock table with the required columns:* id (BIGINT, auto-incrementing primary key)* type (VARCHAR)* quantity (INT)* Successfully inserted sample data with different types of stock:* Electronics (total: 175 units)* Furniture (total: 75 units)* Clothing (total: 200 units)* Successfully queried the data:* Retrieved all stock entries* Calculated total quantity by type using GROUP BY aggregationThe application is now fully functional!
As instructed in the prompt, the Copilot successfully completes the specified tasks.
Last modified: August 14, 2025