edition-mcp-server 0.1.4 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +146 -37
  2. package/dist/index.js +154 -3
  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.2",
50
+ version: "0.2.0",
51
51
  });
52
52
  // ── Tool: memory_store ──────────────────────────────
53
53
  server.tool("memory_store", "会話やイベントのエピソードを永続記憶に保存します。日本語の文脈(敬語レベル、主語省略、暗黙の了解)も構造化して保持します。auto_extract=trueにすると、テキストからファクト(主語→述語→目的語の三つ組)を自動抽出します。", {
@@ -380,9 +380,101 @@ server.tool("entertainment_list", "日本のエンタメ知識のトピック一
380
380
  }
381
381
  return { content: [{ type: "text", text }] };
382
382
  });
383
+ // ── Tool: daily_life_search ─────────────────────────
384
+ server.tool("daily_life_search", "日本の日常生活に関する知識を検索します。住所・郵便システム、ゴミ分別ルール、公共料金(電気・ガス・水道・NHK)、医療・健康保険制度。外国人が日本で生活するために必要な実用知識。", {
385
+ query: zod_1.z.string().describe("検索クエリ(例: 'ゴミの分別方法', '健康保険の加入', '引っ越しの手続き')"),
386
+ }, async ({ query }) => {
387
+ const result = await apiPost("/api/v1/daily-life/search", { query });
388
+ if (!result.results?.length) {
389
+ return { content: [{ type: "text", text: `❌ '${query}' に該当する日常生活情報が見つかりませんでした。` }] };
390
+ }
391
+ let text = `🏠 日常生活情報 (${result.total_matches}件ヒット):\n\n`;
392
+ for (const r of result.results) {
393
+ text += ` 📌 ${r.name_ja} (${r.name_en})\n ${r.summary}\n\n`;
394
+ }
395
+ return { content: [{ type: "text", text }] };
396
+ });
397
+ // ── Tool: daily_life_list ──────────────────────────
398
+ server.tool("daily_life_list", "日本の日常生活知識のトピック一覧を取得します。", {}, async () => {
399
+ const result = await apiGet("/api/v1/daily-life/list");
400
+ let text = `🏠 日常生活トピック一覧 (${result.total}件):\n\n`;
401
+ for (const t of result.topics) {
402
+ text += ` • ${t.name_ja} (${t.name_en})\n ${t.summary}\n\n`;
403
+ }
404
+ return { content: [{ type: "text", text }] };
405
+ });
406
+ // ── Tool: language_search ──────────────────────────
407
+ server.tool("language_search", "日本語の構造的知識を検索します。敬語体系(尊敬語・謙譲語・丁寧語)、助数詞(数え方)、名前・住所の構造パターン、ビジネス日本語(電話応対・クッション言葉・メールテンプレート)。", {
408
+ query: zod_1.z.string().describe("検索クエリ(例: '敬語の使い方', '助数詞の一覧', 'ビジネスメールの書き方')"),
409
+ }, async ({ query }) => {
410
+ const result = await apiPost("/api/v1/language/search", { query });
411
+ if (!result.results?.length) {
412
+ return { content: [{ type: "text", text: `❌ '${query}' に該当する日本語情報が見つかりませんでした。` }] };
413
+ }
414
+ let text = `🗾 日本語知識 (${result.total_matches}件ヒット):\n\n`;
415
+ for (const r of result.results) {
416
+ text += ` 📌 ${r.name_ja} (${r.name_en})\n ${r.summary}\n\n`;
417
+ }
418
+ return { content: [{ type: "text", text }] };
419
+ });
420
+ // ── Tool: language_list ────────────────────────────
421
+ server.tool("language_list", "日本語知識のトピック一覧を取得します。", {}, async () => {
422
+ const result = await apiGet("/api/v1/language/list");
423
+ let text = `🗾 日本語トピック一覧 (${result.total}件):\n\n`;
424
+ for (const t of result.topics) {
425
+ text += ` • ${t.name_ja} (${t.name_en})\n ${t.summary}\n\n`;
426
+ }
427
+ return { content: [{ type: "text", text }] };
428
+ });
429
+ // ── Tool: food_search ──────────────────────────────
430
+ server.tool("food_search", "日本の食文化に関する知識を検索します。食事マナー(箸のタブー・乾杯・割り勘)、料理分類(懐石・定食・ラーメン・郷土料理)、飲食店ガイド(食券機・居酒屋・回転寿司・おまかせ)、アレルギー・食制限(ハラル・ベジタリアン対応)。", {
431
+ query: zod_1.z.string().describe("検索クエリ(例: '箸のマナー', 'ハラル対応レストラン', '回転寿司の注文方法')"),
432
+ }, async ({ query }) => {
433
+ const result = await apiPost("/api/v1/food/search", { query });
434
+ if (!result.results?.length) {
435
+ return { content: [{ type: "text", text: `❌ '${query}' に該当する食文化情報が見つかりませんでした。` }] };
436
+ }
437
+ let text = `🍣 食文化情報 (${result.total_matches}件ヒット):\n\n`;
438
+ for (const r of result.results) {
439
+ text += ` 📌 ${r.name_ja} (${r.name_en})\n ${r.summary}\n\n`;
440
+ }
441
+ return { content: [{ type: "text", text }] };
442
+ });
443
+ // ── Tool: food_list ────────────────────────────────
444
+ server.tool("food_list", "日本の食文化知識のトピック一覧を取得します。", {}, async () => {
445
+ const result = await apiGet("/api/v1/food/list");
446
+ let text = `🍣 食文化トピック一覧 (${result.total}件):\n\n`;
447
+ for (const t of result.topics) {
448
+ text += ` • ${t.name_ja} (${t.name_en})\n ${t.summary}\n\n`;
449
+ }
450
+ return { content: [{ type: "text", text }] };
451
+ });
452
+ // ── Tool: disaster_search ──────────────────────────
453
+ server.tool("disaster_search", "日本の災害・安全に関する知識を検索します。地震(震度スケール・緊急地震速報・耐震基準)、台風・水害(警戒レベル・計画運休)、緊急連絡先(110/119/多言語対応)、防災準備(防災バッグ・ハザードマップ・避難所マナー)。", {
454
+ query: zod_1.z.string().describe("検索クエリ(例: '地震が来たらどうする', '緊急連絡先', '防災バッグの中身')"),
455
+ }, async ({ query }) => {
456
+ const result = await apiPost("/api/v1/disaster/search", { query });
457
+ if (!result.results?.length) {
458
+ return { content: [{ type: "text", text: `❌ '${query}' に該当する災害・安全情報が見つかりませんでした。` }] };
459
+ }
460
+ let text = `⚠️ 災害・安全情報 (${result.total_matches}件ヒット):\n\n`;
461
+ for (const r of result.results) {
462
+ text += ` 📌 ${r.name_ja} (${r.name_en})\n ${r.summary}\n\n`;
463
+ }
464
+ return { content: [{ type: "text", text }] };
465
+ });
466
+ // ── Tool: disaster_list ────────────────────────────
467
+ server.tool("disaster_list", "日本の災害・安全知識のトピック一覧を取得します。", {}, async () => {
468
+ const result = await apiGet("/api/v1/disaster/list");
469
+ let text = `⚠️ 災害・安全トピック一覧 (${result.total}件):\n\n`;
470
+ for (const t of result.topics) {
471
+ text += ` • ${t.name_ja} (${t.name_en})\n ${t.summary}\n\n`;
472
+ }
473
+ return { content: [{ type: "text", text }] };
474
+ });
383
475
  // ── Tool: search ────────────────────────────────────
384
- server.tool("search", "EDITION全ドメインを横断検索します。1回のリクエストで規制・プロトコル・カレンダー・地域・組織・進出手続き・旅行・エンタメの全8ドメインを同時検索。", {
385
- query: zod_1.z.string().describe("検索クエリ(例: '大阪で飲食店を開業', '推し活のマナー', '外国人のビザ取得')"),
476
+ server.tool("search", "EDITION全14ドメインを横断検索します。1回のリクエストで規制・プロトコル・カレンダー・地域・組織・進出手続き・旅行・エンタメ・日常生活・日本語・食文化・災害安全の全12ドメインを同時検索。", {
477
+ query: zod_1.z.string().describe("検索クエリ(例: '大阪で飲食店を開業', '地震の避難方法', '敬語の使い方')"),
386
478
  }, async ({ query }) => {
387
479
  const result = await apiPost("/api/v1/search", { query });
388
480
  let text = `🔍 横断検索結果: ${result.domains_matched}/${result.domains_searched} ドメインでヒット\n\n`;
@@ -397,6 +489,65 @@ server.tool("search", "EDITION全ドメインを横断検索します。1回の
397
489
  }
398
490
  return { content: [{ type: "text", text }] };
399
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
+ });
400
551
  // ── Start ───────────────────────────────────────────
401
552
  async function main() {
402
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.4",
3
+ "version": "0.2.0",
4
4
  "mcpName": "io.github.hiroshic9-png/japan-business-operations",
5
- "description": "EDITION Intelligence Platform \u2014 MCP server for Japan operations intelligence (10 knowledge domains)",
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"