taiwan-data-mcp 0.7.0 → 0.8.0
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/README.md +3 -0
- package/package.json +1 -1
- package/src/server.mjs +36 -2
- package/src/sources.mjs +31 -0
package/README.md
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
| `taiwan_company_profile` | 用統編查公司完整登記資料(含董監事) | inc.com.tw |
|
|
14
14
|
| `taiwan_person_companies` | 用人名查他擔任負責人/董監事的公司 | inc.com.tw |
|
|
15
15
|
| `taiwan_company_risk` | 公司風險查核(統編或公司名):解散/拒絕往來/國際制裁/金管會/司法/勞動/環保紅旗+上市櫃即時股價 | inc.com.tw |
|
|
16
|
+
| `taiwan_company_relations` | 公司關係圖譜:法人股東/轉投資子公司/最終母公司/集團規模/共同董監事人脈 | inc.com.tw |
|
|
17
|
+
| `taiwan_company_name_check` | 公司名稱預查/撞名查重(創業命名用) | inc.com.tw |
|
|
18
|
+
| `taiwan_company_verify` | 經濟部商工登記 OpenAPI 即時官方登記狀態 | inc.com.tw |
|
|
16
19
|
| `taiwan_realprice_search` | 搜尋實價登錄的地址 / 路段 / 行政區 | [housetw.com](https://housetw.com)(內政部實價登錄) |
|
|
17
20
|
| `taiwan_realprice_locate` | 用經緯度反查行政區與行情頁 | housetw.com |
|
|
18
21
|
| `taiwan_realprice_area` | 查某縣市 / 行政區成交行情統計 | housetw.com |
|
package/package.json
CHANGED
package/src/server.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
4
4
|
import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import {
|
|
6
6
|
scamCheck, companySearch, companyProfile, personCompanies, companyRisk,
|
|
7
|
+
companyRelations, companyNameCheck, companyVerify,
|
|
7
8
|
realpriceSearch, realpriceLocate, realpriceArea, realpriceEstimate, realpriceRoad,
|
|
8
9
|
drugSearch, drugInfo,
|
|
9
10
|
tenderByCompany, tenderSearch,
|
|
@@ -68,6 +69,39 @@ const TOOLS = [
|
|
|
68
69
|
},
|
|
69
70
|
run: (a) => companyRisk(a.unified_business_no || a.name),
|
|
70
71
|
},
|
|
72
|
+
{
|
|
73
|
+
name: 'taiwan_company_relations',
|
|
74
|
+
description:
|
|
75
|
+
'公司關係圖譜(盡職調查/天眼查式):用 8 位統編查該公司的法人股東(誰持有它)、轉投資子公司(它持有誰)、推估最終母公司、整個集團規模,以及共同董監事連到的其他公司(人脈)。查母子公司、集團版圖、關係人用。資料來源:inc.com.tw。',
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
properties: { unified_business_no: { type: 'string', description: '8 位統一編號,例如 04541302(鴻海)' } },
|
|
79
|
+
required: ['unified_business_no'],
|
|
80
|
+
},
|
|
81
|
+
run: (a) => companyRelations(a.unified_business_no),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'taiwan_company_name_check',
|
|
85
|
+
description:
|
|
86
|
+
'公司名稱預查/撞名查重:給一個想取的公司名稱,回傳是否已有相同或近似的既有公司(含統編)。創業命名或盡調辨識用。回傳 core(特取名稱)、exact(完全相同)、similar(近似)。資料來源:inc.com.tw。',
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
properties: { name: { type: 'string', description: '想查的公司名稱,例如「台積電」「方圓科技」' } },
|
|
90
|
+
required: ['name'],
|
|
91
|
+
},
|
|
92
|
+
run: (a) => companyNameCheck(a.name),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'taiwan_company_verify',
|
|
96
|
+
description:
|
|
97
|
+
'用 8 位統編向經濟部商工登記公示 OpenAPI 取「即時」官方登記狀態(名稱/狀態/資本/實收/負責人/所在地/登記機關)。比一般資料庫更即時,適合確認某公司目前是否仍存續、是否已解散撤銷。資料來源:經濟部商工登記公示資料。',
|
|
98
|
+
inputSchema: {
|
|
99
|
+
type: 'object',
|
|
100
|
+
properties: { unified_business_no: { type: 'string', description: '8 位統一編號,例如 22099131' } },
|
|
101
|
+
required: ['unified_business_no'],
|
|
102
|
+
},
|
|
103
|
+
run: (a) => companyVerify(a.unified_business_no),
|
|
104
|
+
},
|
|
71
105
|
{
|
|
72
106
|
name: 'taiwan_realprice_search',
|
|
73
107
|
description:
|
|
@@ -203,7 +237,7 @@ const TOOLS = [
|
|
|
203
237
|
];
|
|
204
238
|
|
|
205
239
|
const server = new Server(
|
|
206
|
-
{ name: 'taiwan-data-mcp', version: '0.
|
|
240
|
+
{ name: 'taiwan-data-mcp', version: '0.8.0' },
|
|
207
241
|
{ capabilities: { tools: {} } }
|
|
208
242
|
);
|
|
209
243
|
|
|
@@ -224,4 +258,4 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
224
258
|
|
|
225
259
|
const transport = new StdioServerTransport();
|
|
226
260
|
await server.connect(transport);
|
|
227
|
-
console.error('taiwan-data-mcp running (stdio) —
|
|
261
|
+
console.error('taiwan-data-mcp running (stdio) — 18 tools: 防詐 / 公司登記·關係·盡調 / 實價登錄 / 藥品健康 / 政府標案 / 農產行情');
|
package/src/sources.mjs
CHANGED
|
@@ -126,6 +126,37 @@ export async function companyRisk(idOrName) {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// 公司關係圖譜(天眼查式):法人股東/轉投資子公司/最終母公司/集團規模/共同董監事人脈。
|
|
130
|
+
export async function companyRelations(id) {
|
|
131
|
+
const tin = String(id || '').replace(/\D/g, '');
|
|
132
|
+
if (tin.length !== 8) return { error: '統一編號必須是 8 位數字' };
|
|
133
|
+
const { ok, status, body } = await fetchJson(`https://inc.com.tw/api/relations/${tin}`, { timeout: 20000 });
|
|
134
|
+
if (status === 404) return { error: `查無此統一編號 ${tin}` };
|
|
135
|
+
if (!ok || !body) return { error: '查詢失敗(inc.com.tw)', unified_business_no: tin };
|
|
136
|
+
return body; // 已自帶 source / profile_url / note
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 公司名稱預查/撞名查重(創業命名、盡調辨識用)。
|
|
140
|
+
export async function companyNameCheck(name) {
|
|
141
|
+
const q = String(name || '').trim();
|
|
142
|
+
if (q.length < 2) return { error: '公司名稱至少 2 個字' };
|
|
143
|
+
const { ok, body } = await fetchJson(`https://inc.com.tw/api/namecheck?name=${encodeURIComponent(q)}`);
|
|
144
|
+
if (!ok || !body) return { error: '查詢失敗(inc.com.tw)', query: q };
|
|
145
|
+
return { query: q, ...body, note: '名稱比對僅供命名參考;正式設立以經濟部名稱預查核准為準', source: '台灣公司登記網 inc.com.tw' };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// 官方即時查證:經濟部商工登記公示 OpenAPI 的「目前」登記狀態(比快取更即時)。
|
|
149
|
+
export async function companyVerify(id) {
|
|
150
|
+
const tin = String(id || '').replace(/\D/g, '');
|
|
151
|
+
if (tin.length !== 8) return { error: '統一編號必須是 8 位數字' };
|
|
152
|
+
const { ok, body } = await fetchJson(`https://inc.com.tw/api/verify?id=${tin}`, { timeout: 15000 });
|
|
153
|
+
if (!ok || !body) return { error: '查詢失敗(inc.com.tw)', unified_business_no: tin };
|
|
154
|
+
if (!body.ok) return { unified_business_no: tin, verified: false, note: body.note || '官方查證暫時無回應', source: '經濟部商工登記公示資料' };
|
|
155
|
+
return { unified_business_no: tin, verified: true, name: body.name, status: body.status, capital: body.capital,
|
|
156
|
+
paid_in_capital: body.paid, representative: body.responsible, location: body.location, register_organization: body.regOrg,
|
|
157
|
+
source: body.src || '經濟部商工登記公示資料' };
|
|
158
|
+
}
|
|
159
|
+
|
|
129
160
|
// ── 農產批發行情 MOA(農業部農產品交易行情)──────────────────────
|
|
130
161
|
function _rocToAd(s) {
|
|
131
162
|
const m = String(s || '').match(/^(\d{2,3})\.(\d{2})\.(\d{2})$/);
|