MCP Server
DevDb has a local MCP server. AI tools such as Claude Code, Cursor, Windsurf, Cline and GitHub Copilot can use it to read your database schema and run queries.
The MCP server uses the database that is open in the DevDb panel. Each tool takes the absolute path of the project root. DevDb uses it to find the editor window of that project, so keep the project open while you use the tools.
Tools
| Tool | Description |
|---|---|
get-database-type | Returns the type of the database, for example mysql or postgres |
get-tables | Lists the tables |
get-schema | Returns the columns of a table |
run-query | Runs a query. Read-only by default. |
Set up
- Open your project. Make sure that DevDb shows your database.
- In the DevDb panel, click the hammer icon.
- Copy the configuration for your tool.
Claude Code
Copy the Claude Code command and run it in a terminal:
claude mcp add --transport stdio devdb-mcp-server node "/path/to/devdb/dist/services/mcp/no-vscode/server.js"The path in the copied command is the path on your computer.
Cursor, VS Code, Windsurf and Cline
Copy the Cursor/VS Code configuration. It has this form:
{
"devdb-mcp-server": {
"command": "node",
"args": ["/path/to/devdb/dist/services/mcp/no-vscode/server.js"],
"env": []
}
}Paste it under the servers key of the MCP configuration file of your tool, then reload the tool:
| Tool | File | Key |
|---|---|---|
| VS Code | .vscode/mcp.json | servers |
| Cursor | ~/.cursor/mcp.json | mcpServers |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | mcpServers |
After an update
The path contains the version of DevDb. After you update DevDb, copy the configuration again and replace the old one. Then restart your editor and your MCP client.
Security
Localhost only
The MCP server listens on 127.0.0.1 only. It rejects connections from other computers.
Access token
Each request must send a per-session access token. DevDb writes the token and the port to ~/.devdb/mcp.json. Only your user account can read this file.
The DevDb MCP server script reads the token from this file and sends it with each request. The server rejects requests without the correct token. You do not copy the token by hand. Do not share ~/.devdb/mcp.json.
Restart VS Code after you update DevDb, so that MCP clients get the new token.
Read-only by default
MCP queries are read-only. The database enforces this, not only DevDb. For example, DevDb runs PostgreSQL and MySQL queries in a read-only transaction, accepts only read commands for Redis, and accepts only SELECT for DynamoDB PartiQL. D1 and libSQL queries are also read-only.
Allow writes
To let MCP clients change data:
- Open your user settings (not workspace settings).
- Set
Devdb.mcp.allowWritestotrue.
{
"Devdb.mcp.allowWrites": true
}DevDb then shows "An MCP client wants to run a query that changes data." for each write query (INSERT, UPDATE, DELETE and DDL). Click Run query to run it. Close the dialog to reject it.
This setting has machine scope. A workspace .vscode/settings.json file cannot turn it on.
Turn off the MCP server
Set Devdb.enableMcpServer to false.
Troubleshooting
- The client cannot connect after an update. Restart VS Code so that the MCP server writes a new token, then restart the MCP client.
- "DevDb's MCP server is disabled". Set
Devdb.enableMcpServertotrue. - The client sees no tables. Open the DevDb panel and connect to a database first.
- Logs. The MCP server writes its log to
~/.devdb/mcp-log.txt.