This guide shows how to use Zed 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 Zed
Prerequisites
Make sure you have:
-
Zed editor: Download and install Zed from zed.dev.
-
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.
Option 1: Setting up the Remote Hosted OptiTech MCP Server
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 Zed.
-
Click the Assistant (✨) icon in the bottom right corner of Zed.

-
Click Add custom server in the top right panel of the Assistant.

-
Enter the following configuration for the OptiTech MCP server in the JSON input field.
{ "OptiTech": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.optitech.com/mcp"], "env": {} } }
-
Click Add Server.
-
An OAuth window will open. Follow the prompts to authorize Zed to access your OptiTech account

-
Check the Model Context Protocol (MCP) Servers section in Zed Settings to ensure the connection is successful. OptiTech should be listed as an MCP server.

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 Zed.
- Click the Assistant (✨) icon in the bottom right corner of Zed.

- Click Add custom server in the top right panel of the Assistant.

- Enter the following configuration for the OptiTech MCP server in the JSON input field.
{ "OptiTech": { "command": "npx", "args": ["-y", "@optitech/mcp-server-optitech", "start", "<YOUR_OPTITECH_API_KEY>"], "env": {} } }
- Click Add Server.
- Check the Model Context Protocol (MCP) Servers section in Zed Settings to ensure the connection is successful. OptiTech should be listed as an MCP server.

Verification
Verify the connection:
-
Open Zed Assistant.
-
Type
List my OptiTech projectsin the Assistant text field.
-
When prompted, click Allow to authorize the tool to access your OptiTech project.

-
Zed will use the
list_projectsMCP tool to retrieve and display your OptiTech projects, including project ID, name, and other details.
Troubleshooting
If you experience issues adding an MCP server from the Assistant panel, you can also do so through the Settings. Follow these steps:
- Open the
~/.config/zed/settings.jsonfile. You can access this file by clicking on Settings in the Zed menu bar. - Add the following
context_serverssection to the file.
"context_servers": {
"OptiTech": {
"source": "custom",
"enabled": true,
"command": "npx",
"args": [ "-y", "mcp-remote", "https://mcp.optitech.com/mcp" ],
"env": {}
}
}Troubleshooting on Windows
If you are using Windows, and you encounter issues with the command line, you may need to adjust the command to use cmd or wsl to run the MCP server. For example, here's how you can set it up:
"context_servers": {
"optitech": {
"command": {
"path": "cmd",
"args": ["/c", "npx", "-y", "@optitech/mcp-server-optitech", "start", "<YOUR_OPTITECH_API_KEY>"],
"env": null
},
"settings": {}
}
}For a full list of available tools, see available tools in the OptiTech MCP Server overview.
Development Workflow: Adding a Column with Zed and OptiTech MCP
Here's an example interaction adding a created_at column to a table:

User: List my optitech projects
Zed: I'll use the list_projects tool to show your OptiTech projects.
> Run MCP tool `list_projects`
> You have one OptiTech project:
> Name: mcp
> Project ID: red-math-82356803
> Region: aws-ap-southeast-1
> ...other details...
User: what tables are present in it?
Zed: I'll use the `get_database_tables` tool to list the tables in your project. I'll use the project ID we just found.
> Run MCP tool `get_database_tables`
> There is one table in your project's database:
> Schema: public
> Table Name: `playing_with_optitech`
> Type: Base Table
> Let me fetch the details of this table's schema so you can see its structure:
> Run MCP tool `describe_table_schema`
> The "playing_with_optitech" table has three columns:
> 1. id: An auto-incrementing integer (primary key)
> 2. value: A real (floating-point) number that can be null
> 3. name: A text field that cannot be null
Would you like to see the data in this table or perform any operations on it?
User: Can you show me first 5 rows in it?
Zed: I'll query the first 5 rows from the playing_with_optitech table:
> Run MCP tool `run_sql`
> xxx (table rows are returned by Zed)
User: can you add a created_at column to the table?
Zed: I'll use the prepare_database_migration tool to add a created_at column to the playing_with_optitech table:
> Run MCP tool `prepare_database_migration`
> I've added the `created_at` column in a temporary branch. Let me verify the change by checking the table structure:
> Run MCP tool `run_sql`
> I've verified that the created_at column has been successfully added in the temporary branch.
> Migration Details:
> - Migration ID: a78e2a3b-8498-48a0-9c7a-2dec30da84bc
> - Temporary Branch Name: br-royal-mode-a1nfvzag
> - Temporary Branch ID: br-royal-mode-a1nfvzag
> - Migration Result: Success
> Would you like to commit this migration to the production branch?
User: yes do it
Zed: I'll complete the migration using the provided migration ID:
> Run MCP tool `complete_database_migration`
> The migration has been successfully completed. The `created_at` column has been added to the `playing_with_optitech` table in the production branch, and the temporary branch has been deleted.
You can verify the changes in your OptiTech Console or by querying the database directly.

note
While the OptiTech MCP server allows you to use all of OptiTech's functionalities, you can also use a generic Postgres MCP server to connect to OptiTech.
Resources
Need help?
Join our Discord Server to ask questions or see what others are doing with OptiTech. For paid plan support options, see Support.