mapnetwork-mcp 6.1.1__tar.gz → 6.2.0__tar.gz

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 (27) hide show
  1. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/PKG-INFO +22 -10
  2. mapnetwork_mcp-6.2.0/README.ja.md +120 -0
  3. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/README.md +21 -9
  4. mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-black.png +0 -0
  5. mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-download.png +0 -0
  6. mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-popArt.png +0 -0
  7. mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-view3d.png +0 -0
  8. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/manifest.json +2 -2
  9. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/mapnetwork_mcp/server.py +24 -12
  10. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/pyproject.toml +1 -1
  11. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/.github/workflows/workflow.yml +0 -0
  12. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/.gitignore +0 -0
  13. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/.mcpbignore +0 -0
  14. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/LICENSE +0 -0
  15. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/LOCALTEST.md +0 -0
  16. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/RELEASING.md +0 -0
  17. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/SECURITY.md +0 -0
  18. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/images/Kanazawa21Museum-black.png +0 -0
  19. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/images/Kanazawa21Museum-darkGreen.png +0 -0
  20. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/images/Kanazawa21Museum-grey.png +0 -0
  21. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/images/Kanazawa21Museum-lightGreen.png +0 -0
  22. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/images/Kanazawa21Museum-popArt.png +0 -0
  23. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/images/Kanazawa21Museum-white.png +0 -0
  24. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/mapnetwork_mcp/__init__.py +0 -0
  25. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/spec/input_schema.json +0 -0
  26. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/spec/output_schema.json +0 -0
  27. {mapnetwork_mcp-6.1.1 → mapnetwork_mcp-6.2.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapnetwork-mcp
3
- Version: 6.1.1
3
+ Version: 6.2.0
4
4
  Summary: MCP server — generate styled map images via mapnetwork.app
5
5
  Project-URL: Homepage, https://mapnetwork.app
6
6
  Project-URL: Repository, https://github.com/toruproject/mapnetwork-mcp
@@ -11,12 +11,16 @@ Requires-Dist: httpx>=0.27.0
11
11
  Requires-Dist: mcp[cli]<2.0.0,>=1.0.0
12
12
  Description-Content-Type: text/markdown
13
13
 
14
+ English | [日本語](https://github.com/toruproject/mapnetwork-mcp/blob/main/README.ja.md)
15
+
14
16
  # mapnetwork-mcp
15
17
 
16
18
  MCP server for [MapNetwork](https://mapnetwork.app) — turn places in Japan into styled, illustration-like map images (PNG / SVG), directly from Claude or any MCP-compatible AI assistant.
17
19
 
18
20
  Maps are built from detailed OpenStreetMap data served by MapNetwork's own Overpass API for Japan, so coverage is currently limited to **Japan (country code JP)** — requests for places outside Japan return an error.
19
21
 
22
+ Since MapNetwork is built for Japan, a Japanese version of this README is also available: [README.ja.md](https://github.com/toruproject/mapnetwork-mcp/blob/main/README.ja.md).
23
+
20
24
  ## Features
21
25
 
22
26
  - Generate a map from a place name or a list of markers
@@ -26,21 +30,29 @@ Maps are built from detailed OpenStreetMap data served by MapNetwork's own Overp
26
30
  - Slow-to-generate maps are handled automatically — `generate_*` tools poll internally, and `download_map` can pick up a job later if needed
27
31
  - Re-download a previously generated map in a different theme or format without regenerating
28
32
  - Open any generated map in the MapNetwork web editor for manual customization
33
+ - View any generated map in 3D — each result includes a link that draws a 3D rendering of the map in your own desktop browser and shows it as an image (not available on mobile devices)
29
34
 
30
35
  ## Example Usage
31
36
 
32
- **Prompt:** "Generate a map around the 21st Century Museum of Contemporary Art, Kanazawa."
37
+ **Prompt:** "城崎温泉の外湯を地図にして。" (Make a map of the public bathhouses of Kinosaki Onsen.)
38
+
39
+ The map it generated, saved to your Downloads folder:
40
+
41
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-download.png" width="600" alt="Map of the public bathhouses of Kinosaki Onsen">
42
+
43
+ The result also includes three links. Open them in a browser to get more out of the same map — no need to regenerate.
44
+
45
+ **Download link** — change the color theme by editing the link's `colorSet` parameter (here `&colorSet=black`):
46
+
47
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-black.png" width="600" alt="The same map in the black color theme">
33
48
 
34
- Here is the map it generated:
35
- <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-white.png" width="400" alt="Map Drawing Example">
49
+ **View 3D link** — a 3D rendering of the map, drawn in your desktop browser and shown as an image:
36
50
 
37
- **Prompt:** "Redownload that map in a few different color themes."
51
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-view3d.png" width="600" alt="3D rendering of the map">
38
52
 
39
- The same map, redownloaded in different color themes:
53
+ **Open in editor link** — customize the map by hand in the MapNetwork web editor (here: buildings hidden, patchwork turned on, and the popArt color theme applied):
40
54
 
41
- | Dark Green Style | Light Green Style | Pop Art Style | Black Style |
42
- |:-------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------:|:----------------------------------------------------------------:|:---------------------------------------------------------:|
43
- | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-darkGreen.png" width="160"> | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-lightGreen.png" width="160"> | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-popArt.png" width="160"> | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-black.png" width="160"> |
55
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-popArt.png" width="600" alt="The map customized in the web editor">
44
56
 
45
57
  ## Installation
46
58
 
@@ -96,7 +108,7 @@ https://mapnetwork.app/mcp
96
108
 
97
109
  In Claude, go to **Settings** → **Connectors** → **Add custom connector** and register the URL above.
98
110
 
99
- The key difference from this local server is how you receive the generated map image. Since `mapnetwork-mcp` runs on your PC, it can save the generated image directly to your Downloads folder. The remote server can't do this — most AI assistants are unable to properly display or save tool-result images within the chat — so instead of image data, it returns a text response with a download link and a link to edit the map at [mapnetwork.app](https://mapnetwork.app). Open the links in a browser to view or save the image, or to edit the map.
111
+ The key difference from this local server is how you receive the generated map image. Since `mapnetwork-mcp` runs on your PC, it can save the generated image directly to your Downloads folder. The remote server can't do this — most AI assistants are unable to properly display or save tool-result images within the chat — so instead of image data, it returns a text response with three links at [mapnetwork.app](https://mapnetwork.app): a download link for the PNG, a link to edit the map, and a link to view the map in 3D (the 3D rendering is drawn in your own desktop browser and shown as an image after a few seconds; it is not available on mobile devices). Open the links in a browser to view or save the image, to edit the map, or to see it in 3D. The local server returns the same three links after saving the PNG.
100
112
 
101
113
  ## Tools
102
114
 
@@ -0,0 +1,120 @@
1
+ [English](https://github.com/toruproject/mapnetwork-mcp/blob/main/README.md) | 日本語
2
+
3
+ # mapnetwork-mcp
4
+
5
+ [MapNetwork](https://mapnetwork.app) の MCP サーバーです。Claude などの MCP に対応した AI アシスタントから、日本の場所を、イラストのような見た目の地図の画像(PNG / SVG)にできます。
6
+
7
+ 地図は、MapNetwork が日本向けに運用している Overpass API の、詳しい OpenStreetMap のデータから作ります。そのため、対象は**日本(国コード JP)**の場所です。日本の地名や施設の名前を伝えるだけで、細かな地図ができます。
8
+
9
+ ## 特長
10
+
11
+ - 場所の名前、または複数のマーカーから地図を作れます
12
+ - 2つの場所の間の、徒歩・車のルートを重ねて描けます
13
+ - 11 のカラーテーマ(white、darkBlue、darkGreen、popArt、lightBlue、lightGreen、beige、magenta、gray、black、brown)
14
+ - PNG または SVG で出力し、ダウンロードフォルダーに保存します
15
+ - 作るのに時間がかかる地図も、自動で待ちます。`generate_*` のツールが中で完成を待ち、必要なら `download_map` で後から受け取れます
16
+ - 一度作った地図を、作り直さずに、別のカラーテーマや形式で取り直せます
17
+ - 作った地図を、MapNetwork の Web エディターで開いて、手で編集できます
18
+ - 作った地図を 3D で見られます。結果に付くリンクを開くと、お使いの PC のブラウザで 3D の地図を描き、画像として表示します(携帯端末では使えません)
19
+
20
+ ## 使用例
21
+
22
+ **プロンプト:**「城崎温泉の外湯を地図にして。」
23
+
24
+ できた地図です。ダウンロードフォルダーに保存されます。
25
+
26
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-download.png" width="600" alt="城崎温泉の外湯の地図">
27
+
28
+ 結果には、3つのリンクも付きます。ブラウザで開くと、作り直さずに、同じ地図をさらに活かせます。
29
+
30
+ **Download のリンク** — リンクの `colorSet` を書き換えると、カラーテーマを変えられます(この例は `&colorSet=black`)。
31
+
32
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-black.png" width="600" alt="同じ地図を black のカラーテーマにしたもの">
33
+
34
+ **View 3D のリンク** — お使いの PC のブラウザで 3D の地図を描き、画像として表示します。
35
+
36
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-view3d.png" width="600" alt="3D で描いた地図">
37
+
38
+ **Open in editor のリンク** — MapNetwork の Web エディターで、地図を手で編集できます(この例は、建物を消し、パッチワークをオンにし、popArt のカラーテーマにしたもの)。
39
+
40
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-popArt.png" width="600" alt="Web エディターで編集した地図">
41
+
42
+ ## インストール
43
+
44
+ ### Claude Desktop
45
+
46
+ #### .mcpb の拡張機能ファイルを使う(おすすめ)
47
+
48
+ いちばん簡単なのは、[Releases](https://github.com/toruproject/mapnetwork-mcp/releases) のページにある `.mcpb` の拡張機能ファイルを使う方法です。
49
+
50
+ 1. Releases のページから、最新の `.mcpb` ファイルをダウンロードします。
51
+ 2. Claude Desktop を開き、**Settings**(設定)→ **Extensions**(拡張機能)を開きます。
52
+ 3. ダウンロードした `.mcpb` ファイルを、拡張機能の画面にドラッグしてインストールします。
53
+
54
+ #### 手で設定する
55
+
56
+ `claude_desktop_config.json` に、次の内容を加えます。
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "mapnetwork": {
62
+ "command": "uvx",
63
+ "args": ["mapnetwork-mcp"],
64
+ "alwaysAllow": ["generate_map", "generate_markers_map", "generate_route_map", "download_map", "redownload_map"]
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ `uvx` の代わりに `pip` を使う場合:
71
+
72
+ ```bash
73
+ pip install mapnetwork-mcp
74
+ ```
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "mapnetwork": {
80
+ "command": "mapnetwork-mcp"
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## リモート MCP サーバー
87
+
88
+ 何もインストールせずに、リモート MCP サーバーから MapNetwork を使うこともできます。
89
+
90
+ ```
91
+ https://mapnetwork.app/mcp
92
+ ```
93
+
94
+ Claude で **Settings**(設定)→ **Connectors**(コネクタ)→ **Add custom connector**(カスタムコネクタを追加)を開き、上の URL を登録します。
95
+
96
+ このローカルのサーバーとの大きな違いは、できた地図の画像の受け取り方です。`mapnetwork-mcp` はお使いの PC で動くので、できた画像を、ダウンロードフォルダーに直接保存できます。リモートのサーバーにはこれができません(多くの AI アシスタントは、ツールの結果の画像を、チャットの中でうまく表示・保存できません)。そのため、画像のデータの代わりに、[mapnetwork.app](https://mapnetwork.app) の3つのリンクを、文章で返します。PNG のダウンロードのリンク、地図を編集するリンク、地図を 3D で見るリンクです(3D の地図は、お使いの PC のブラウザで描かれ、数秒後に画像として表示されます。携帯端末では使えません)。リンクをブラウザで開くと、画像を見たり保存したり、地図を編集したり、3D で見たりできます。ローカルのサーバーも、PNG を保存した後に、同じ3つのリンクを返します。
97
+
98
+ ## ツール
99
+
100
+ | ツール | 説明 |
101
+ |---|---|
102
+ | `generate_map` | 1つの場所を中心にした地図の画像を作り、ダウンロードフォルダーに保存します |
103
+ | `generate_markers_map` | 複数の場所にピンを立てた地図を作ります |
104
+ | `generate_route_map` | 2つの場所の間の徒歩・車のルートを求め、それを重ねた地図を作ります |
105
+ | `download_map` | 作っている途中の `generate_*` の地図を確かめ、できていれば受け取ります |
106
+ | `redownload_map` | 一度作った地図を、別のカラーテーマや形式で取り直します。作り直さないので、すぐにできます |
107
+
108
+ ## プロンプトの例
109
+
110
+ - 「東京タワー周辺の地図を作って」
111
+ - 「上野駅が最寄りの美術館・博物館を地図にして」
112
+ - 「赤坂駅から赤坂氷川神社までの徒歩ルートを地図にして」
113
+ - 「その地図を darkBlue テーマでSVG画像で出し直して」
114
+ - 「生成した地図の編集用リンクをください」
115
+
116
+ ## リンク
117
+
118
+ - Web UI:[https://mapnetwork.app](https://mapnetwork.app)
119
+ - Web UI のマニュアル:[https://mapnetwork.app/manual](https://mapnetwork.app/manual)
120
+ - API のドキュメント:[https://mapnetwork.app/openapi.json](https://mapnetwork.app/openapi.json)
@@ -1,9 +1,13 @@
1
+ English | [日本語](https://github.com/toruproject/mapnetwork-mcp/blob/main/README.ja.md)
2
+
1
3
  # mapnetwork-mcp
2
4
 
3
5
  MCP server for [MapNetwork](https://mapnetwork.app) — turn places in Japan into styled, illustration-like map images (PNG / SVG), directly from Claude or any MCP-compatible AI assistant.
4
6
 
5
7
  Maps are built from detailed OpenStreetMap data served by MapNetwork's own Overpass API for Japan, so coverage is currently limited to **Japan (country code JP)** — requests for places outside Japan return an error.
6
8
 
9
+ Since MapNetwork is built for Japan, a Japanese version of this README is also available: [README.ja.md](https://github.com/toruproject/mapnetwork-mcp/blob/main/README.ja.md).
10
+
7
11
  ## Features
8
12
 
9
13
  - Generate a map from a place name or a list of markers
@@ -13,21 +17,29 @@ Maps are built from detailed OpenStreetMap data served by MapNetwork's own Overp
13
17
  - Slow-to-generate maps are handled automatically — `generate_*` tools poll internally, and `download_map` can pick up a job later if needed
14
18
  - Re-download a previously generated map in a different theme or format without regenerating
15
19
  - Open any generated map in the MapNetwork web editor for manual customization
20
+ - View any generated map in 3D — each result includes a link that draws a 3D rendering of the map in your own desktop browser and shows it as an image (not available on mobile devices)
16
21
 
17
22
  ## Example Usage
18
23
 
19
- **Prompt:** "Generate a map around the 21st Century Museum of Contemporary Art, Kanazawa."
24
+ **Prompt:** "城崎温泉の外湯を地図にして。" (Make a map of the public bathhouses of Kinosaki Onsen.)
25
+
26
+ The map it generated, saved to your Downloads folder:
27
+
28
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-download.png" width="600" alt="Map of the public bathhouses of Kinosaki Onsen">
29
+
30
+ The result also includes three links. Open them in a browser to get more out of the same map — no need to regenerate.
31
+
32
+ **Download link** — change the color theme by editing the link's `colorSet` parameter (here `&colorSet=black`):
33
+
34
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-black.png" width="600" alt="The same map in the black color theme">
20
35
 
21
- Here is the map it generated:
22
- <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-white.png" width="400" alt="Map Drawing Example">
36
+ **View 3D link** — a 3D rendering of the map, drawn in your desktop browser and shown as an image:
23
37
 
24
- **Prompt:** "Redownload that map in a few different color themes."
38
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-view3d.png" width="600" alt="3D rendering of the map">
25
39
 
26
- The same map, redownloaded in different color themes:
40
+ **Open in editor link** — customize the map by hand in the MapNetwork web editor (here: buildings hidden, patchwork turned on, and the popArt color theme applied):
27
41
 
28
- | Dark Green Style | Light Green Style | Pop Art Style | Black Style |
29
- |:-------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------:|:----------------------------------------------------------------:|:---------------------------------------------------------:|
30
- | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-darkGreen.png" width="160"> | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-lightGreen.png" width="160"> | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-popArt.png" width="160"> | <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/Kanazawa21Museum-black.png" width="160"> |
42
+ <img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-popArt.png" width="600" alt="The map customized in the web editor">
31
43
 
32
44
  ## Installation
33
45
 
@@ -83,7 +95,7 @@ https://mapnetwork.app/mcp
83
95
 
84
96
  In Claude, go to **Settings** → **Connectors** → **Add custom connector** and register the URL above.
85
97
 
86
- The key difference from this local server is how you receive the generated map image. Since `mapnetwork-mcp` runs on your PC, it can save the generated image directly to your Downloads folder. The remote server can't do this — most AI assistants are unable to properly display or save tool-result images within the chat — so instead of image data, it returns a text response with a download link and a link to edit the map at [mapnetwork.app](https://mapnetwork.app). Open the links in a browser to view or save the image, or to edit the map.
98
+ The key difference from this local server is how you receive the generated map image. Since `mapnetwork-mcp` runs on your PC, it can save the generated image directly to your Downloads folder. The remote server can't do this — most AI assistants are unable to properly display or save tool-result images within the chat — so instead of image data, it returns a text response with three links at [mapnetwork.app](https://mapnetwork.app): a download link for the PNG, a link to edit the map, and a link to view the map in 3D (the 3D rendering is drawn in your own desktop browser and shown as an image after a few seconds; it is not available on mobile devices). Open the links in a browser to view or save the image, to edit the map, or to see it in 3D. The local server returns the same three links after saving the PNG.
87
99
 
88
100
  ## Tools
89
101
 
@@ -2,9 +2,9 @@
2
2
  "manifest_version": "0.4",
3
3
  "name": "mapnetwork-mcp",
4
4
  "display_name": "MapNetwork",
5
- "version": "6.1.1",
5
+ "version": "6.2.0",
6
6
  "description": "Generate styled PNG/SVG map images of places in Japan with 11 customizable color themes.",
7
- "long_description": "MCP server for MapNetwork — turn places in Japan into styled, illustration-like map images (PNG / SVG), directly from Claude.\n\nMaps are built from detailed OpenStreetMap data served by MapNetwork's own Overpass API for Japan, so coverage is currently limited to Japan (country code JP).\n\n- Generate a map from a place name or a list of markers\n- Overlay a walking / driving route between two places\n- 11 color themes (white, darkBlue, darkGreen, popArt, lightBlue, lightGreen, beige, magenta, gray, black, brown)\n- PNG or SVG output, saved to your Downloads folder\n- Re-download a previously generated map in a different theme or format without regenerating\n- Open any generated map in the MapNetwork web editor for manual customization",
7
+ "long_description": "MCP server for MapNetwork — turn places in Japan into styled, illustration-like map images (PNG / SVG), directly from Claude.\n\nMaps are built from detailed OpenStreetMap data served by MapNetwork's own Overpass API for Japan, so coverage is currently limited to Japan (country code JP).\n\n- Generate a map from a place name or a list of markers\n- Overlay a walking / driving route between two places\n- 11 color themes (white, darkBlue, darkGreen, popArt, lightBlue, lightGreen, beige, magenta, gray, black, brown)\n- PNG or SVG output, saved to your Downloads folder\n- Re-download a previously generated map in a different theme or format without regenerating\n- Open any generated map in the MapNetwork web editor for manual customization\n- View any generated map in 3D — each result includes a link that draws a 3D rendering of the map in your own desktop browser and shows it as an image (not available on mobile devices)",
8
8
  "author": {
9
9
  "name": "toruproject",
10
10
  "url": "https://github.com/toruproject"
@@ -15,6 +15,16 @@ from mcp.server.fastmcp import Context, FastMCP, Image
15
15
  from pydantic import BaseModel, ConfigDict, Field
16
16
 
17
17
  BASE_URL = os.environ.get("MAPNETWORK_BASE_URL", "https://mapnetwork.app")
18
+ # 結果のリンクのカラーセット(&colorSet=...)。generate_*はカラーセットを指定できない(MCPのホストが色を指定できるほど正確に
19
+ # 扱えないため)ので、リンクごとの決まった色を付ける。バックエンドの/statusが同じ色を付けて返す場合(新しいバージョン)は
20
+ # そのまま使い、色の無いリンクや、3Dのリンクを返さない古いバージョンでは、ここで補う
21
+ LINK_COLOR_SETS = {"download": "darkGreen", "editor": "darkGreen", "view3d": "lightGreen"}
22
+
23
+
24
+ def _with_default_color(url: str, link: str) -> str:
25
+ """リンクに&colorSet=...が無ければ、リンクごとの決まった色を加える。"""
26
+ return url if "colorSet=" in url else f"{url}&colorSet={LINK_COLOR_SETS[link]}"
27
+
18
28
  POLL_INTERVAL_SEC = 10.0
19
29
  MAX_WAIT_SEC = 600
20
30
  # MCPクライアントによっては、report_progressで進捗通知を送ってもtools/call自体の
@@ -77,8 +87,9 @@ mcp = FastMCP(
77
87
  "MapNetwork supports 11 color themes (white, darkBlue, darkGreen, popArt, lightBlue, "
78
88
  "lightGreen, beige, magenta, gray, black, brown).\n\n"
79
89
  "## Sharing the generated map\n"
80
- "Every successful result includes a Download link and an 'Open in editor' link — "
81
- "mention both to the user.\n\n"
90
+ "Every successful result includes a Download link, an 'Open in editor' link, and a View 3D link "
91
+ "(a 3D rendering of the map, drawn in the user's own desktop browser and shown as an image after a few seconds — "
92
+ "for the user to open, not for you to fetch; not available on mobile devices) — mention them to the user.\n\n"
82
93
  "## Parameter discipline\n"
83
94
  "- **place/label**: `place`, a marker's `label`, and route's `from`/`to` must each be a "
84
95
  "place name specific enough for the server to geocode it to a single, unambiguous "
@@ -148,15 +159,22 @@ async def _poll_with_budget(
148
159
  elapsed += POLL_INTERVAL_SEC
149
160
 
150
161
 
151
- def _build_success_result(image_bytes: bytes, out_path: Path, data_key: str, download_url: str, editor_url: str) -> list:
162
+ def _build_success_result(image_bytes: bytes, out_path: Path, data_key: str, status_json: dict) -> list:
152
163
  out_path.write_bytes(image_bytes)
164
+ download_url = _with_default_color(status_json["downloadUrl"], "download")
165
+ editor_url = _with_default_color(status_json["editorUrl"], "editor")
166
+ # 3D地図の画像を利用者のブラウザで作って表示するページ。古いバックエンド(view3dUrlを返さない)では、自前で組み立てる
167
+ view3d_url = _with_default_color(
168
+ status_json.get("view3dUrl") or f"{BASE_URL}/view3d?dataKey={data_key}", "view3d")
169
+ view3d_line = f"View 3D (a 3D rendering of this map, drawn in the user's own desktop browser and shown as an image after a few seconds; for the user to open — not for you to fetch; not available on mobile devices): {view3d_url}\n\n"
153
170
  return [
154
171
  Image(data=image_bytes, format="png"),
155
172
  (
156
173
  f"Map saved: {out_path}\n"
157
174
  f"dataKey: {data_key}\n\n"
158
- f"Download: {download_url}\n"
175
+ f"Download: {download_url}\n\n"
159
176
  f"Open in editor: {editor_url}\n\n"
177
+ f"{view3d_line}"
160
178
  f"Tip: call redownload_map(data_key='{data_key}', ...) to get this map "
161
179
  f"in a different color theme or format (svg/png) without regenerating."
162
180
  ),
@@ -223,10 +241,7 @@ async def _generate_map_common(body: dict, ctx: Context | None, label: str | Non
223
241
  image_bytes = await _download(client, data_key, "png", None)
224
242
 
225
243
  filename_base = status_json.get("name") or label or data_key
226
- return _build_success_result(
227
- image_bytes, _make_filename(filename_base, "png"), data_key,
228
- status_json["downloadUrl"], status_json["editorUrl"],
229
- )
244
+ return _build_success_result(image_bytes, _make_filename(filename_base, "png"), data_key, status_json)
230
245
 
231
246
 
232
247
  # ---------------------------------------------------------------------------
@@ -356,10 +371,7 @@ async def download_map(
356
371
  image_bytes = await _download(client, data_key, "png", None)
357
372
 
358
373
  filename_base = status_json.get("name") or data_key
359
- return _build_success_result(
360
- image_bytes, _make_filename(filename_base, "png"), data_key,
361
- status_json["downloadUrl"], status_json["editorUrl"],
362
- )
374
+ return _build_success_result(image_bytes, _make_filename(filename_base, "png"), data_key, status_json)
363
375
 
364
376
 
365
377
  # ---------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mapnetwork-mcp"
3
- version = "6.1.1"
3
+ version = "6.2.0"
4
4
  description = "MCP server — generate styled map images via mapnetwork.app"
5
5
  readme = "README.md"
6
6
  license = "MIT"
File without changes
File without changes