
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
bollard-mcp
Advanced tools
AI-powered, safe database access layer for MCP clients (Cursor, VS Code, Claude Desktop)
An AI-powered, safe database access gateway built on the Model Context Protocol (MCP).
Bollard acts as an intelligent execution proxy between your AI code assistant (Cursor, VS Code, Windsurf, Claude Desktop, OpenAI Codex) and your physical databases — providing safe query execution, dynamic schema discovery, cost-based risk parsing, data leak prevention, and session memory.
Bollard sits as a transparent intermediary layer between your AI development client and your target database. When the client executes database tools, the requests are statically evaluated, authorized, and structured to optimize context window tokens before the database engine sees them.
| Workflow Aspect | Before Bollard (Direct SQL Assistant) | With Bollard (Safe Database Gateway) |
|---|---|---|
| Schema Context | Relies on manually pasted schema blocks, leading to hallucinated queries on outdated schemas. | Inspects schemas dynamically, caching metadata and profiles to feed the LLM accurate context. |
| Execution Safety | AI directly runs generated queries. High risk of accidental data modification, deletion, or drops. | Risk levels (LOW to EXTREME) are computed statically. Destructive operations are safely blocked. |
| Human-in-the-Loop | None. Large batch updates or structural migrations execute immediately without warnings. | Write queries require double confirmation (confirming query matching phrases and typing local PINs). |
| Data Leak Prevention | AI can query any table, including sensitive tables (e.g., password hashes, user secrets, API keys). | Access control lists block sensitive tables via connection-level blocklist wildcards. |
| Token & Context Usage | Large queries return massive raw rows, flooding the context window and wasting thousands of tokens. | Large queries are compressed into structured summaries with a 10-row preview and column stats (up to 97% token savings). |
| Correction Loop | No memory of past mistakes. AI repeats the same syntax/query errors in new sessions. | Custom fixes and deprecated field overrides are persisted and auto-injected as agent instructions. |
Bollard is written in Python and is available on PyPI:
pipx install bollard-mcp
pip install bollard-mcp
bollardcommandbollard-mcp (or the absolute path to bollard-mcp or python inside your virtualenv, e.g., python -m bollard_mcp.server)Or edit your Cursor config file directly (~/.cursor/mcp.json):
{
"mcpServers": {
"bollard": {
"command": "bollard-mcp"
}
}
}
Add the configuration to your Cline settings file (located at %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json on Windows):
{
"mcpServers": {
"bollard": {
"command": "bollard-mcp"
}
}
}
Add the configuration under your global Windsurf MCP configuration file (~/.codeium/windsurf/mcp_config.json):
{
"mcpServers": {
"bollard": {
"command": "bollard-mcp"
}
}
}
Add the configuration to your Claude Desktop config file (%APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"bollard": {
"command": "bollard-mcp"
}
}
}
Add the server block under the [mcp_servers] table in your Codex configuration file (~/.codex/config.toml):
[mcp_servers.bollard]
command = "python" # or "bollard-mcp" if installed globally via pipx
args = ["-m", "bollard_mcp.server"]
cwd = "/path/to/your/bollard-mcp"
💡 Write Operations in Standalone Clients: In standalone clients (like OpenAI Codex or Claude Desktop) that do not run the editor helper extension, Bollard automatically falls back to an In-Chat PIN Gate. When the AI attempts a write query, the server will block execution, generate a local 4-digit verification PIN, and print it directly in the chat. You simply need to copy-paste this PIN back into the chat prompt to authorize and execute the write query safely.
Once Bollard is registered, prompt your AI agent inside your chat client to connect.
"Connect to my local database with alias
local_postgresand connection stringpostgresql://postgres:postgres@localhost:5432/dbcopilot"
"Connect to local database with alias
local_postgresatpostgresql://postgres:postgres@localhost:5432/dbcopilotand forbid access touser_secrets"
If you are testing database safety gates locally using a Docker PostgreSQL container:
docker psusers, orders, user_secrets) by running our seeding script:
python examples/create_postgres_test_db.py
user_secrets to verify the blocklist intercepts the request).Bollard is dual-licensed under:
pavakstudio@gmail.com.FAQs
AI-powered, safe database access layer for MCP clients (Cursor, VS Code, Claude Desktop)
We found that bollard-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.