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

bigquery-mcp-js

v0.1.5

Published

Standalone Node/TypeScript MCP server for BigQuery. Shares a tool contract with the Python bigquery-mcp server.

Downloads

159

Readme

bigquery-mcp-js

A standalone Node/TypeScript MCP server for BigQuery, using the official @google-cloud/bigquery client. It is independent of the Python bigquery-mcp server; the two share a tool contract (contract/tools.json) so their tools, inputs, and outputs stay identical.

Install & build

Uses Bun for install, build, and tests (the build targets Node and runs under either runtime).

bun install
bun run build      # bun build -> dist/index.js (deps + contract inlined, skill copied)
bun run test       # bun:test (sqlSafety + contract output validation)
bun run typecheck  # tsc --noEmit

Run

node dist/index.js --project YOUR_PROJECT --location US
# during development:
bun ./src/index.ts --project YOUR_PROJECT --location US

Options: --project, --location, --key-file, --datasets a,b,c. Configuration also comes from the same environment variables as the Python server (GCP_PROJECT_ID, BIGQUERY_LOCATION, GOOGLE_APPLICATION_CREDENTIALS, BIGQUERY_ALLOWED_DATASETS, BIGQUERY_MAX_BYTES_BILLED, BIGQUERY_SAMPLE_ROWS*).

Tools

list_dataset_ids, get_dataset_info, list_table_ids, get_table_info, dry_run_query, execute_sql — defined once in contract/tools.json. Names follow Google's BigQuery MCP conventions; dry_run_query is the only own addition with no Google equivalent.

How the contract drives this server

  • src/contract.ts loads contract/tools.json (bundled at build time) and turns each tool's input schema into a zod shape.
  • src/tools/register.ts iterates the contract and registers each tool, wiring it to the handler in src/tools/handlers.ts.
  • src/bigquery.ts (BigQueryService) performs the actual BigQuery calls.
  • src/test/contract.test.ts validates each tool's output against the contract's output schema using a mocked BigQuery client.

To add a tool: edit contract/tools.json, add a handler in src/tools/handlers.ts, and run bun run test. See the repo's ARCHITECTURE.md.

Bundled agent skills & agents

The build (scripts/copy-agent-assets.ts) copies the portable Agent Skills and agent definitions from the repo root (.agents/skills/ and .agents/agents/) into dist/skills/... and dist/agents/..., so they ship with the npm package:

  • skills: bigquery-cost-first-querying, secure-context-reducer
  • agents: bigquery-table-analyst, cost-first-compliant-agent

See the repo's ARCHITECTURE.md.