MCP Server
SoftDB includes a built-in MCP (Model Context Protocol) server that lets AI coding assistants — Claude Desktop, Cursor, Windsurf, and others — directly browse your database schemas, execute queries, and explore relationships. No copy-pasting schemas into chat. The AI just knows your database.
Quick Setup
Section titled “Quick Setup”Pick your AI tool and paste the config:
Add to ~/.config/claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{ "mcpServers": { "softdb": { "url": "http://localhost:9090/mcp" } }}Restart Claude Desktop after saving.
Add to .cursor/mcp.json in your project root:
{ "mcpServers": { "softdb": { "url": "http://localhost:9090/mcp" } }}Add to ~/.codeium/windsurf/mcp_config.json:
{ "mcpServers": { "softdb": { "url": "http://localhost:9090/mcp" } }}For MCP clients that support stdio transport:
{ "mcpServers": { "softdb": { "command": "/path/to/softdb-mcp" } }}Build the binary: go build -o softdb-mcp ./cmd/mcp/
Enabling the MCP Server
Section titled “Enabling the MCP Server”-
Open SoftDB and go to Settings (gear icon in the toolbar).
-
Click MCP Server in the sidebar.
-
Toggle Enable MCP Server on. The status indicator turns green and shows the active port.
-
Copy the config snippet shown in the settings panel and paste it into your AI tool’s MCP config file.
-
Restart your AI tool. It will connect to SoftDB automatically.
Available Tools
Section titled “Available Tools”Once connected, the AI agent has access to 8 database tools:
| Tool | Description |
|---|---|
list_connections | List all MCP-enabled database connections |
use_connection | Set the active connection (auto-connects if needed) |
list_databases | List databases on the active connection |
list_tables | List tables, optionally in a specific database |
describe_table | Get column definitions — name, type, nullable, PK, default |
execute_query | Run SQL, MongoDB JSON queries, or Redis commands |
read_table | Paginated table data browsing |
get_relationships | Foreign key relationships between tables |
Per-Connection Access Control
Section titled “Per-Connection Access Control”Not every database should be visible to AI. SoftDB lets you control which connections the MCP server can access:
- In the Connection Hub, hover over a connection card to reveal the MCP icon (hub icon).
- Click it to toggle MCP access for that connection.
- Disabled connections are hidden from
list_connectionsand cannot be used by AI agents.
All connections are MCP-enabled by default.
Safety
Section titled “Safety”MCP inherits SoftDB’s per-connection Safe Mode:
- When Safe Mode is on,
execute_queryblocks destructive operations —DROP,TRUNCATE,DELETEwithoutWHERE,UPDATEwithoutWHERE. - The AI agent receives a clear error explaining why the query was blocked.
- Query results are capped at 1000 rows to prevent oversized responses.
- Credentials are never exposed — the AI only sees connection names, types, and hosts. Passwords, SSH keys, and URIs are stripped from all responses.
Two Transport Modes
Section titled “Two Transport Modes”HTTP (in-app)
Section titled “HTTP (in-app)”When the SoftDB app is running with MCP enabled, it serves an HTTP endpoint on http://localhost:{port}/mcp. AI tools connect via HTTP. You control it from the Settings UI — toggle on/off, change port, see status.
Stdio (headless)
Section titled “Stdio (headless)”For CI/automation or when you don’t want the GUI, build and run the standalone binary:
go build -o softdb-mcp ./cmd/mcp/Configure your AI tool to spawn it as a subprocess:
{ "mcpServers": { "softdb": { "command": "./softdb-mcp" } }}The stdio binary reads your saved connections from the same config directory as the app (~/.config/SoftDB/).
Example Conversation
Section titled “Example Conversation”Once MCP is connected, you can ask your AI assistant things like:
“Show me all tables in the production database”
The AI calls use_connection → list_tables and returns the result.
“What columns does the users table have?”
The AI calls describe_table with table: "users" and formats the schema.
“Find all orders placed in the last 7 days with total > $100”
The AI calls execute_query with the appropriate SQL, gets the results, and presents them.
“How are the orders and products tables related?”
The AI calls get_relationships and explains the foreign key structure.