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

db-schema-explorer-mcp

v1.0.1

Published

MCP server for exploring SQL Server database schemas

Readme

db-schema-explorer-mcp

MCP server for exploring SQL Server database schemas. Exposes two tools over the Model Context Protocol (stdio transport).

The server accepts a SQL Server connection string via environment variable (recommended) or CLI argument. Both Server= and Data Source= style connection strings are supported.

Tools

get_tables

List table names in the database.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | nameFilter | string | No | Partial match filter for table names |

get_table_schema

Get detailed schema for a specific table.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | tableName | string | Yes | Exact table name to inspect |

Returns columns (name, data type, max length, nullability) and foreign keys (column, referenced table, referenced column, constraint name).

MCP Client Configuration

Claude Desktop

Add to claude_desktop_config.json (located at %APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS):

{
  "mcpServers": {
    "db-schema-explorer": {
      "command": "npx",
      "args": ["-y", "db-schema-explorer-mcp"],
      "env": {
        "DB_CONNECTION_STRING": "Server=...;Database=...;User Id=...;Password=...;TrustServerCertificate=True"
      }
    }
  }
}

OpenCode

Add to .opencode/mcp.json in your project root:

{
  "mcpServers": {
    "db-schema-explorer": {
      "command": "npx",
      "args": ["-y", "db-schema-explorer-mcp"],
      "env": {
        "DB_CONNECTION_STRING": "Server=...;Database=...;User Id=...;Password=...;TrustServerCertificate=True"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "db-schema-explorer": {
      "command": "npx",
      "args": ["-y", "db-schema-explorer-mcp"],
      "env": {
        "DB_CONNECTION_STRING": "Server=...;Database=...;User Id=...;Password=...;TrustServerCertificate=True"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your project root:

{
  "servers": {
    "db-schema-explorer": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "db-schema-explorer-mcp"],
      "env": {
        "DB_CONNECTION_STRING": "Server=...;Database=...;User Id=...;Password=...;TrustServerCertificate=True"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "db-schema-explorer": {
      "command": "npx",
      "args": ["-y", "db-schema-explorer-mcp"],
      "env": {
        "DB_CONNECTION_STRING": "Server=...;Database=...;User Id=...;Password=...;TrustServerCertificate=True"
      }
    }
  }
}

Development

npm install
npm run build
node dist/index.js

Connection string via environment variable

# Linux / macOS
DB_CONNECTION_STRING="Server=localhost;Database=MyDb;User Id=sa;Password=xxx;TrustServerCertificate=True" node dist/index.js

# Windows (cmd)
set "DB_CONNECTION_STRING=Server=localhost;Database=MyDb;User Id=sa;Password=xxx;TrustServerCertificate=True"
node dist/index.js

Connection string via CLI argument

node dist/index.js "Server=localhost;Database=MyDb;User Id=sa;Password=xxx;TrustServerCertificate=True"

Note: On Windows, semicolons in connection strings can cause issues with shell argument parsing. Prefer the environment variable approach.

Testing

1. MCP Inspector (interactive UI)

The easiest way to test. Create an inspector-config.json file:

{
  "mcpServers": {
    "db-schema-explorer": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {
        "DB_CONNECTION_STRING": "Server=localhost;Database=MyDb;User Id=sa;Password=xxx;TrustServerCertificate=True"
      }
    }
  }
}

Then run:

npx @modelcontextprotocol/inspector --config inspector-config.json --server db-schema-explorer

This opens a browser UI where you can call both tools interactively and see the JSON responses.

2. Raw JSON-RPC (quick smoke test)

echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node dist/index.js "Server=localhost;Database=MyDb;User Id=sa;Password=xxx;TrustServerCertificate=True"

A successful response looks like:

{"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true}},"serverInfo":{"name":"db-schema-explorer","version":"1.0.0"}},"jsonrpc":"2.0","id":1}

3. No-database smoke test

node dist/index.js

Should print the usage message and exit with code 1.