Two local MCP architectures
| Transport | Database state | Use it when | Main limit |
|---|---|---|---|
| Viewer loopback HTTP | Shares the GUI's current Direct or Server connection | Viewer is open and the client accepts URL-based JSON-RPC | No authentication; loopback only |
| Viewer stdio | Child process opens its own Direct or Server connection | The IDE or model client manages subprocesses | Direct mode cannot share a root already exclusively locked by the GUI |
The HTTP route is a direct POST JSON-RPC endpoint. It does not implement full streamable-HTTP sessions or a complete SSE event stream. Clients requiring those details should use stdio or an explicit compatibility bridge.
Use the in-app loopback server
- Open MongrelDB Viewer and connect a database.
- Open MCP, choose a port, and start the listener.
- Copy the displayed
http://127.0.0.1:<port>/mcpURL into the model client. - Stop MCP separately when the session is finished.
{
"mcpServers": {
"mongreldb-viewer": {
"url": "http://127.0.0.1:7337/mcp"
}
}
}Viewer binds the public desktop form to 127.0.0.1. Any local process that can reach that port can invoke tools, so host-level trust still matters.
Use stdio for client-managed isolation
{
"mcpServers": {
"mongreldb-viewer": {
"command": "/absolute/path/to/mongreldb-viewer",
"args": ["--mcp-stdio"],
"env": {
"MONGRELDB_VIEWER_PATH": "/absolute/path/to/database-root"
}
}
}
}For daemon access, set MONGRELDB_VIEWER_SERVER instead. Optional bearer or basic-auth environment variables support the server connection. Do not commit database passwords or tokens to an IDE settings repository.
mongreldb-server for multi-client access.What the model can do
The Viewer tool surface includes database overview, table listing and description, SQL execution, semantic search, and related database operations. SQL, Agent, and MCP are not inherently read-only. DDL, DML, REINDEX, and index work can alter the database when the active connection permits it.
Use a disposable fixture first. For sensitive data, connect with a principal whose row, column, and operation permissions match the task. A prompt instruction such as “never write” is not an authorization boundary.
Security checklist
- Keep in-app HTTP on loopback and behind a trusted OS user session.
- Prefer a least-privilege server identity for model-driven exploration.
- Do not place API keys, database tokens, or passphrases in prompts.
- Review what table samples and tool results a remote model provider receives.
- Close Viewer to clear the in-memory Agent API key.
- Back up and test restore before allowing write-capable tools near important data.
- Use synthetic data when testing a new model client or MCP bridge.
Why this pairs well with a local vector database
Model clients often need more than nearest neighbors. They need schema discovery, exact filters, SQL, text constraints, and provenance. MongrelDB keeps dense ANN, sparse retrieval, substring, equality, and range candidates in one RowId model; Viewer exposes that database context through one tool process.
This is most useful for local RAG, agent memory, developer datasets, and offline inspection. It is not a replacement for an authenticated public MCP gateway or a multi-tenant authorization service.
MongrelDB Viewer
Free, open source, cross-platform, and able to connect directly or through mongreldb-server.
Mongrel by VisorCraft
Use Mongrel when database work also involves API calls, terminals, files, containers, Kubernetes, or one of 30+ supported engines.