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

@connect_workbench/mcp-core

v0.1.0

Published

Framework-agnostic multi-database core: config, SQL parsing, column type decoding, output formatting and MySQL runtime (no MCP dependency)

Readme

@connect_workbench/mcp-core

框架无关的多数据库核心(TypeScript),复刻 mysql-multi-mcp-rs 的核心逻辑。不依赖任何 MCP 协议库,可被 MCP 适配层或任意 TS 项目(如 VS Code 插件)复用。

能力

  • 配置:多连接配置、output_format(json / markdown / table)、cell_max_width、blocked_statements
  • SQL 解析与拦截:首 token 提取、跳过注释/括号、只读判定、SHOW CREATE 识别、黑名单拦截(默认 DELETE / DROP / TRUNCATE)
  • 类型解码:BIGINT→字符串、DECIMAL→字符串、DATETIME→YYYY-MM-DD HH:MM:SS、JSON→原生对象、BIT(1)→bool、BLOB→utf8/hex
  • 格式渲染:json(去 columns 冗余)/ markdown 管道表 / MySQL CLI 同款 ASCII 表,超长单元格截断 + 溢出补发
  • 运行时:mysql2 懒加载连接池、参数化 execute、元数据查询(listDatabases / listTables / describeTable)、参数化分页 selectPage、配置热重载

安装

npm install @connect_workbench/mcp-core

快速开始

import { createRuntime } from '@connect_workbench/mcp-core';

const runtime = createRuntime({
  outputFormat: 'json',
  connections: [
    { name: 'dev', host: '127.0.0.1', port: 3306, username: 'root', password: '***', database: 'app' },
  ],
});

// 自由 SQL(危险语句会被拦截)
const result = await runtime.execute('dev', 'SELECT * FROM users LIMIT 5', { format: 'markdown' });
console.log(result.contents); // ['| id | name |...']

// 参数化单表分页
const page = await runtime.selectPage('dev', 'app', 'users', 0, 50, {
  filters: [{ field: 'status', operator: '=', value: 'active' }],
  sort: { field: 'id', direction: 'desc' },
});

await runtime.close();

配置

interface ConnectionConfig {
  name: string;                 // 唯一标识(工具名后缀 / execute 目标)
  description?: string;         // 描述(用于 MCP 工具描述)
  host: string;
  port: number;
  username: string;
  password: string;             // 明文密码:由调用方在初始化前完成解密
  database?: string;            // 连接默认库(可选)
  blockedStatements?: string[]; // 默认 ['DELETE','DROP','TRUNCATE']
  useSsl?: boolean;             // 默认 true
}

顶层 outputFormat(json / markdown / table)与 cellMaxWidth(默认 200)为全局默认,execute 可用 format 参数临时覆盖。

License

MIT