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

gbizinfo-mcp

v0.5.1

Published

gBizINFO 情報提供 API を TypeScript ライブラリおよび Model Context Protocol サーバーとして提供します。サービス層で gBizINFO を呼び出し、MCP では各種取得・検索機能をツールとして公開します。

Downloads

13

Readme

gBizINFO MCP (JavaScript)

gBizINFO 情報提供 API を TypeScript ライブラリおよび Model Context Protocol サーバーとして提供します。サービス層で gBizINFO を呼び出し、MCP では各種取得・検索機能をツールとして公開します。

要件

  • Node.js 18+(fetch を使用)

セットアップ

  1. 依存関係をインストール

    npm i
  2. .env をプロジェクトルートに作成し、以下を設定

    GBIZINFO_API_TOKEN=あなたのAPIトークン
    # 任意(デフォルト: https://info.gbiz.go.jp/hojin/v1/hojin)
    GBIZINFO_BASE_URL=https://info.gbiz.go.jp/hojin/v1/hojin
    # 任意(ミリ秒, 既定 15000)
    REQUEST_TIMEOUT_MS=15000
    # 任意(リトライ回数, 既定 1)
    GBIZINFO_RETRIES=1

メモ:

  • 認証ヘッダは仕様通り X-hojinInfo-api-token が自動付与されます(src/services/http.ts)。

OpenAPI スキーマとクライアント生成(任意)

公式 Swagger UI からスキーマを取得し、必要に応じて TypeScript クライアントを生成できます。

  1. Swagger UI から JSON を取得し openapi/raw/gbizinfo-openapi.json へ保存

  2. YAML に変換し openapi/gbizinfo-openapi.yaml へ保存

  3. クライアント生成

     npm run generate:client

    生成先: src/clients/gbizinfo(入力: ../openapi/gbizinfo-openapi.json

ライブラリの使い方

GbizinfoService を直接利用できます。

import { GbizinfoService } from "gbizinfo-mcp";

const service = new GbizinfoService();

// 企業検索(複合条件)
const result = await service.searchCompanies({
  name: "テスト",
  prefecture: "東京都",
  page: 1,
  limit: 20,
});

// 法人番号で詳細取得
const basic = await service.getBasicInfo("0000000000000");

エクスポートは src/index.ts を参照(GbizinfoService, HttpClient, presenters, models など)。

MCP サーバーの使い方

ローカル実行(Cursor 連携)

  1. ビルド

    npm run build
  2. Cursor 設定(Settings → MCP → Add Server)

    • Type: Command
    • Command: node
    • Args: dist/mcp/server.js
    • Working Directory: プロジェクトルート
    • Environment: GBIZINFO_API_TOKEN=...

npx で起動(公開後)

npx --yes -p gbizinfo-mcp gbizinfo-mcp

提供ツール

  • search: 企業検索(複合条件: name/corporateNumber/corporateType/existFlg/prefecture/city/address/industry/capitalStockFrom/capitalStockTo/employeeNumberFrom/employeeNumberTo/establishmentFrom/establishmentTo/from/size
  • get_basic_info: 基本情報取得(法人番号)
  • get_certification: 届出・認定情報
  • get_commendation: 表彰情報
  • get_finance: 財務情報
  • get_patent: 特許情報
  • get_procurement: 調達情報
  • get_subsidy: 補助金情報
  • get_workplace: 職場情報

開発

  • ウォッチ実行(簡易ランナー)

    npm run dev
  • ビルド

    npm run build

設計(MCP アーキテクチャ)

  • エントリポイント: src/index.ts
  • 環境/設定: src/config.ts
  • MCP サーバー: src/mcp/server.ts
  • 層構造:
    • Model: src/model
    • Controller: src/controller
    • Presenter: src/presenter
    • Service: src/services

セキュリティ/設定、OpenAPI クライアント生成の詳細は .cursor/rules のルール(openapi-client など)を参照してください。