Install Pg Readonly in LM Studio
What you need first
- LM Studio, installed.
- uv, which
gives the
uvxcommand the server starts with. - Your own value for
YOUR_PG_READONLY_MCP_DSN.
Steps
- In LM Studio, open the Program tab and choose Install › Edit mcp.json.
- Add this block. If the file already has
mcpServers, add only the entry inside it.
{
"mcpServers": {
"pg-readonly-mcp": {
"command": "uvx",
"args": ["pg-readonly-mcp==0.1.1"],
"env": { "PG_READONLY_MCP_DSN": "YOUR_PG_READONLY_MCP_DSN" }
}
}
} - Replace
YOUR_PG_READONLY_MCP_DSNwith your own value. - Save the file and restart LM Studio.
Check it worked
Ask LM Studio: List the tools of pg-readonly-mcp.
If it does not start
- spawn uvx ENOENT
- uv is not on the PATH that LM Studio sees. Install it, or write the
full path of
uvxin the config. - The server starts, but its tools fail
- A
YOUR_…placeholder is still in the config, or its value is wrong. - Nothing changes after a restart
- The file is not valid JSON any more. Look for a missing comma where the block was added.