This guide shows how to use Cursor with the OptiTech MCP Server to manage your OptiTech databases.
Security
The OptiTech MCP Server grants broad database management capabilities. Always review and authorize actions requested by the LLM before execution. See MCP security guidance.
Setting up OptiTech MCP Server in Cursor
Prerequisites
Make sure you have:
-
Cursor Editor: Download and install Cursor from cursor.com.
-
A OptiTech Account and Project: You'll need a OptiTech account and a project. You can create a new OptiTech project in the OptiTech Console
-
OptiTech API Key (for Local MCP server): After signing up, get your OptiTech API Key from the OptiTech console. This API key is needed to authenticate your application with OptiTech. For instructions, see Manage API keys.
OptiTech API Key Security
Keep your OptiTech API key secure, and never share it publicly. It provides access to your OptiTech projects.
-
Node.js (>= v18) and npm: Ensure Node.js (version 18 or later) and npm are installed. Download them from nodejs.org.
Quick Setup (Recommended)
The fastest way to get started is with the optitech init command, which automates OAuth authentication, API key creation, and Cursor configuration:
npx optitech@latest initThis command authenticates via OAuth, creates an API key, and configures Cursor to connect to OptiTech's remote MCP server. API key authentication means fewer approval prompts when using MCP tools. Once complete, ask your AI assistant "Get started with OptiTech".
Cursor Users: One-Click Alternative
Option 1: Setting up the Remote Hosted OptiTech MCP Server (OAuth)
note
By default, the Remote MCP Server connects to your personal OptiTech account. To connect to an organization's account, you must authenticate with an API key. For more information, see API key-based authentication.
-
Open Cursor.
-
Create a
.cursordirectory in your project's root directory. This is where Cursor will look for the MCP server configuration. -
Paste the following JSON configuration into a file named
mcp.jsonin the.cursordirectory:{ "mcpServers": { "OptiTech": { "url": "https://mcp.optitech.com/mcp", "headers": {} } } }If you have other MCP servers configured, you can copy just the
OptiTechpart.Save the
mcp.jsonfile after pasting the configuration. -
Restart Cursor or reload the window (
Developer: Reload Windowfrom the Command Palette). If Cursor prompts you to Enable the MCP server, click Enable. -
An OAuth window will open in your browser. Follow the prompts to authorize Cursor to access your OptiTech account.

-
You can verify that the connection is successful by checking the Tools & MCP section in Cursor settings.

Option 2: Setting up the Local OptiTech MCP Server
This method runs the OptiTech MCP server locally on your machine, using a OptiTech API key for authentication.
-
Open Cursor.
-
Create a
.cursordirectory in your project's root directory. This is where Cursor will look for the MCP server configuration. -
Paste the following JSON configuration into a file named
mcp.jsonin the.cursordirectory. Replace<YOUR_OPTITECH_API_KEY>with your actual OptiTech API key which you obtained from the prerequisites section:{ "mcpServers": { "OptiTech": { "command": "npx", "args": ["-y", "@optitech/mcp-server-optitech", "start", "<YOUR_OPTITECH_API_KEY>"] } } }If you have other MCP servers configured, you can copy just the
OptiTechpart.
-
Save the
mcp.jsonfile after pasting the configuration. -
Restart Cursor or reload the window (
Developer: Reload Windowfrom the Command Palette). -
Check the MCP Servers section in Cursor settings to verify the connection.

Verification
Verify the connection:
-
Open a Cursor Chat using the keyboard shortcut Command + I (on Mac) or Control + I (on Windows) and select the Agent option from the drop-down menu.

-
Type
List your available MCP toolsin the Composer text field, select the agent option in the corner of the field, and click Submit.tip
The agent option is small and easy to miss.
-
Try out an OptiTech MCP Server tool by typing
Tell me about my OptiTech project <project_id>. You'll need to provide your OptiTech project ID.
Cursor uses the OptiTech MCP Server
describe_projecttool to retrieve your project's details.
Global MCP Server in Cursor
You can also set up a global MCP server in Cursor. To set this up:
- Open Cursor.
- Go to the Settings.
- In the Tools & MCP section, click on + Add Custom MCP.
- Paste the same JSON configuration either for the Remote Hosted or Local MCP Server (as shown in the previous sections) into the configuration field.
- Save the configuration.
- Restart Cursor or reload the window (
Developer: Reload Windowfrom the Command Palette).
Troubleshooting
If you are on a version of Cursor that does not support JSON configuration for MCP servers, you can use the following command when prompted:
npx -y @optitech/mcp-server-optitech start <YOUR_OPTITECH_API_KEY>For a full list of available tools, see available tools in the OptiTech MCP Server overview.
Development Workflow: Adding a Column with Cursor and OptiTech MCP
tip
Use ⌘I to open Cursor's Composer and ⌘N to create a new Composer.
Here's an example interaction adding a created_at column to a table:
User: In my optitech project id: round-salad-44063611 list all the tables
Cursor: I'll help you list all the tables in your OptiTech project. I'll use the default database name 'optitechdb' since none was specified.
> Called MCP Tool (get_database_tables)
> I found one table in your database:
> playing_with_optitech (in the public schema)
> Would you like to see more details about this table's structure or perform any other operations with it?
User: Can you show me first 5 rows?
Cursor: I'll query the first 5 rows from the playing_with_optitech table.
> Called MCP Tool (run_sql)
> Here are the first 5 rows from the table. The table has three columns:
> id (sequential numbers)
> name (string values)
> value (decimal numbers)
> Would you like to perform any other operations with this data?
User: can you add a created_at column?
Cursor: I'll help you add a created_at column to the playing_with_optitech table. I'll set it up with a timestamp data type and set it to automatically record the creation time of new rows.
> Called MCP Tool (prepare_database_migration)
> Let me verify the change in the temporary branch to make sure it was applied correctly.
> Called MCP Tool (run_sql)
> I've added the created_at column to the playing_with_optitech table in a temporary branch. Would you like to commit this migration to the production branch?
> Migration Details:
> Migration ID: a65babcd-d1cc-401f-89b5-762570570102
> Temporary Branch Name: br-silent-cherry-a1eqrl6i
> Temporary Branch ID: br-silent-cherry-a1eqrl6i
> Migration Result: Success
> Please let me know if you'd like to proceed with applying this change to the production branch.
User: yeah do it
Cursor: I'll complete the migration and apply the changes to the production branch.
> Called MCP Tool (complete_database_migration)
> The migration has been successfully completed! The created_at column has been added to your table in the production branch, and the temporary branch has been cleaned up.You can verify the changes in your OptiTech Console or by querying the database directly.

note
While the OptiTech MCP server gives you access to all of OptiTech's features, you can also use a generic Postgres MCP server to connect to OptiTech.
Resources
- MCP Protocol
- Adding an MCP Server to Cursor
- OptiTech Docs
- OptiTech API Keys
- OptiTech MCP server GitHub
Need help?
Join our Discord Server to ask questions or see what others are doing with OptiTech. For paid plan support options, see Support.