workbench-mcp
Provides a comprehensive set of tools for interactive PostgreSQL data exploration and automation, including schema discovery, read-only query previews, execution of stored procedures and functions, and managed data insertion.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@workbench-mcpshow me the schema for the orders table and a preview of its data"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
workbench-mcp
A local Python MCP server for interactive PostgreSQL data exploration, API integration, and automation on Fedora/Linux systems.
Overview
Version 1 includes:
Python virtual environment setup for Fedora/Linux systems
PostgreSQL 18 connectivity configured via
.envfileMCP tools for:
Discovering tables, columns, and schema structure
Running read-only query previews
Executing guarded SQL batches with temporary table support
Calling PostgreSQL stored functions and procedures
Accessing external APIs via full URL requests
Executing bash scripts available in
PATH
Enforced safety: persistent schema and data modifications are blocked
Session-scoped temporary table workflows supported within SQL batches
Fedora / Linux Setup
Start by installing required system packages:
sudo dnf install -y python3 python3-pip nodejs npmPython 3.12 or later is required. Use pyenv or similar if managing multiple versions.
Virtual Environment Setup
From the project root, create and activate a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .Environment Variables
Copy the example configuration and populate PostgreSQL connection details:
cp .env.example .envRequired:
DB_HOST— PostgreSQL server hostnameDB_NAME— Database nameDB_USER— Database usernameDB_PASSWORD— Database password
Optional (tuning):
DB_PORT— Connection port (default: 5432)DB_SSLMODE— SSL mode (default: prefer)DB_APPLICATION_NAME— Application identifierDB_QUERY_TIMEOUT_SECONDS— Query timeout (default: 30)DB_MAX_ROWS— Maximum rows per result set (default: 100)DB_MAX_RESULT_SETS— Maximum result sets per batch (default: 5)DB_OBJECT_PREVIEW_CHARS— Max definition preview length (default: 4000)
Example local development:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=app_dev
DB_USER=app_user
DB_PASSWORD=your-secure-password
DB_SSLMODE=preferOptional: HTTP Request Tuning
The HTTP tool takes a full URL per call and does not require API profile configuration.
Supported environment settings:
Variable | Purpose |
| HTTP request timeout |
| Max response bytes returned by HTTP tools |
|
|
Example call shape:
url: https://localhost:44331/api/breakouts/filter/1871161/dd-table?ParameterSetId=231022
method: GETFor authenticated calls, set API_BEARER_TOKEN in .env (or process env). HTTP tools automatically use it.
Run Locally
After activating the virtual environment and installing dependencies, start the MCP server with either command:
workbench-mcppython -m workbench_mcp.serverMCP Inspector
For local MCP development and debugging, the MCP Inspector provides a fast manual test loop:
npx @modelcontextprotocol/inspector .venv/bin/python -m workbench_mcp.serverTo launch the MCP server under debugpy for breakpoint debugging in the Inspector:
npx @modelcontextprotocol/inspector .venv/bin/python -m debugpy --listen 127.0.0.1:5678 -m workbench_mcp.serverAfter launch, open the Inspector UI, connect over STDIO, and test tools such as health, describe_object, and exec_proc_preview.
Breakpoints (debugpy): Use port 5678 for the debugger, not 6274 (6274 is only the Inspector web UI). Step-by-step workflow and “what was wrong before” are in docs/DEBUG_MCP.md.
VS Code Setup
To register the local MCP server in VS Code, add an entry to the workspace MCP configuration file:
Workspace file:
.vscode/mcp.json
Example configuration:
{
"servers": {
"workbench-mcp": {
"type": "stdio",
"command": "/absolute/path/to/workbench-mcp/.venv/bin/python",
"args": ["-m", "workbench_mcp.server"]
}
}
}Replace the command path with the local repository path to your virtual environment Python.
Secrets and Environment Values
You can supply environment values in either place:
workbench-mcp/.envenvin.vscode/mcp.json— VS Code injects these into the MCP server process.
Precedence: process environment (including .vscode/mcp.json → env) overrides values from .env for the same key.
Example with HTTP tuning in VS Code:
{
"servers": {
"workbench-mcp": {
"type": "stdio",
"command": "/absolute/path/to/workbench-mcp/.venv/bin/python",
"args": ["-m", "workbench_mcp.server"],
"env": {
"API_TIMEOUT_SECONDS": "30",
"API_MAX_RESPONSE_BYTES": "2097152",
"API_VERIFY_SSL": "false"
}
}
}
}Do not commit real tokens. Prefer a local-only workspace configuration or omit env and use .env (which should stay out of git).
If other MCP servers are already configured, add workbench-mcp inside the existing servers object instead of replacing the entire file.
After saving .vscode/mcp.json, reload VS Code or refresh MCP servers so the new server is discovered. After the server loads, run the health tool before testing database procedures.
Initial Tools
healthdescribe_objectlist_tables_and_columnspreview_queryexecute_readonly_sqlexec_proc_previewexec_function_previewinsert_rowinsert_rowshttp_gethttp_headhttp_posthttp_puthttp_patchhttp_deleteexecute_path_bash_script(script name resolved viaPATH)
Safety Model
Persistent DDL and DML are blocked in ad-hoc PostgreSQL batches
Only temp-table writes are allowed, and only for temp tables created in the current batch
preview_queryallows onlySELECTstatements and CTE-based readsexec_proc_previewcan execute PostgreSQL procedures and functions; overloaded routines should be passed with a signature such aspublic.my_func(integer, text)execute_path_bash_scriptonly accepts script names (not paths), resolves them viaPATH, and executes throughbash
Suggested First Checks
After .env is configured, a typical validation flow is:
Describe the function, procedure, table, or view to inspect.
Preview the supporting configuration or reference data needed to understand that object.
Run
exec_proc_preview,preview_query, orexecute_readonly_sqlwith known inputs.Compare the returned shape with the feature, investigation, or debugging scenario being evaluated.
Function Execution Example
For positional PostgreSQL function calls, use exec_function_preview.
Pass PostgreSQL arrays as normal JSON lists.
Example SQL target:
select * from sales."Fn_GetSalesChamps"(2, 2025, array[1,2,5,6,7,8,9,10,11,12,15,16,18,19], 5);Equivalent MCP tool input:
{
"function_name": "sales.\"Fn_GetSalesChamps\"",
"parameters": [2, 2025, [1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 18, 19], 5]
}Insert Examples
Single row insert:
{
"table_name": "sales.orders",
"row": {
"customer_id": 10,
"status": "new"
},
"returning_columns": ["order_id"]
}Batch insert:
{
"table_name": "sales.orders",
"rows": [
{"customer_id": 10, "status": "new"},
{"customer_id": 11, "status": "pending"}
]
}This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/antonov2010/mcp-dev'
If you have feedback or need assistance with the MCP directory API, please join our Discord server