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

@mcpolyglot/client

v0.1.0

Published

Typed client for a running mcpolyglot HTTP server: list tables and run policy-checked queries from plain TypeScript, outside an MCP host.

Readme

@mcpolyglot/client

Typed client for a running mcpolyglot HTTP server. Use it from scripts, backends, or tests that want policy-checked database access without an MCP host. Every call goes through the same server pipeline an agent's would: scopes, policy, redaction, rate limit, audit.

npm i @mcpolyglot/client
import { McpolyglotClient, McpolyglotDeniedError } from '@mcpolyglot/client';

const db = await McpolyglotClient.connect('http://127.0.0.1:7337/mcp', {
  token: process.env.MCPOLYGLOT_TOKEN!,
  agentId: 'billing-report', // shows up as agentId in the audit log
});

const tables = await db.listTables('bank'); // only what the policy exposes

const { rows } = await db.query<{ kind: string; balance_cents: string }>(
  'bank',
  'SELECT kind, balance_cents FROM accounts WHERE customer_id = $1',
  [1],
);

const { decision } = await db.query('bank', 'DELETE FROM accounts WHERE id = 1', [], {
  dryRun: true,
}); // { allow: false, reason: 'Table "accounts" is read-only ...', ... }

try {
  await db.query('bank', 'SELECT ssn FROM customers');
} catch (e) {
  if (e instanceof McpolyglotDeniedError) console.log(e.code, e.reason); // forbidden.policy ...
}

await db.close();

API

  • McpolyglotClient.connect(url, { token, agentId? }): url is the server's /mcp endpoint.
  • listTables(sourceId): TableInfo[], with hidden tables and denied columns already removed.
  • query<Row>(sourceId, sql, params?, { limit?, dryRun? }): QueryResult<Row>, or DryRunResult when dryRun: true. Row is a type assertion, not a runtime check.
  • McpolyglotDeniedError: thrown when the server refuses a call. code is forbidden.policy, forbidden.scope, rate_limited, or timeout; reason is the server's explanation.

Values arrive as the server serializes them. On Postgres, bigint and numeric come back as strings.

MIT licensed.