edition-mcp-server 0.1.5 → 0.2.1

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.
Files changed (3) hide show
  1. package/README.md +146 -37
  2. package/dist/index.js +91 -32
  3. package/package.json +17 -3
package/README.md CHANGED
@@ -1,15 +1,11 @@
1
- # edition-mcp-server
1
+ # EDITION Intelligence Platform — MCP Server
2
2
 
3
- MCP server for the **EDITION Intelligence Platform**contextual intelligence infrastructure for AI agents operating in Japan.
3
+ Japan Operations OS for autonomous AI agents. 14 knowledge domains, 31 MCP tools, 2 prompt templates verified, structured intelligence for agents operating in Japan.
4
4
 
5
- ## What it does
5
+ [![npm](https://img.shields.io/npm/v/edition-mcp-server)](https://www.npmjs.com/package/edition-mcp-server)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-black.svg)](https://opensource.org/licenses/MIT)
6
7
 
7
- Provides 8 tools that give AI agents the ability to:
8
-
9
- - **Remember** conversations with Japanese-aware fact extraction (keigo analysis, social hierarchy detection, confidence scoring)
10
- - **Navigate** Japanese business regulations across 10 industries + tourist rules
11
-
12
- ## Install
8
+ ## Installation
13
9
 
14
10
  ```bash
15
11
  npx edition-mcp-server
@@ -22,8 +18,6 @@ npm install -g edition-mcp-server
22
18
  edition-mcp
23
19
  ```
24
20
 
25
- ## Configure
26
-
27
21
  ### Claude Desktop
28
22
 
29
23
  Add to `claude_desktop_config.json`:
@@ -33,19 +27,28 @@ Add to `claude_desktop_config.json`:
33
27
  "mcpServers": {
34
28
  "edition": {
35
29
  "command": "npx",
36
- "args": ["-y", "edition-mcp-server"],
37
- "env": {
38
- "EDITION_API_URL": "http://localhost:8000",
39
- "EDITION_API_KEY": "your_api_key"
40
- }
30
+ "args": ["-y", "edition-mcp-server"]
41
31
  }
42
32
  }
43
33
  }
44
34
  ```
45
35
 
46
- ### Cursor
36
+ ### Cursor / Windsurf / VS Code
47
37
 
48
- Add to MCP settings:
38
+ Add to your MCP settings:
39
+
40
+ ```json
41
+ {
42
+ "edition": {
43
+ "command": "npx",
44
+ "args": ["-y", "edition-mcp-server"]
45
+ }
46
+ }
47
+ ```
48
+
49
+ ### Custom API URL
50
+
51
+ By default connects to `https://api.edition.sh`. Override with environment variables:
49
52
 
50
53
  ```json
51
54
  {
@@ -53,8 +56,8 @@ Add to MCP settings:
53
56
  "command": "npx",
54
57
  "args": ["-y", "edition-mcp-server"],
55
58
  "env": {
56
- "EDITION_API_URL": "http://localhost:8000",
57
- "EDITION_API_KEY": "your_api_key"
59
+ "EDITION_API_URL": "https://api.edition.sh",
60
+ "EDITION_API_KEY": "edition_dev_key_for_testing"
58
61
  }
59
62
  }
60
63
  }
@@ -62,28 +65,134 @@ Add to MCP settings:
62
65
 
63
66
  ## Tools
64
67
 
68
+ ### Memory (5 tools)
69
+
65
70
  | Tool | Description |
66
71
  |------|-------------|
67
- | `memory_store` | Store episode + auto-extract structured facts from Japanese text |
68
- | `memory_recall` | Semantic search across stored episodes |
69
- | `memory_facts` | List structured facts (subject → predicate → object with confidence) |
70
- | `memory_context` | Get context summary for an entity or session |
71
- | `memory_extract` | Extract facts from text with keigo/hierarchy analysis |
72
- | `regulation_check` | Check Japanese business regulations by industry |
73
- | `regulation_industries` | List all 10 supported industries |
74
- | `regulation_tourist` | Tourist regulation lookup (visa, tax-free, transit, etc.) |
72
+ | `memory_store` | Store episodes to persistent memory with Japanese language understanding (keigo, subject omission, implicit context) |
73
+ | `memory_recall` | Semantic search across stored memories — handles ambiguous Japanese queries |
74
+ | `memory_facts` | List structured facts as subject → predicate → object triples with confidence scores |
75
+ | `memory_context` | Get current session context summary for prompt injection |
76
+ | `memory_extract` | Auto-extract structured facts from text with keigo/hierarchy analysis |
75
77
 
76
- ## Backend
78
+ ### Regulations (3 tools)
77
79
 
78
- This MCP server connects to the EDITION REST API backend. To run your own:
80
+ | Tool | Description |
81
+ |------|-------------|
82
+ | `regulation_check` | Check Japan business regulations — licenses, governing bodies, penalties, costs, timelines for 10 industries |
83
+ | `regulation_industries` | List all 10 regulated industries with their requirements |
84
+ | `regulation_tourist` | Tourist/visitor regulation categories (visa, tax-free, transport, accommodation, medical, manners) |
79
85
 
80
- ```bash
81
- git clone https://github.com/hiroshic9-png/edition.git
82
- cd edition
83
- python3 -m venv venv && source venv/bin/activate
84
- pip install -r requirements.txt
85
- python -m uvicorn backend.api.main:app --reload
86
- ```
86
+ ### Protocols (2 tools)
87
+
88
+ | Tool | Description |
89
+ |------|-------------|
90
+ | `protocol_check` | Search Japanese business protocols — nemawashi, ringi, hourensou, meishi exchange, seating order, gift-giving |
91
+ | `protocol_list` | List all business protocols with importance levels |
92
+
93
+ ### Calendar (2 tools)
94
+
95
+ | Tool | Description |
96
+ |------|-------------|
97
+ | `calendar_check` | Search Japan business calendar — fiscal year, holidays, gift seasons, deadlines, seasonal patterns |
98
+ | `calendar_list` | List all calendar categories |
99
+
100
+ ### Regional (2 tools)
101
+
102
+ | Tool | Description |
103
+ |------|-------------|
104
+ | `regional_check` | Search regional business differences — city characteristics, subsidies, local regulations, business customs |
105
+ | `regional_list` | List all regional categories |
106
+
107
+ ### Organization (2 tools)
108
+
109
+ | Tool | Description |
110
+ |------|-------------|
111
+ | `organization_check` | Search organizational structures — keiretsu, corporate hierarchy, payment customs, contract practices |
112
+ | `organization_list` | List all organization categories |
113
+
114
+ ### Foreign Entry (2 tools)
115
+
116
+ | Tool | Description |
117
+ |------|-------------|
118
+ | `foreign_entry_check` | Japan market entry guides — incorporation, management visa, bank account, real estate, tax registration |
119
+ | `foreign_entry_list` | List all foreign entry categories |
120
+
121
+ ### Travel (2 tools)
122
+
123
+ | Tool | Description |
124
+ |------|-------------|
125
+ | `travel_search` | Search Japan travel knowledge — shinkansen, IC cards, ryokan etiquette, tipping culture |
126
+ | `travel_list` | List all travel topics |
127
+
128
+ ### Entertainment (2 tools)
129
+
130
+ | Tool | Description |
131
+ |------|-------------|
132
+ | `entertainment_search` | Search Japan entertainment — oshi-katsu fan culture, anime pilgrimage, live events, seasonal festivals |
133
+ | `entertainment_list` | List all entertainment topics |
134
+
135
+ ### Daily Life (2 tools)
136
+
137
+ | Tool | Description |
138
+ |------|-------------|
139
+ | `daily_life_search` | Search daily life in Japan — postal/address system, garbage sorting, utilities, healthcare/insurance |
140
+ | `daily_life_list` | List all daily life topics |
141
+
142
+ ### Language (2 tools)
143
+
144
+ | Tool | Description |
145
+ |------|-------------|
146
+ | `language_search` | Search Japanese language structures — keigo system, counter words (josushi), name patterns, business templates |
147
+ | `language_list` | List all language topics |
148
+
149
+ ### Food Culture (2 tools)
150
+
151
+ | Tool | Description |
152
+ |------|-------------|
153
+ | `food_search` | Search Japan food culture — dining etiquette, cuisine types, restaurant navigation, dietary restrictions (halal, vegetarian) |
154
+ | `food_list` | List all food culture topics |
155
+
156
+ ### Disaster & Safety (2 tools)
157
+
158
+ | Tool | Description |
159
+ |------|-------------|
160
+ | `disaster_search` | Search disaster/safety knowledge — earthquake shindo scale, typhoon warnings, emergency contacts (110/119), disaster preparedness |
161
+ | `disaster_list` | List all disaster & safety topics |
162
+
163
+ ### Cross-Domain (1 tool)
164
+
165
+ | Tool | Description |
166
+ |------|-------------|
167
+ | `search` | Cross-domain search across all 14 knowledge domains simultaneously — one query returns matches from all domains |
168
+
169
+ ## Prompt Templates
170
+
171
+ | Prompt | Description |
172
+ |--------|-------------|
173
+ | `japan_business_briefing` | Generate a comprehensive Japan business briefing for a specific industry |
174
+ | `japan_travel_guide` | Generate a practical travel guide for a specific Japan destination |
175
+
176
+ ## Resources
177
+
178
+ | Resource | Description |
179
+ |----------|-------------|
180
+ | `edition://domains` | List of all 14 knowledge domains with descriptions and endpoint information |
181
+ | `edition://quality` | Trust Anchor quality scores for each domain — verified data coverage metrics |
182
+
183
+ ## Architecture
184
+
185
+ EDITION uses a three-layer knowledge architecture:
186
+
187
+ 1. **Rules** — Official regulations, procedures, and requirements
188
+ 2. **Context** — Unwritten rules, cultural "why", and implicit expectations
189
+ 3. **Experience** — How to turn correct execution into relationship-building moments
190
+
191
+ ## API
192
+
193
+ - **REST API**: [https://api.edition.sh](https://api.edition.sh)
194
+ - **API Docs**: [https://api.edition.sh/docs](https://api.edition.sh/docs)
195
+ - **Landing Page**: [https://edition.sh](https://edition.sh)
87
196
 
88
197
  ## License
89
198
 
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ async function apiPost(path, body) {
47
47
  // ── MCP Server ──────────────────────────────────────
48
48
  const server = new mcp_js_1.McpServer({
49
49
  name: "edition",
50
- version: "0.1.5",
50
+ version: "0.2.0",
51
51
  });
52
52
  // ── Tool: memory_store ──────────────────────────────
53
53
  server.tool("memory_store", "会話やイベントのエピソードを永続記憶に保存します。日本語の文脈(敬語レベル、主語省略、暗黙の了解)も構造化して保持します。auto_extract=trueにすると、テキストからファクト(主語→述語→目的語の三つ組)を自動抽出します。", {
@@ -55,7 +55,7 @@ server.tool("memory_store", "会話やイベントのエピソードを永続記
55
55
  session_id: zod_1.z.string().optional().describe("セッション識別子"),
56
56
  role: zod_1.z.enum(["user", "assistant", "system"]).default("user").describe("発話者の役割"),
57
57
  auto_extract: zod_1.z.boolean().default(false).describe("LLMでファクトを自動抽出するか"),
58
- }, async ({ content, session_id, role, auto_extract }) => {
58
+ }, { readOnlyHint: false, destructiveHint: false, idempotentHint: false }, async ({ content, session_id, role, auto_extract }) => {
59
59
  const result = await apiPost("/api/v1/memory/episodes", {
60
60
  content,
61
61
  session_id,
@@ -75,7 +75,7 @@ server.tool("memory_store", "会話やイベントのエピソードを永続記
75
75
  server.tool("memory_recall", "過去の記憶をセマンティック検索で呼び出します。「前回の会議で○○部長が仰った件」のような曖昧な日本語クエリにも対応します。", {
76
76
  query: zod_1.z.string().describe("検索クエリ(日本語/英語対応)"),
77
77
  limit: zod_1.z.number().int().min(1).max(20).default(5).describe("取得件数"),
78
- }, async ({ query, limit }) => {
78
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query, limit }) => {
79
79
  const result = await apiPost("/api/v1/memory/episodes/search", {
80
80
  query,
81
81
  limit,
@@ -93,7 +93,7 @@ server.tool("memory_recall", "過去の記憶をセマンティック検索で
93
93
  // ── Tool: memory_facts ──────────────────────────────
94
94
  server.tool("memory_facts", "現在有効なファクト(構造化された事実)の一覧を取得します。ファクトは「主語→述語→目的語」の三つ組で、確度と有効期限を持ちます。", {
95
95
  valid_only: zod_1.z.boolean().default(true).describe("有効なファクトのみ取得するか"),
96
- }, async ({ valid_only }) => {
96
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ valid_only }) => {
97
97
  const result = await apiGet(`/api/v1/memory/facts?valid_only=${valid_only}`);
98
98
  if (!result.facts?.length) {
99
99
  return { content: [{ type: "text", text: "保存されたファクトはありません。" }] };
@@ -108,7 +108,7 @@ server.tool("memory_facts", "現在有効なファクト(構造化された事
108
108
  // ── Tool: memory_context ────────────────────────────
109
109
  server.tool("memory_context", "現在のセッション状態(有効な事実・合意事項のサマリー)を取得します。エージェントのプロンプトに注入して文脈を維持するために使います。", {
110
110
  session_id: zod_1.z.string().optional().describe("セッションID(省略で全体)"),
111
- }, async ({ session_id }) => {
111
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ session_id }) => {
112
112
  const params = session_id ? `?session_id=${encodeURIComponent(session_id)}` : "";
113
113
  const result = await apiGet(`/api/v1/memory/context${params}`);
114
114
  let text = `📌 コンテキストサマリー\n`;
@@ -122,7 +122,7 @@ server.tool("memory_extract", "テキストからファクトを自動抽出し
122
122
  text: zod_1.z.string().describe("ファクトを抽出するテキスト"),
123
123
  context_hint: zod_1.z.string().default("").describe("コンテキストヒント(例: ビジネスミーティング)"),
124
124
  store: zod_1.z.boolean().default(false).describe("抽出したファクトを永続保存するか"),
125
- }, async ({ text, context_hint, store }) => {
125
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ text, context_hint, store }) => {
126
126
  const result = await apiPost("/api/v1/memory/extract", {
127
127
  text,
128
128
  context_hint,
@@ -144,7 +144,7 @@ server.tool("regulation_check", "特定のビジネスアクションに必要
144
144
  action: zod_1.z.string().describe("実行しようとしているアクション(例: 東京でレストランを開業する)"),
145
145
  industry: zod_1.z.string().optional().describe("業種(省略可、自動判定)"),
146
146
  entity_type: zod_1.z.enum(["foreign_company", "domestic_company", "individual", "tourist"]).default("foreign_company").describe("主体の種別"),
147
- }, async ({ action, industry, entity_type }) => {
147
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ action, industry, entity_type }) => {
148
148
  const result = await apiPost("/api/v1/regulation/check", {
149
149
  action,
150
150
  industry,
@@ -189,7 +189,7 @@ server.tool("regulation_check", "特定のビジネスアクションに必要
189
189
  return { content: [{ type: "text", text }] };
190
190
  });
191
191
  // ── Tool: regulation_industries ──────────────────────
192
- server.tool("regulation_industries", "日本の規制データベースに登録されている業種の一覧を取得します。", {}, async () => {
192
+ server.tool("regulation_industries", "日本の規制データベースに登録されている業種の一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
193
193
  const result = await apiGet("/api/v1/regulation/industries");
194
194
  let text = `🗾 対応業種一覧 (${result.count}業種):\n\n`;
195
195
  for (const ind of result.industries) {
@@ -201,7 +201,7 @@ server.tool("regulation_industries", "日本の規制データベースに登録
201
201
  return { content: [{ type: "text", text }] };
202
202
  });
203
203
  // ── Tool: regulation_tourist ────────────────────────
204
- server.tool("regulation_tourist", "訪日旅行者向けの規制・マナー情報のカテゴリ一覧を取得します。ビザ、免税、交通、宿泊、医療、マナーの6カテゴリ。", {}, async () => {
204
+ server.tool("regulation_tourist", "訪日旅行者向けの規制・マナー情報のカテゴリ一覧を取得します。ビザ、免税、交通、宿泊、医療、マナーの6カテゴリ。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
205
205
  const result = await apiGet("/api/v1/regulation/tourist");
206
206
  let text = `🗾 訪日旅行者向け規制カテゴリ (${result.count}件):\n\n`;
207
207
  for (const cat of result.categories) {
@@ -212,7 +212,7 @@ server.tool("regulation_tourist", "訪日旅行者向けの規制・マナー情
212
212
  // ── Tool: protocol_check ────────────────────────────
213
213
  server.tool("protocol_check", "日本のビジネスプロトコル(根回し、稟議、報連相、名刺交換、席順、贈答)を検索します。", {
214
214
  query: zod_1.z.string().describe("検索クエリ(例: '名刺交換の作法', '根回し')"),
215
- }, async ({ query }) => {
215
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
216
216
  const result = await apiPost("/api/v1/protocol/check", { query });
217
217
  if (!result.protocol_id && !result.name_ja) {
218
218
  return { content: [{ type: "text", text: `❌ '${query}' に該当するプロトコルが見つかりませんでした。` }] };
@@ -235,7 +235,7 @@ server.tool("protocol_check", "日本のビジネスプロトコル(根回し
235
235
  return { content: [{ type: "text", text }] };
236
236
  });
237
237
  // ── Tool: protocol_list ─────────────────────────────
238
- server.tool("protocol_list", "日本のビジネスプロトコルの一覧を取得します。", {}, async () => {
238
+ server.tool("protocol_list", "日本のビジネスプロトコルの一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
239
239
  const result = await apiGet("/api/v1/protocol/list");
240
240
  let text = `🤝 プロトコル一覧 (${result.count}件):\n\n`;
241
241
  for (const p of result.protocols) {
@@ -246,7 +246,7 @@ server.tool("protocol_list", "日本のビジネスプロトコルの一覧を
246
246
  // ── Tool: calendar_check ────────────────────────────
247
247
  server.tool("calendar_check", "日本のビジネスカレンダー情報を検索します。祝日、決算期、贈答シーズン、行政締切、季節性ビジネスの5カテゴリ。", {
248
248
  query: zod_1.z.string().describe("検索クエリ(例: '開業のベストタイミング', 'GW', '確定申告の締切')"),
249
- }, async ({ query }) => {
249
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
250
250
  const result = await apiPost("/api/v1/calendar/check", { query });
251
251
  if (!result.category_id) {
252
252
  return { content: [{ type: "text", text: `❌ '${query}' に該当するカレンダー情報が見つかりませんでした。` }] };
@@ -256,7 +256,7 @@ server.tool("calendar_check", "日本のビジネスカレンダー情報を検
256
256
  return { content: [{ type: "text", text }] };
257
257
  });
258
258
  // ── Tool: calendar_list ─────────────────────────────
259
- server.tool("calendar_list", "日本のビジネスカレンダーの全カテゴリ一覧を取得します。", {}, async () => {
259
+ server.tool("calendar_list", "日本のビジネスカレンダーの全カテゴリ一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
260
260
  const result = await apiGet("/api/v1/calendar/list");
261
261
  let text = `📅 カレンダーカテゴリ一覧 (${result.count}件):\n\n`;
262
262
  for (const c of result.categories) {
@@ -267,7 +267,7 @@ server.tool("calendar_list", "日本のビジネスカレンダーの全カテ
267
267
  // ── Tool: regional_check ────────────────────────────
268
268
  server.tool("regional_check", "日本の地域別ビジネス情報を検索します。主要都市の特性、自治体の助成金・補助金、地域条例、商慣習の違い。", {
269
269
  query: zod_1.z.string().describe("検索クエリ(例: '大阪の飲食店条例', '東京のスタートアップ助成金')"),
270
- }, async ({ query }) => {
270
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
271
271
  const result = await apiPost("/api/v1/regional/check", { query });
272
272
  if (!result.category_id) {
273
273
  return { content: [{ type: "text", text: `❌ '${query}' に該当する地域情報が見つかりませんでした。` }] };
@@ -277,7 +277,7 @@ server.tool("regional_check", "日本の地域別ビジネス情報を検索し
277
277
  return { content: [{ type: "text", text }] };
278
278
  });
279
279
  // ── Tool: regional_list ─────────────────────────────
280
- server.tool("regional_list", "日本の地域別ビジネス情報の全カテゴリ一覧を取得します。", {}, async () => {
280
+ server.tool("regional_list", "日本の地域別ビジネス情報の全カテゴリ一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
281
281
  const result = await apiGet("/api/v1/regional/list");
282
282
  let text = `🗺️ 地域情報カテゴリ一覧 (${result.count}件):\n\n`;
283
283
  for (const c of result.categories) {
@@ -288,7 +288,7 @@ server.tool("regional_list", "日本の地域別ビジネス情報の全カテ
288
288
  // ── Tool: organization_check ────────────────────────
289
289
  server.tool("organization_check", "日本の組織構造・商慣行を検索します。役職体系、系列、支払慣行、契約慣行、業界団体。", {
290
290
  query: zod_1.z.string().describe("検索クエリ(例: '支払いサイトの標準', '契約書の印鑑', '部長と課長の違い')"),
291
- }, async ({ query }) => {
291
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
292
292
  const result = await apiPost("/api/v1/organization/check", { query });
293
293
  if (!result.category_id) {
294
294
  return { content: [{ type: "text", text: `❌ '${query}' に該当する組織情報が見つかりませんでした。` }] };
@@ -298,7 +298,7 @@ server.tool("organization_check", "日本の組織構造・商慣行を検索し
298
298
  return { content: [{ type: "text", text }] };
299
299
  });
300
300
  // ── Tool: organization_list ─────────────────────────
301
- server.tool("organization_list", "日本の組織構造・商慣行の全カテゴリ一覧を取得します。", {}, async () => {
301
+ server.tool("organization_list", "日本の組織構造・商慣行の全カテゴリ一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
302
302
  const result = await apiGet("/api/v1/organization/list");
303
303
  let text = `🏛️ 組織情報カテゴリ一覧 (${result.count}件):\n\n`;
304
304
  for (const c of result.categories) {
@@ -309,7 +309,7 @@ server.tool("organization_list", "日本の組織構造・商慣行の全カテ
309
309
  // ── Tool: foreign_entry_check ───────────────────────
310
310
  server.tool("foreign_entry_check", "外国企業・外国人の日本進出に必要な基盤知識を検索します。法人設立、経営管理ビザ、銀行口座開設、物件探し、税務届出の5カテゴリ。", {
311
311
  query: zod_1.z.string().describe("検索クエリ(例: '法人設立の手順', 'ビザ取得', '銀行口座開設')"),
312
- }, async ({ query }) => {
312
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
313
313
  const result = await apiPost("/api/v1/foreign-entry/check", { query });
314
314
  if (!result.category_id) {
315
315
  return { content: [{ type: "text", text: `❌ '${query}' に該当する進出情報が見つかりませんでした。` }] };
@@ -326,7 +326,7 @@ server.tool("foreign_entry_check", "外国企業・外国人の日本進出に
326
326
  return { content: [{ type: "text", text }] };
327
327
  });
328
328
  // ── Tool: foreign_entry_list ────────────────────────
329
- server.tool("foreign_entry_list", "外国企業・外国人の日本進出に関する知識カテゴリの一覧を取得します。", {}, async () => {
329
+ server.tool("foreign_entry_list", "外国企業・外国人の日本進出に関する知識カテゴリの一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
330
330
  const result = await apiGet("/api/v1/foreign-entry/list");
331
331
  let text = `🌐 日本進出カテゴリ一覧 (${result.count}件):\n\n`;
332
332
  for (const c of result.categories) {
@@ -337,7 +337,7 @@ server.tool("foreign_entry_list", "外国企業・外国人の日本進出に関
337
337
  // ── Tool: travel_search ─────────────────────────────
338
338
  server.tool("travel_search", "日本の旅行・観光に関する知識を検索します。交通(新幹線・ICカード・タクシー)、宿泊(旅館マナー・ホテル)、飲食(ラーメン地域差・箸マナー・チップ不要)、実用情報(SIM・ATM・緊急連絡先・マナー)。", {
339
339
  query: zod_1.z.string().describe("検索クエリ(例: '新幹線の乗り方', '旅館のマナー', 'ラーメンの食べ方')"),
340
- }, async ({ query }) => {
340
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
341
341
  const result = await apiPost("/api/v1/travel/search", { query });
342
342
  if (!result.results?.length) {
343
343
  return { content: [{ type: "text", text: `❌ '${query}' に該当する旅行情報が見つかりませんでした。` }] };
@@ -349,7 +349,7 @@ server.tool("travel_search", "日本の旅行・観光に関する知識を検
349
349
  return { content: [{ type: "text", text }] };
350
350
  });
351
351
  // ── Tool: travel_list ───────────────────────────────
352
- server.tool("travel_list", "日本の旅行知識のトピック一覧を取得します。", {}, async () => {
352
+ server.tool("travel_list", "日本の旅行知識のトピック一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
353
353
  const result = await apiGet("/api/v1/travel/list");
354
354
  let text = `✈️ 旅行トピック一覧 (${result.total}件):\n\n`;
355
355
  for (const t of result.topics) {
@@ -360,7 +360,7 @@ server.tool("travel_list", "日本の旅行知識のトピック一覧を取得
360
360
  // ── Tool: entertainment_search ──────────────────────
361
361
  server.tool("entertainment_search", "日本のエンターテインメント・ポップカルチャーに関する知識を検索します。推し活(チケット取得・転売法)、アニメ聖地巡礼、ライブマナー(ペンライト・コール)、季節イベント(花見・花火・初詣)。", {
362
362
  query: zod_1.z.string().describe("検索クエリ(例: '推し活のチケット購入', 'コミケの参加方法', '花見のマナー')"),
363
- }, async ({ query }) => {
363
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
364
364
  const result = await apiPost("/api/v1/entertainment/search", { query });
365
365
  if (!result.results?.length) {
366
366
  return { content: [{ type: "text", text: `❌ '${query}' に該当するエンタメ情報が見つかりませんでした。` }] };
@@ -372,7 +372,7 @@ server.tool("entertainment_search", "日本のエンターテインメント・
372
372
  return { content: [{ type: "text", text }] };
373
373
  });
374
374
  // ── Tool: entertainment_list ────────────────────────
375
- server.tool("entertainment_list", "日本のエンタメ知識のトピック一覧を取得します。", {}, async () => {
375
+ server.tool("entertainment_list", "日本のエンタメ知識のトピック一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
376
376
  const result = await apiGet("/api/v1/entertainment/list");
377
377
  let text = `🎭 エンタメトピック一覧 (${result.total}件):\n\n`;
378
378
  for (const t of result.topics) {
@@ -383,7 +383,7 @@ server.tool("entertainment_list", "日本のエンタメ知識のトピック一
383
383
  // ── Tool: daily_life_search ─────────────────────────
384
384
  server.tool("daily_life_search", "日本の日常生活に関する知識を検索します。住所・郵便システム、ゴミ分別ルール、公共料金(電気・ガス・水道・NHK)、医療・健康保険制度。外国人が日本で生活するために必要な実用知識。", {
385
385
  query: zod_1.z.string().describe("検索クエリ(例: 'ゴミの分別方法', '健康保険の加入', '引っ越しの手続き')"),
386
- }, async ({ query }) => {
386
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
387
387
  const result = await apiPost("/api/v1/daily-life/search", { query });
388
388
  if (!result.results?.length) {
389
389
  return { content: [{ type: "text", text: `❌ '${query}' に該当する日常生活情報が見つかりませんでした。` }] };
@@ -395,7 +395,7 @@ server.tool("daily_life_search", "日本の日常生活に関する知識を検
395
395
  return { content: [{ type: "text", text }] };
396
396
  });
397
397
  // ── Tool: daily_life_list ──────────────────────────
398
- server.tool("daily_life_list", "日本の日常生活知識のトピック一覧を取得します。", {}, async () => {
398
+ server.tool("daily_life_list", "日本の日常生活知識のトピック一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
399
399
  const result = await apiGet("/api/v1/daily-life/list");
400
400
  let text = `🏠 日常生活トピック一覧 (${result.total}件):\n\n`;
401
401
  for (const t of result.topics) {
@@ -406,7 +406,7 @@ server.tool("daily_life_list", "日本の日常生活知識のトピック一覧
406
406
  // ── Tool: language_search ──────────────────────────
407
407
  server.tool("language_search", "日本語の構造的知識を検索します。敬語体系(尊敬語・謙譲語・丁寧語)、助数詞(数え方)、名前・住所の構造パターン、ビジネス日本語(電話応対・クッション言葉・メールテンプレート)。", {
408
408
  query: zod_1.z.string().describe("検索クエリ(例: '敬語の使い方', '助数詞の一覧', 'ビジネスメールの書き方')"),
409
- }, async ({ query }) => {
409
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
410
410
  const result = await apiPost("/api/v1/language/search", { query });
411
411
  if (!result.results?.length) {
412
412
  return { content: [{ type: "text", text: `❌ '${query}' に該当する日本語情報が見つかりませんでした。` }] };
@@ -418,7 +418,7 @@ server.tool("language_search", "日本語の構造的知識を検索します。
418
418
  return { content: [{ type: "text", text }] };
419
419
  });
420
420
  // ── Tool: language_list ────────────────────────────
421
- server.tool("language_list", "日本語知識のトピック一覧を取得します。", {}, async () => {
421
+ server.tool("language_list", "日本語知識のトピック一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
422
422
  const result = await apiGet("/api/v1/language/list");
423
423
  let text = `🗾 日本語トピック一覧 (${result.total}件):\n\n`;
424
424
  for (const t of result.topics) {
@@ -429,7 +429,7 @@ server.tool("language_list", "日本語知識のトピック一覧を取得し
429
429
  // ── Tool: food_search ──────────────────────────────
430
430
  server.tool("food_search", "日本の食文化に関する知識を検索します。食事マナー(箸のタブー・乾杯・割り勘)、料理分類(懐石・定食・ラーメン・郷土料理)、飲食店ガイド(食券機・居酒屋・回転寿司・おまかせ)、アレルギー・食制限(ハラル・ベジタリアン対応)。", {
431
431
  query: zod_1.z.string().describe("検索クエリ(例: '箸のマナー', 'ハラル対応レストラン', '回転寿司の注文方法')"),
432
- }, async ({ query }) => {
432
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
433
433
  const result = await apiPost("/api/v1/food/search", { query });
434
434
  if (!result.results?.length) {
435
435
  return { content: [{ type: "text", text: `❌ '${query}' に該当する食文化情報が見つかりませんでした。` }] };
@@ -441,7 +441,7 @@ server.tool("food_search", "日本の食文化に関する知識を検索しま
441
441
  return { content: [{ type: "text", text }] };
442
442
  });
443
443
  // ── Tool: food_list ────────────────────────────────
444
- server.tool("food_list", "日本の食文化知識のトピック一覧を取得します。", {}, async () => {
444
+ server.tool("food_list", "日本の食文化知識のトピック一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
445
445
  const result = await apiGet("/api/v1/food/list");
446
446
  let text = `🍣 食文化トピック一覧 (${result.total}件):\n\n`;
447
447
  for (const t of result.topics) {
@@ -452,7 +452,7 @@ server.tool("food_list", "日本の食文化知識のトピック一覧を取得
452
452
  // ── Tool: disaster_search ──────────────────────────
453
453
  server.tool("disaster_search", "日本の災害・安全に関する知識を検索します。地震(震度スケール・緊急地震速報・耐震基準)、台風・水害(警戒レベル・計画運休)、緊急連絡先(110/119/多言語対応)、防災準備(防災バッグ・ハザードマップ・避難所マナー)。", {
454
454
  query: zod_1.z.string().describe("検索クエリ(例: '地震が来たらどうする', '緊急連絡先', '防災バッグの中身')"),
455
- }, async ({ query }) => {
455
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
456
456
  const result = await apiPost("/api/v1/disaster/search", { query });
457
457
  if (!result.results?.length) {
458
458
  return { content: [{ type: "text", text: `❌ '${query}' に該当する災害・安全情報が見つかりませんでした。` }] };
@@ -464,7 +464,7 @@ server.tool("disaster_search", "日本の災害・安全に関する知識を検
464
464
  return { content: [{ type: "text", text }] };
465
465
  });
466
466
  // ── Tool: disaster_list ────────────────────────────
467
- server.tool("disaster_list", "日本の災害・安全知識のトピック一覧を取得します。", {}, async () => {
467
+ server.tool("disaster_list", "日本の災害・安全知識のトピック一覧を取得します。", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async () => {
468
468
  const result = await apiGet("/api/v1/disaster/list");
469
469
  let text = `⚠️ 災害・安全トピック一覧 (${result.total}件):\n\n`;
470
470
  for (const t of result.topics) {
@@ -475,7 +475,7 @@ server.tool("disaster_list", "日本の災害・安全知識のトピック一
475
475
  // ── Tool: search ────────────────────────────────────
476
476
  server.tool("search", "EDITION全14ドメインを横断検索します。1回のリクエストで規制・プロトコル・カレンダー・地域・組織・進出手続き・旅行・エンタメ・日常生活・日本語・食文化・災害安全の全12ドメインを同時検索。", {
477
477
  query: zod_1.z.string().describe("検索クエリ(例: '大阪で飲食店を開業', '地震の避難方法', '敬語の使い方')"),
478
- }, async ({ query }) => {
478
+ }, { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, async ({ query }) => {
479
479
  const result = await apiPost("/api/v1/search", { query });
480
480
  let text = `🔍 横断検索結果: ${result.domains_matched}/${result.domains_searched} ドメインでヒット\n\n`;
481
481
  for (const [domain, data] of Object.entries(result.results)) {
@@ -489,6 +489,65 @@ server.tool("search", "EDITION全14ドメインを横断検索します。1回
489
489
  }
490
490
  return { content: [{ type: "text", text }] };
491
491
  });
492
+ // ── Resources ───────────────────────────────────────
493
+ server.resource("domains", "edition://domains", {
494
+ description: "All 14 knowledge domains with descriptions, endpoints, and coverage status",
495
+ mimeType: "application/json",
496
+ }, async () => {
497
+ const domains = [
498
+ { id: "memory", name: "Persistent Memory", endpoint: "/api/v1/memory", tools: 5, layers: ["rules", "context"] },
499
+ { id: "regulation", name: "Business Regulations", endpoint: "/api/v1/regulation", tools: 3, layers: ["rules", "context", "experience"] },
500
+ { id: "protocol", name: "Business Protocols", endpoint: "/api/v1/protocol", tools: 2, layers: ["rules", "context", "experience"] },
501
+ { id: "calendar", name: "Business Calendar", endpoint: "/api/v1/calendar", tools: 2, layers: ["rules", "context", "experience"] },
502
+ { id: "regional", name: "Regional Intelligence", endpoint: "/api/v1/regional", tools: 2, layers: ["rules", "context", "experience"] },
503
+ { id: "organization", name: "Organizational Structures", endpoint: "/api/v1/organization", tools: 2, layers: ["rules", "context", "experience"] },
504
+ { id: "foreign_entry", name: "Foreign Market Entry", endpoint: "/api/v1/foreign-entry", tools: 2, layers: ["rules", "context", "experience"] },
505
+ { id: "travel", name: "Travel Intelligence", endpoint: "/api/v1/travel", tools: 2, layers: ["rules", "context", "experience"] },
506
+ { id: "entertainment", name: "Entertainment & Pop Culture", endpoint: "/api/v1/entertainment", tools: 2, layers: ["rules", "context", "experience"] },
507
+ { id: "daily_life", name: "Daily Life", endpoint: "/api/v1/daily-life", tools: 2, layers: ["rules", "context"] },
508
+ { id: "language", name: "Japanese Language", endpoint: "/api/v1/language", tools: 2, layers: ["rules", "context"] },
509
+ { id: "food", name: "Food Culture", endpoint: "/api/v1/food", tools: 2, layers: ["rules", "context", "experience"] },
510
+ { id: "disaster", name: "Disaster & Safety", endpoint: "/api/v1/disaster", tools: 2, layers: ["rules", "context"] },
511
+ { id: "search", name: "Cross-Domain Search", endpoint: "/api/v1/search", tools: 1, layers: ["rules", "context", "experience"] },
512
+ ];
513
+ return {
514
+ contents: [
515
+ {
516
+ uri: "edition://domains",
517
+ mimeType: "application/json",
518
+ text: JSON.stringify({ total: domains.length, total_tools: 31, domains }, null, 2),
519
+ },
520
+ ],
521
+ };
522
+ });
523
+ server.resource("quality", "edition://quality", {
524
+ description: "Trust Anchor quality scores — verified data coverage, source reliability, and 3-layer completeness for each domain",
525
+ mimeType: "application/json",
526
+ }, async () => {
527
+ try {
528
+ const data = await apiGet("/api/v1/analytics/quality");
529
+ return {
530
+ contents: [
531
+ {
532
+ uri: "edition://quality",
533
+ mimeType: "application/json",
534
+ text: JSON.stringify(data, null, 2),
535
+ },
536
+ ],
537
+ };
538
+ }
539
+ catch {
540
+ return {
541
+ contents: [
542
+ {
543
+ uri: "edition://quality",
544
+ mimeType: "application/json",
545
+ text: JSON.stringify({ error: "Quality endpoint unavailable" }),
546
+ },
547
+ ],
548
+ };
549
+ }
550
+ });
492
551
  // ── Start ───────────────────────────────────────────
493
552
  async function main() {
494
553
  const transport = new stdio_js_1.StdioServerTransport();
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "edition-mcp-server",
3
- "version": "0.1.5",
3
+ "version": "0.2.1",
4
4
  "mcpName": "io.github.hiroshic9-png/japan-business-operations",
5
- "description": "EDITION Intelligence Platform \u2014 MCP server for Japan operations intelligence (14 knowledge domains, 31 tools)",
5
+ "description": "EDITION Intelligence Platform MCP server for Japan operations intelligence. 14 knowledge domains, 31 tools, 2 prompts, 2 resources. Verified ground truth: regulations, procedures, protocols, calendar, regional, organization, foreign entry, travel, entertainment, daily life, language, food culture, disaster safety, and persistent memory.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "bin": {
@@ -24,8 +24,22 @@
24
24
  "travel",
25
25
  "entertainment",
26
26
  "protocol",
27
- "calendar"
27
+ "calendar",
28
+ "keigo",
29
+ "business",
30
+ "culture",
31
+ "food",
32
+ "disaster",
33
+ "safety",
34
+ "language",
35
+ "knowledge-base"
28
36
  ],
37
+ "homepage": "https://edition.sh",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/hiroshic9-png/edition-api"
41
+ },
42
+ "author": "EDITION <h.sato@c-9.co.jp>",
29
43
  "license": "MIT",
30
44
  "dependencies": {
31
45
  "@modelcontextprotocol/sdk": "^1.12.1"