npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@conte777/db-view-mcp

v1.3.1

Published

MCP server for database access (PostgreSQL + ClickHouse)

Readme

db-view-mcp

An MCP server that gives AI assistants direct access to PostgreSQL and ClickHouse databases. It supports both stdio and HTTP transports, for local IDE integration and remote network access.

Features

  • Multi-database — connect any number of PostgreSQL and ClickHouse instances at once
  • Dual transport — stdio for IDE integration (Cursor, Claude Code), HTTP for remote/multi-client access
  • Read & write tools — SELECT with row limits, INSERT/UPDATE/DELETE, DDL, transactions
  • Schema introspection — list tables, describe columns, export full DDL
  • Query analysis — EXPLAIN / EXPLAIN ANALYZE, slow-query tracking
  • SQL safety — read-only tools validate SQL and block accidental writes
  • Flexible tool modes — one tool with a database parameter, or a separate tool per database
  • Lazy connections — databases connect on first use by default
  • Bearer auth — optional token authentication for the HTTP transport
  • Session management — stateful (per-session MCP server) or stateless HTTP mode

Install

npm install @conte777/db-view-mcp

Or clone and build from source:

git clone <repo-url>
cd db-view-mcp
npm install
npm run build

Quick start

1. Configure

Copy the example config and edit it:

cp config.example.json config.json

Minimal stdio config:

{
  "databases": [
    {
      "id": "main_pg",
      "type": "postgresql",
      "host": "localhost",
      "port": 5432,
      "database": "myapp",
      "user": "admin",
      "password": "secret123"
    }
  ]
}

Every field, default, and the full config reference (SSL/TLS, per-database overrides, environment substitution, HTTP transport) is in docs/configuration.md.

2. Run

# Stdio (default)
npm start -- --config config.json

# HTTP (set transport.type to "http" in config, or override on the CLI)
npm start -- --config config.json --transport http

# Development (no build needed)
npm run dev -- --config config.json

3. Add an MCP client

Claude Desktop (claude_desktop_config.json) or Claude Code (.mcp.json), stdio:

{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "@conte777/db-view-mcp", "--config", "/path/to/config.json"]
    }
  }
}

Any MCP client, HTTP:

node dist/index.js --config config.json --transport http
# Server listens on http://127.0.0.1:3000/mcp

See docs/http-transport.md for sessions, auth, and curl examples.

Documentation

| Doc | Contents | |-----|----------| | docs/configuration.md | Every config field, defaults, SSL/TLS, rowFormat, env substitution, hot reload | | docs/tools.md | The 9 tools: params, output, examples, error codes, per-database mode | | docs/http-transport.md | stdio vs HTTP, sessions, bearer auth, /health, curl | | docs/security.md | Read-only SQL validator, deny-lists, response caps, network exposure | | docs/architecture.md | Source tree, layers, connector model, lifecycle (hot reload, shutdown) | | CONTRIBUTING.md | Build, test, lint, hooks, CI |

ClickHouse limitations

  • Transactions are not supported (transaction begin throws).
  • Query params are ignored — use ClickHouse's native {name:Type} syntax in the SQL.

Development

See CONTRIBUTING.md for build/test/lint commands, coverage thresholds, git hooks, and CI.

License

MIT