cowork-data-bridge
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cowork-data-bridge
An MCP server that lets Claude Cowork (or any MCP client) ask natural-language
questions about a project's data. Each question is answered by Claude Code
running headless (claude -p) with the project's repository as context
(schema, domain docs) and a read-only database connection.
Why: a database connector alone does not know what the tables mean. The project's code and docs do. This bridge gives the answering agent both, and keeps each project's connection details out of version control.
How it works
server.mjs MCP server (stdio) and a small CLI
lib.mjs project discovery, argument building, runner
projects/_example/ template for a project addon (committed)
projects/<name>/ your project addons (gitignored)
docs/adding-a-project.mdA project addon is a folder with these files:
File | Purpose |
|
|
| Database MCP server for Claude Code. Default: Postgres MCP Pro in restricted mode, with |
| Dependency overrides that let |
| Executable. Opens a read-only connection, exports |
| Required. Instructions for the analyst agent: read-only rules, where the schema lives, how to answer. |
postgres-mcp==0.3.0 pins pglast==7.2.0, which is no longer on PyPI, and
it breaks with mcp 2.x, which removed FastMCP. The overrides file pins
compatible versions (pglast>=7.20,<8, mcp[cli]>=1.5,<2), and
uvx --python 3.12 picks a Python that has wheels for them. Restricted mode
still allows SELECT and blocks DROP, COMMIT; DELETE ... and
SET default_transaction_read_only=off with these versions. The path is
relative: Claude Code starts MCP servers in its working directory, which is
the addon folder.
Tools exposed over MCP:
list_projects: name and description of every addon folder that has aproject.json(folders starting with_or.are skipped).ask(project, question): runs, with the addon folder as working directory:<addon>/connect.sh claude -p <question> --output-format json --mcp-config <addon>/mcp.json --strict-mcp-config --append-system-prompt-file <addon>/CLAUDE.md --add-dir <repo> --allowedTools Read,Grep,Glob,<db tools> --tools Read,Grep,Glob,<db tools> --disallowedTools Bash,Write,Edit,NotebookEdit,WebFetch,WebSearch,Agent,<secret files> --permission-mode dontAsk --restricted --no-session-persistence --max-turns <n>and returns the answer text.
<db tools>isallowedToolsfromproject.json, ormcp__<server>__*for every server inmcp.json.<secret files>denies.env*,*.pemand*.keyfiles in the repository and the addon folder (see Security notes). Failures (connect script error, non-zero exit, error result, unparsable output, timeout, cancellation) come back as MCP tool errors with the last 2 KB of stderr, withpostgres://URLs and IPv4 addresses redacted. On success, stderr lines starting withWARNING(for example a cleanup that failed) are appended to the answer under "Bridge warnings", redacted the same way. Questions for the same project run one at a time. When the client cancels a call (or its request times out and it sends a cancellation), the run is stopped and the next queued question starts. When the client sends a progress token, a progress notification is sent every 15 seconds.
Related MCP server: rbac-rag-assistant
Setup
Requirements: Node.js 20 or later, Claude Code
installed and logged in (claude on the PATH), and
uv for uvx if you use the default Postgres MCP
server. Plus whatever your connect.sh needs (a cloud CLI, curl, a VPN...).
git clone <this repo> /path/to/cowork-data-bridge
cd /path/to/cowork-data-bridge
npm install
npm testAdd a project (see docs/adding-a-project.md), then check it from a terminal:
node server.mjs list
node server.mjs ask <project> "How many active users last week?"Register in Claude Desktop / Cowork
Edit claude_desktop_config.json (macOS:
~/Library/Application Support/Claude/claude_desktop_config.json) and restart
Claude Desktop:
{
"mcpServers": {
"data-bridge": {
"command": "/path/to/node",
"args": ["/path/to/cowork-data-bridge/server.mjs"],
"env": {
"PATH": "/path/to/node-bin-dir:/path/to/claude-bin-dir:/path/to/uvx-bin-dir:/path/to/cloud-cli-bin-dir:/usr/bin:/bin"
}
}
}
}Use absolute paths. Apps started from the macOS Dock do not get your shell's
PATH, so PATH must list every directory that holds a program the chain
needs: node, claude, uvx, and anything connect.sh calls (a cloud CLI,
curl, psql...). Find them with which node claude uvx curl.
Optional environment variables:
Variable | Default | Meaning |
|
| Folder that holds the project addons. Use it to keep addons outside this repository. |
|
| Claude Code executable. |
|
| Time limit per question. |
When a question times out, is cancelled, or the server shuts down, the whole
process group of that run gets SIGTERM, then SIGKILL 30 seconds later if
anything is still running. A trap in connect.sh has that time to close
the connection.
Security notes
Read-only is enforced in layers, none of them perfect on its own:
connect.shshould open a read-only session (for examplePGOPTIONS="-c default_transaction_read_only=on", a read-only database role, or a replica) and refuse to run if it cannot.The database MCP server runs in restricted mode (
--access-mode=restrictedfor Postgres MCP Pro).Claude Code only gets
Read,Grep,Globand the database tools; shell, file editing, web and subagents are disallowed, anddontAskdenies anything not pre-approved.The addon's
CLAUDE.mdtells the analyst to run onlySELECT.
What the analyst can read:
Files: only inside the addon folder and the project repository.
--restrictedconfinesRead,GrepandGlobto those two working directories, so files elsewhere on disk (cloud CLI token caches, SSH keys, other repositories) are refused. Inside them,.env*,*.pemand*.keyfiles are denied for all three tools. Everything else in those two folders is readable, so keep other secrets out of them.Database: whatever the database user can read.
Context: with
--restricted, Claude Code ignores user, project and local settings files (including hooks, permission rules,envandapiKeyHelper) and does not loadCLAUDE.mdmemory files. The analyst gets the addon'sCLAUDE.mdthrough--append-system-prompt-file. The bridge repository still has no rootCLAUDE.mdas a precaution.
Limits to be aware of:
Rules about personal data, secrets and message content are prompt instructions only. There is no column masking and no audit log, and answers go to the MCP client.
Output filtering is limited to redacting
postgres://URLs (and IPv4 addresses in stderr-derived text).The analyst inherits the server's environment variables.
Questions use your Claude Code login and count towards its usage. Because settings files are ignored, authentication must come from the normal login (or
ANTHROPIC_API_KEYin the environment), not fromapiKeyHelper.
Known limits
Whether Claude Cowork can reach a local stdio MCP server registered in Claude Desktop is not confirmed. The server works with any MCP client that runs local stdio servers.
MCP clients have their own tool-call timeouts. A long question may be cut off by the client even though progress notifications are sent.
One question at a time per project; no memory between
askcalls.The per-project queue lives in one bridge process. Do not ask about the same project from the CLI while an MCP client (such as Claude Desktop) is also asking: two runs can interfere, for example one run's cleanup closing access the other still uses.
A connect script that opens temporary access (such as a firewall rule) can leave it open if its cleanup is cut short by the
SIGKILLescalation, or if the run is killed while the access is being created. Write the script so the next run reclaims anything it left behind, and have it print a line starting withWARNINGto stderr when cleanup fails so the answer shows it.If the server is killed outright (
SIGKILL), runs in progress are not stopped: they continue in their own process group until Claude Code finishes (bounded by--max-turns), andconnect.shcleans up then.--max-turnsand--append-system-prompt-fileare accepted by Claude Code (verified with 2.1.326) but not listed inclaude --help.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Query OneLens cloud-cost data in natural language: breakdowns, trends, cost centers. Read-only.
Ask your Quickbase apps in plain language. Read-only by default; writes need human approval.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables natural-language querying of Postgres and MongoDB databases in read-only mode, with PII masking and row/timeout guardrails, from any MCP client.-
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to ask plain-language questions and receive answers grounded only in documents the configured role is cleared to read, with the same access-controlled tools available across any client.-
- AlicenseAqualityBmaintenanceEnables querying SQLite databases in plain language through MCP, letting clients like Claude Code inspect schemas and run read-only SQL.31MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to ask bilingual data questions, inspect database tables and schemas, and execute validated read-only SQL through exposed tools.MIT