bizgate-mcp-server 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ // ---------- --install-skill サブコマンド ----------
3
+ if (process.argv.includes("--install-skill")) {
4
+ const { main: installSkill } = await import("./install-skill.js");
5
+ installSkill();
6
+ process.exit(0);
7
+ }
2
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
10
  import { z } from "zod";
@@ -198,7 +204,7 @@ server.tool("bizgate__company_search", "会社名または法人番号で企業
198
204
  }
199
205
  });
200
206
  // ---------- Tool 2: 部署検索 ----------
201
- server.tool("bizgate__department_search", "会社名または法人番号で部署情報(部署名・住所・電話番号・カテゴリ)を検索する。最大500件。都道府県・カテゴリ・部署名キーワードで絞り込み可能。デフォルトで上位30件を表示(limitで変更可能)。", {
207
+ server.tool("bizgate__department_search", "部署情報(部署名・住所・電話番号・カテゴリ)を検索する。会社名・法人番号での検索に加え、部署名キーワード(bKwd)やカテゴリ(cList)のみでの全企業横断検索も可能。最大500件。デフォルトで上位30件を表示(limitで変更可能)。", {
202
208
  shogo: z.string().optional().describe("会社名(例:株式会社○○)"),
203
209
  compno: z.string().optional().describe("法人番号(13桁)"),
204
210
  pList: z.string().optional().describe("都道府県コード(カンマ区切り。例: 13,14 = 東京都,神奈川県)"),
@@ -207,9 +213,13 @@ server.tool("bizgate__department_search", "会社名または法人番号で部
207
213
  bKOpr: z.string().optional().describe("キーワード結合演算子(0=OR(デフォルト), 1=AND)"),
208
214
  limit: z.number().optional().describe("表示する件数の上限(デフォルト: 30)"),
209
215
  }, async ({ shogo, compno, pList, cList, bKwd, bKOpr, limit }) => {
210
- const err = validateInput(shogo, compno);
211
- if (err)
212
- return { content: [{ type: "text", text: err }] };
216
+ // 部署検索: bKwd or cList があれば会社名なしでも検索可能
217
+ if (!shogo && !compno && !bKwd && !cList) {
218
+ return { content: [{ type: "text", text: "エラー: 会社名(shogo)、法人番号(compno)、部署名キーワード(bKwd)、カテゴリ(cList)のいずれかを入力してください。" }] };
219
+ }
220
+ if (compno && !/^\d{13}$/.test(compno)) {
221
+ return { content: [{ type: "text", text: "エラー: 法人番号は13桁の数字で入力してください。" }] };
222
+ }
213
223
  const displayLimit = limit ?? 30;
214
224
  try {
215
225
  const { docs, numFound } = await client.searchDepartments({
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export declare function main(): void;
@@ -43,19 +43,23 @@ allowed-tools: mcp__bizgate__bizgate__department_search, mcp__bizgate__bizgate__
43
43
  - サービスが指定されていない場合は「全部」として3サービスすべてをマッチングする
44
44
  - 会社名が不明な場合は \`AskUserQuestion\` で確認する
45
45
 
46
- ### Step 2: 部署情報を取得
47
- - \`bizgate__department_search\` で部署一覧を取得する(limit: 200)
48
- - 電話番号がある部署は電話番号も含める
46
+ ### Step 2: サービスごとに bKwd で部署を検索
47
+ \`bizgate__department_search\` \`bKwd\`(フリーワード部分一致)を使い、サービスごとに関連部署だけを取得する。
48
+ **3サービスの検索は並列で実行すること。**
49
49
 
50
- ### Step 3: サービスとマッチング
51
- 各サービスについて、以下の基準で部署をマッチングする:
50
+ #### 営業代行の検索
51
+ bKwd: "営業,販売,販促,マーケティング,事業開発,顧客"
52
52
 
53
- 1. **部署名にマッチキーワードが含まれるか** を確認
54
- 2. **部署のカテゴリ(ctg_01〜15)** も参考にする:
55
- - 営業代行 → ctg_02(営業企画), ctg_13(営業)
56
- - Solution → ctg_01(経営企画), ctg_05(総務), ctg_10(システム)
57
- - AI → ctg_01(経営企画), ctg_02(営業企画), ctg_10(システム)
58
- 3. キーワードマッチだけでなく、**部署の役割から判断** して適切な部署を選ぶ
53
+ #### Solutionの検索
54
+ bKwd: "ICT,システム,DX,情報,企画,総務,イノベーション,デジタル"
55
+
56
+ #### AIの検索
57
+ bKwd: "戦略,成長,事業創造,イノベーション,企画,開発,推進,DX,AI,ICT"
58
+
59
+ ### Step 3: 結果を精査
60
+ - 各検索結果から **明らかに関連のない部署を除外** する(例:「食品企画部」は営業代行には不適切)
61
+ - 重複する部署は統合し、どのサービスに関連するか整理する
62
+ - 各サービスにつき **最大5部署** に絞る
59
63
 
60
64
  ### Step 4: 結果を出力
61
65
  以下のフォーマットで出力する:
@@ -88,7 +92,7 @@ allowed-tools: mcp__bizgate__bizgate__department_search, mcp__bizgate__bizgate__
88
92
 
89
93
  $ARGUMENTS
90
94
  `;
91
- function main() {
95
+ export function main() {
92
96
  const existed = existsSync(join(SKILL_DIR, "SKILL.md"));
93
97
  mkdirSync(SKILL_DIR, { recursive: true });
94
98
  writeFileSync(join(SKILL_DIR, "SKILL.md"), SKILL_MD, "utf-8");
@@ -104,4 +108,8 @@ function main() {
104
108
  console.log(" /prospect-match 会社名");
105
109
  console.log(' または「○○にDigiManのサービスが売れそうな部署を探して」');
106
110
  }
107
- main();
111
+ // 直接実行された場合のみ実行
112
+ const isDirectRun = process.argv[1]?.endsWith("install-skill.js");
113
+ if (isDirectRun) {
114
+ main();
115
+ }
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "bizgate-mcp-server",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "BizGate APIとClaudeを連携するMCPサーバー",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
- "bizgate-mcp-server": "dist/index.js",
9
- "bizgate-install-skill": "dist/install-skill.js"
8
+ "bizgate-mcp-server": "dist/index.js"
10
9
  },
11
10
  "files": [
12
11
  "dist"