mapnetwork-mcp 6.2.0__tar.gz → 6.3.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.
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/PKG-INFO +14 -10
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/README.ja.md +13 -9
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/README.md +13 -9
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-blueprint.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-kirie-3d.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-kirie.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-neon.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-stainedglass.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-sumie.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-tegaki.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-textile.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-ukiyoe.png +0 -0
- mapnetwork_mcp-6.3.0/images/KinosakiSotoyu-watercolor.png +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/manifest.json +4 -4
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/mapnetwork_mcp/server.py +35 -31
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/pyproject.toml +1 -1
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/spec/input_schema.json +16 -5
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/spec/output_schema.json +4 -4
- mapnetwork_mcp-6.2.0/images/Kanazawa21Museum-black.png +0 -0
- mapnetwork_mcp-6.2.0/images/Kanazawa21Museum-darkGreen.png +0 -0
- mapnetwork_mcp-6.2.0/images/Kanazawa21Museum-grey.png +0 -0
- mapnetwork_mcp-6.2.0/images/Kanazawa21Museum-lightGreen.png +0 -0
- mapnetwork_mcp-6.2.0/images/Kanazawa21Museum-popArt.png +0 -0
- mapnetwork_mcp-6.2.0/images/Kanazawa21Museum-white.png +0 -0
- mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-black.png +0 -0
- mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-download.png +0 -0
- mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-popArt.png +0 -0
- mapnetwork_mcp-6.2.0/images/KinosakiSotoyu-view3d.png +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/.github/workflows/workflow.yml +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/.gitignore +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/.mcpbignore +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/LICENSE +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/LOCALTEST.md +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/RELEASING.md +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/SECURITY.md +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/mapnetwork_mcp/__init__.py +0 -0
- {mapnetwork_mcp-6.2.0 → mapnetwork_mcp-6.3.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mapnetwork-mcp
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.3.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
|
|
@@ -25,10 +25,11 @@ Since MapNetwork is built for Japan, a Japanese version of this README is also a
|
|
|
25
25
|
|
|
26
26
|
- Generate a map from a place name or a list of markers
|
|
27
27
|
- Overlay a walking / driving route between two places
|
|
28
|
-
-
|
|
28
|
+
- 9 drawing styles (kirie / paper-cut, textile, tegaki / hand-drawn, watercolor, ukiyoe, stainedglass, blueprint, neon, sumie / ink wash), each with its own default colors
|
|
29
|
+
- 10 color themes (darkBlue, darkGreen, popArt, lightGreen, beige, white, gray, brown, monochrome, macaron)
|
|
29
30
|
- PNG or SVG output, saved to your Downloads folder
|
|
30
31
|
- Slow-to-generate maps are handled automatically — `generate_*` tools poll internally, and `download_map` can pick up a job later if needed
|
|
31
|
-
- Re-download a previously generated map in a different theme or format without regenerating
|
|
32
|
+
- Re-download a previously generated map in a different style, theme or format without regenerating
|
|
32
33
|
- Open any generated map in the MapNetwork web editor for manual customization
|
|
33
34
|
- 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)
|
|
34
35
|
|
|
@@ -38,21 +39,24 @@ Since MapNetwork is built for Japan, a Japanese version of this README is also a
|
|
|
38
39
|
|
|
39
40
|
The map it generated, saved to your Downloads folder:
|
|
40
41
|
|
|
41
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-
|
|
42
|
+
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-kirie.png" width="600" alt="Map of the public bathhouses of Kinosaki Onsen">
|
|
42
43
|
|
|
43
44
|
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
|
|
|
45
|
-
**Download link** — change the
|
|
46
|
+
**Download link** — add parameters to the link to change the drawing style (e.g. `&drawingStyle=ukiyoe`) or the color theme (e.g. `&colorSet=darkBlue`):
|
|
46
47
|
|
|
47
|
-
<
|
|
48
|
+
<table>
|
|
49
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-textile.png" width="290" alt="textile"><br>textile</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-tegaki.png" width="290" alt="tegaki"><br>tegaki</td></tr>
|
|
50
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-watercolor.png" width="290" alt="watercolor"><br>watercolor</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-ukiyoe.png" width="290" alt="ukiyoe"><br>ukiyoe</td></tr>
|
|
51
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-stainedglass.png" width="290" alt="stainedglass"><br>stainedglass</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-blueprint.png" width="290" alt="blueprint"><br>blueprint</td></tr>
|
|
52
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-neon.png" width="290" alt="neon"><br>neon</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-sumie.png" width="290" alt="sumie"><br>sumie</td></tr>
|
|
53
|
+
</table>
|
|
48
54
|
|
|
49
55
|
**View 3D link** — a 3D rendering of the map, drawn in your desktop browser and shown as an image:
|
|
50
56
|
|
|
51
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-
|
|
57
|
+
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-kirie-3d.png" width="600" alt="3D rendering of the map">
|
|
52
58
|
|
|
53
|
-
**Open in editor link** — customize the map by hand in the MapNetwork web editor (
|
|
54
|
-
|
|
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">
|
|
59
|
+
**Open in editor link** — customize the map by hand in the MapNetwork web editor (change the drawing style and colors, show or hide buildings, edit the markers, and more).
|
|
56
60
|
|
|
57
61
|
## Installation
|
|
58
62
|
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
- 場所の名前、または複数のマーカーから地図を作れます
|
|
12
12
|
- 2つの場所の間の、徒歩・車のルートを重ねて描けます
|
|
13
|
-
-
|
|
13
|
+
- 9 つの描き方(切り絵調 kirie・textile・手書き調 tegaki・watercolor・ukiyoe・stainedglass・blueprint・neon・水墨画調 sumie)。それぞれに、既定の色があります
|
|
14
|
+
- 10 のカラーテーマ(darkBlue、darkGreen、popArt、lightGreen、beige、white、gray、brown、monochrome、macaron)
|
|
14
15
|
- PNG または SVG で出力し、ダウンロードフォルダーに保存します
|
|
15
16
|
- 作るのに時間がかかる地図も、自動で待ちます。`generate_*` のツールが中で完成を待ち、必要なら `download_map` で後から受け取れます
|
|
16
|
-
-
|
|
17
|
+
- 一度作った地図を、作り直さずに、別の描き方・カラーテーマ・形式で取り直せます
|
|
17
18
|
- 作った地図を、MapNetwork の Web エディターで開いて、手で編集できます
|
|
18
19
|
- 作った地図を 3D で見られます。結果に付くリンクを開くと、お使いの PC のブラウザで 3D の地図を描き、画像として表示します(携帯端末では使えません)
|
|
19
20
|
|
|
@@ -23,21 +24,24 @@
|
|
|
23
24
|
|
|
24
25
|
できた地図です。ダウンロードフォルダーに保存されます。
|
|
25
26
|
|
|
26
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-
|
|
27
|
+
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-kirie.png" width="600" alt="城崎温泉の外湯の地図">
|
|
27
28
|
|
|
28
29
|
結果には、3つのリンクも付きます。ブラウザで開くと、作り直さずに、同じ地図をさらに活かせます。
|
|
29
30
|
|
|
30
|
-
**Download のリンク** —
|
|
31
|
+
**Download のリンク** — リンクにパラメーターを書き足すと、描き方(`&drawingStyle=ukiyoe` など)や、カラーテーマ(例: `&colorSet=darkBlue`)を変えられます。
|
|
31
32
|
|
|
32
|
-
<
|
|
33
|
+
<table>
|
|
34
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-textile.png" width="290" alt="textile"><br>textile</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-tegaki.png" width="290" alt="tegaki"><br>tegaki</td></tr>
|
|
35
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-watercolor.png" width="290" alt="watercolor"><br>watercolor</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-ukiyoe.png" width="290" alt="ukiyoe"><br>ukiyoe</td></tr>
|
|
36
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-stainedglass.png" width="290" alt="stainedglass"><br>stainedglass</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-blueprint.png" width="290" alt="blueprint"><br>blueprint</td></tr>
|
|
37
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-neon.png" width="290" alt="neon"><br>neon</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-sumie.png" width="290" alt="sumie"><br>sumie</td></tr>
|
|
38
|
+
</table>
|
|
33
39
|
|
|
34
40
|
**View 3D のリンク** — お使いの PC のブラウザで 3D の地図を描き、画像として表示します。
|
|
35
41
|
|
|
36
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-
|
|
42
|
+
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-kirie-3d.png" width="600" alt="3D で描いた地図">
|
|
37
43
|
|
|
38
|
-
**Open in editor のリンク** — MapNetwork の Web
|
|
39
|
-
|
|
40
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-popArt.png" width="600" alt="Web エディターで編集した地図">
|
|
44
|
+
**Open in editor のリンク** — MapNetwork の Web エディターで、地図を手で編集できます(描き方や色の変更、建物の表示・非表示、マーカーの編集など)。
|
|
41
45
|
|
|
42
46
|
## インストール
|
|
43
47
|
|
|
@@ -12,10 +12,11 @@ Since MapNetwork is built for Japan, a Japanese version of this README is also a
|
|
|
12
12
|
|
|
13
13
|
- Generate a map from a place name or a list of markers
|
|
14
14
|
- Overlay a walking / driving route between two places
|
|
15
|
-
-
|
|
15
|
+
- 9 drawing styles (kirie / paper-cut, textile, tegaki / hand-drawn, watercolor, ukiyoe, stainedglass, blueprint, neon, sumie / ink wash), each with its own default colors
|
|
16
|
+
- 10 color themes (darkBlue, darkGreen, popArt, lightGreen, beige, white, gray, brown, monochrome, macaron)
|
|
16
17
|
- PNG or SVG output, saved to your Downloads folder
|
|
17
18
|
- Slow-to-generate maps are handled automatically — `generate_*` tools poll internally, and `download_map` can pick up a job later if needed
|
|
18
|
-
- Re-download a previously generated map in a different theme or format without regenerating
|
|
19
|
+
- Re-download a previously generated map in a different style, theme or format without regenerating
|
|
19
20
|
- Open any generated map in the MapNetwork web editor for manual customization
|
|
20
21
|
- 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)
|
|
21
22
|
|
|
@@ -25,21 +26,24 @@ Since MapNetwork is built for Japan, a Japanese version of this README is also a
|
|
|
25
26
|
|
|
26
27
|
The map it generated, saved to your Downloads folder:
|
|
27
28
|
|
|
28
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-
|
|
29
|
+
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-kirie.png" width="600" alt="Map of the public bathhouses of Kinosaki Onsen">
|
|
29
30
|
|
|
30
31
|
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
|
|
|
32
|
-
**Download link** — change the
|
|
33
|
+
**Download link** — add parameters to the link to change the drawing style (e.g. `&drawingStyle=ukiyoe`) or the color theme (e.g. `&colorSet=darkBlue`):
|
|
33
34
|
|
|
34
|
-
<
|
|
35
|
+
<table>
|
|
36
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-textile.png" width="290" alt="textile"><br>textile</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-tegaki.png" width="290" alt="tegaki"><br>tegaki</td></tr>
|
|
37
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-watercolor.png" width="290" alt="watercolor"><br>watercolor</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-ukiyoe.png" width="290" alt="ukiyoe"><br>ukiyoe</td></tr>
|
|
38
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-stainedglass.png" width="290" alt="stainedglass"><br>stainedglass</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-blueprint.png" width="290" alt="blueprint"><br>blueprint</td></tr>
|
|
39
|
+
<tr><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-neon.png" width="290" alt="neon"><br>neon</td><td align="center"><img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-sumie.png" width="290" alt="sumie"><br>sumie</td></tr>
|
|
40
|
+
</table>
|
|
35
41
|
|
|
36
42
|
**View 3D link** — a 3D rendering of the map, drawn in your desktop browser and shown as an image:
|
|
37
43
|
|
|
38
|
-
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-
|
|
44
|
+
<img src="https://raw.githubusercontent.com/toruproject/mapnetwork-mcp/main/images/KinosakiSotoyu-kirie-3d.png" width="600" alt="3D rendering of the map">
|
|
39
45
|
|
|
40
|
-
**Open in editor link** — customize the map by hand in the MapNetwork web editor (
|
|
41
|
-
|
|
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">
|
|
46
|
+
**Open in editor link** — customize the map by hand in the MapNetwork web editor (change the drawing style and colors, show or hide buildings, edit the markers, and more).
|
|
43
47
|
|
|
44
48
|
## Installation
|
|
45
49
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"manifest_version": "0.4",
|
|
3
3
|
"name": "mapnetwork-mcp",
|
|
4
4
|
"display_name": "MapNetwork",
|
|
5
|
-
"version": "6.
|
|
6
|
-
"description": "Generate styled PNG/SVG map images of places in Japan with
|
|
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-
|
|
5
|
+
"version": "6.3.0",
|
|
6
|
+
"description": "Generate styled PNG/SVG map images of places in Japan with 10 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- 10 color themes (darkBlue, darkGreen, popArt, lightGreen, beige, white, gray, brown, monochrome, macaron)\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"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"name": "redownload_map",
|
|
44
|
-
"description": "Re-download a previously generated map in a different color theme or format"
|
|
44
|
+
"description": "Re-download a previously generated map in a different drawing style, color theme or format"
|
|
45
45
|
}
|
|
46
46
|
],
|
|
47
47
|
"compatibility": {
|
|
@@ -12,18 +12,10 @@ from typing import Annotated, Literal
|
|
|
12
12
|
|
|
13
13
|
import httpx
|
|
14
14
|
from mcp.server.fastmcp import Context, FastMCP, Image
|
|
15
|
+
from mcp.types import ToolAnnotations
|
|
15
16
|
from pydantic import BaseModel, ConfigDict, Field
|
|
16
17
|
|
|
17
18
|
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
19
|
|
|
28
20
|
POLL_INTERVAL_SEC = 10.0
|
|
29
21
|
MAX_WAIT_SEC = 600
|
|
@@ -82,10 +74,16 @@ mcp = FastMCP(
|
|
|
82
74
|
"## Important: re-download without regenerating\n"
|
|
83
75
|
"After generating a map, the tool returns a `dataKey`. "
|
|
84
76
|
"You can call `redownload_map` with that `dataKey` to get the same map in a different "
|
|
85
|
-
"color theme or format (png/svg) — **no regeneration needed**. "
|
|
86
|
-
"Use this when the user asks to change only the appearance after already generating the map
|
|
87
|
-
"
|
|
88
|
-
"
|
|
77
|
+
"drawing style, color theme or format (png/svg) — **no regeneration needed**. "
|
|
78
|
+
"Use this when the user asks to change only the appearance after already generating the map.\n"
|
|
79
|
+
"- `drawing_style` (the look of the drawing): kirie (default, paper-cut) | textile | tegaki (hand-drawn) | "
|
|
80
|
+
"watercolor | ukiyoe | stainedglass | blueprint | neon | sumie (ink wash). "
|
|
81
|
+
"Each style comes with its own default color theme, so set `color_set` only when the user asks for a specific color.\n"
|
|
82
|
+
"- `color_set` (colors): 10 color themes (darkBlue, darkGreen, popArt, lightGreen, beige, "
|
|
83
|
+
"white, gray, brown, monochrome, macaron). The drawing styles' own color themes "
|
|
84
|
+
"(watercolor, ukiyoe, stainedglass, blueprint, neon, sumie) are also accepted.\n"
|
|
85
|
+
"The result's Download / Open in editor / View 3D links also accept `&drawingStyle=...` and `&colorSet=...` "
|
|
86
|
+
"added to the URL (the links carry no color of their own, so the style's default colors are used).\n\n"
|
|
89
87
|
"## Sharing the generated map\n"
|
|
90
88
|
"Every successful result includes a Download link, an 'Open in editor' link, and a View 3D link "
|
|
91
89
|
"(a 3D rendering of the map, drawn in the user's own desktop browser and shown as an image after a few seconds — "
|
|
@@ -114,8 +112,10 @@ def _make_filename(label: str, format: str) -> Path:
|
|
|
114
112
|
|
|
115
113
|
|
|
116
114
|
async def _download(client: httpx.AsyncClient, data_key: str, format: str,
|
|
117
|
-
color_set: str | None) -> bytes:
|
|
115
|
+
drawing_style: str | None = None, color_set: str | None = None) -> bytes:
|
|
118
116
|
params: dict = {"dataKey": data_key, "format": format}
|
|
117
|
+
if drawing_style is not None:
|
|
118
|
+
params["drawingStyle"] = drawing_style
|
|
119
119
|
if color_set is not None:
|
|
120
120
|
params["colorSet"] = color_set
|
|
121
121
|
resp = await client.get(f"{BASE_URL}/download", params=params, timeout=60)
|
|
@@ -161,11 +161,10 @@ async def _poll_with_budget(
|
|
|
161
161
|
|
|
162
162
|
def _build_success_result(image_bytes: bytes, out_path: Path, data_key: str, status_json: dict) -> list:
|
|
163
163
|
out_path.write_bytes(image_bytes)
|
|
164
|
-
download_url =
|
|
165
|
-
editor_url =
|
|
164
|
+
download_url = status_json["downloadUrl"]
|
|
165
|
+
editor_url = status_json["editorUrl"]
|
|
166
166
|
# 3D地図の画像を利用者のブラウザで作って表示するページ。古いバックエンド(view3dUrlを返さない)では、自前で組み立てる
|
|
167
|
-
view3d_url =
|
|
168
|
-
status_json.get("view3dUrl") or f"{BASE_URL}/view3d?dataKey={data_key}", "view3d")
|
|
167
|
+
view3d_url = status_json.get("view3dUrl") or f"{BASE_URL}/view3d?dataKey={data_key}"
|
|
169
168
|
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"
|
|
170
169
|
return [
|
|
171
170
|
Image(data=image_bytes, format="png"),
|
|
@@ -176,7 +175,7 @@ def _build_success_result(image_bytes: bytes, out_path: Path, data_key: str, sta
|
|
|
176
175
|
f"Open in editor: {editor_url}\n\n"
|
|
177
176
|
f"{view3d_line}"
|
|
178
177
|
f"Tip: call redownload_map(data_key='{data_key}', ...) to get this map "
|
|
179
|
-
f"in a different color theme or format (svg/png) without regenerating."
|
|
178
|
+
f"in a different drawing style, color theme or format (svg/png) without regenerating."
|
|
180
179
|
),
|
|
181
180
|
]
|
|
182
181
|
|
|
@@ -210,7 +209,7 @@ async def _generate_map_common(body: dict, ctx: Context | None, label: str | Non
|
|
|
210
209
|
明示していればbody["name"]としてバックエンドへ渡り、そのままconfigDict.nameになる。
|
|
211
210
|
省略時はバックエンド側がplace/markers/routeから同じ表示名を自動で導出する。labelは
|
|
212
211
|
/statusにnameが含まれない場合(古いバックエンド等)だけのフォールバックとして使う。
|
|
213
|
-
常にformat="png"
|
|
212
|
+
常にformat="png"・既定の描き方・色でダウンロードする(別の見た目が欲しければ
|
|
214
213
|
redownload_mapで取り直す)。"""
|
|
215
214
|
async with httpx.AsyncClient() as client:
|
|
216
215
|
# 1. Enqueue
|
|
@@ -238,7 +237,7 @@ async def _generate_map_common(body: dict, ctx: Context | None, label: str | Non
|
|
|
238
237
|
return _still_in_progress_result(data_key)
|
|
239
238
|
|
|
240
239
|
# 3. Download(downloadUrl/editorUrlは/statusレスポンスに既に含まれている)
|
|
241
|
-
image_bytes = await _download(client, data_key, "png"
|
|
240
|
+
image_bytes = await _download(client, data_key, "png")
|
|
242
241
|
|
|
243
242
|
filename_base = status_json.get("name") or label or data_key
|
|
244
243
|
return _build_success_result(image_bytes, _make_filename(filename_base, "png"), data_key, status_json)
|
|
@@ -248,7 +247,7 @@ async def _generate_map_common(body: dict, ctx: Context | None, label: str | Non
|
|
|
248
247
|
# Tool: generate_map
|
|
249
248
|
# ---------------------------------------------------------------------------
|
|
250
249
|
|
|
251
|
-
@mcp.tool()
|
|
250
|
+
@mcp.tool(annotations=ToolAnnotations(title="Generate a map of a place", readOnlyHint=False, destructiveHint=False, openWorldHint=True))
|
|
252
251
|
async def generate_map(
|
|
253
252
|
place: Annotated[str, Field(description="Place name to center the map on (geocoded server-side).")],
|
|
254
253
|
name: Annotated[
|
|
@@ -271,7 +270,7 @@ async def generate_map(
|
|
|
271
270
|
# Tool: generate_markers_map
|
|
272
271
|
# ---------------------------------------------------------------------------
|
|
273
272
|
|
|
274
|
-
@mcp.tool()
|
|
273
|
+
@mcp.tool(annotations=ToolAnnotations(title="Generate a map with markers", readOnlyHint=False, destructiveHint=False, openWorldHint=True))
|
|
275
274
|
async def generate_markers_map(
|
|
276
275
|
markers: Annotated[
|
|
277
276
|
list[Marker], Field(description="Locations to pin on the map. At least one required.")
|
|
@@ -305,7 +304,7 @@ async def generate_markers_map(
|
|
|
305
304
|
# Tool: generate_route_map
|
|
306
305
|
# ---------------------------------------------------------------------------
|
|
307
306
|
|
|
308
|
-
@mcp.tool()
|
|
307
|
+
@mcp.tool(annotations=ToolAnnotations(title="Generate a route map", readOnlyHint=False, destructiveHint=False, openWorldHint=True))
|
|
309
308
|
async def generate_route_map(
|
|
310
309
|
# Pythonの予約語のため実引数名は'from_'。JSON上のキー名はvalidation_aliasで'from'にする
|
|
311
310
|
# (Field(alias=...)だとFastMCPが関数呼び出し時もalias名でキーワード引数を組み立てて
|
|
@@ -345,7 +344,7 @@ async def generate_route_map(
|
|
|
345
344
|
# Tool: download_map
|
|
346
345
|
# ---------------------------------------------------------------------------
|
|
347
346
|
|
|
348
|
-
@mcp.tool()
|
|
347
|
+
@mcp.tool(annotations=ToolAnnotations(title="Download a pending map", readOnlyHint=False, destructiveHint=False, openWorldHint=True))
|
|
349
348
|
async def download_map(
|
|
350
349
|
data_key: Annotated[
|
|
351
350
|
str,
|
|
@@ -368,7 +367,7 @@ async def download_map(
|
|
|
368
367
|
if status != "ready":
|
|
369
368
|
return _still_in_progress_result(data_key)
|
|
370
369
|
|
|
371
|
-
image_bytes = await _download(client, data_key, "png"
|
|
370
|
+
image_bytes = await _download(client, data_key, "png")
|
|
372
371
|
|
|
373
372
|
filename_base = status_json.get("name") or data_key
|
|
374
373
|
return _build_success_result(image_bytes, _make_filename(filename_base, "png"), data_key, status_json)
|
|
@@ -378,21 +377,26 @@ async def download_map(
|
|
|
378
377
|
# Tool: redownload_map
|
|
379
378
|
# ---------------------------------------------------------------------------
|
|
380
379
|
|
|
381
|
-
@mcp.tool()
|
|
380
|
+
@mcp.tool(annotations=ToolAnnotations(title="Re-download a map in another style, theme or format", readOnlyHint=False, destructiveHint=False, openWorldHint=True))
|
|
382
381
|
async def redownload_map(
|
|
383
382
|
data_key: Annotated[str, Field(description="The dataKey returned by a previous generate_* call.")],
|
|
383
|
+
drawing_style: Annotated[
|
|
384
|
+
Literal["kirie", "textile", "tegaki", "watercolor", "ukiyoe", "stainedglass", "blueprint", "neon", "sumie"] | None,
|
|
385
|
+
Field(description="Drawing style — see server instructions for the list. Each style has its own default color theme, "
|
|
386
|
+
"which is used unless color_set is also given. Only set when explicitly requested."),
|
|
387
|
+
] = None,
|
|
384
388
|
color_set: Annotated[
|
|
385
389
|
str | None,
|
|
386
390
|
Field(description="Color theme — see server instructions for the list. Only set when explicitly requested."),
|
|
387
391
|
] = None,
|
|
388
392
|
format: Annotated[Literal["png", "svg"], Field(description="'png' (raster) or 'svg' (vector).")] = "png",
|
|
389
393
|
) -> list:
|
|
390
|
-
"""Re-download a prior map in a different color theme or format — instant, no regeneration.
|
|
394
|
+
"""Re-download a prior map in a different drawing style, color theme or format — instant, no regeneration.
|
|
391
395
|
|
|
392
|
-
Example: redownload_map(data_key="20260618aBcDeFgHiJ",
|
|
396
|
+
Example: redownload_map(data_key="20260618aBcDeFgHiJ", drawing_style="ukiyoe")
|
|
393
397
|
"""
|
|
394
398
|
async with httpx.AsyncClient() as client:
|
|
395
|
-
image_bytes = await _download(client, data_key, format, color_set)
|
|
399
|
+
image_bytes = await _download(client, data_key, format, drawing_style, color_set)
|
|
396
400
|
|
|
397
401
|
out_path = _make_filename(data_key, format)
|
|
398
402
|
out_path.write_bytes(image_bytes)
|
|
@@ -403,7 +407,7 @@ async def redownload_map(
|
|
|
403
407
|
image_format = "svg+xml" if format == "svg" else format
|
|
404
408
|
return [
|
|
405
409
|
Image(data=image_bytes, format=image_format),
|
|
406
|
-
f"Map saved: {out_path} (dataKey={data_key}, colorSet={color_set}, format={format})",
|
|
410
|
+
f"Map saved: {out_path} (dataKey={data_key}, drawingStyle={drawing_style}, colorSet={color_set}, format={format})",
|
|
407
411
|
]
|
|
408
412
|
|
|
409
413
|
|
|
@@ -14,9 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"ColorSet": {
|
|
16
16
|
"type": "string",
|
|
17
|
-
"description": "
|
|
18
|
-
"enum": ["white", "
|
|
19
|
-
"default": "
|
|
17
|
+
"description": "カラーテーマ。10種類のほか、描き方専用のカラーテーマ(watercolor・ukiyoe・stainedglass・blueprint・neon・sumie)も受け付ける。指定しなければ、描き方の既定のカラーテーマ(kirie: lightGreen)",
|
|
18
|
+
"enum": ["darkBlue", "darkGreen", "popArt", "lightGreen", "beige", "white", "gray", "brown", "monochrome", "macaron", "watercolor", "ukiyoe", "stainedglass", "blueprint", "neon", "sumie"],
|
|
19
|
+
"default": "lightGreen"
|
|
20
|
+
},
|
|
21
|
+
"DrawingStyle": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "描き方(絵の見た目)。各描き方に、既定のカラーテーマがある(color_setを指定しない時は、それが使われる)",
|
|
24
|
+
"enum": ["kirie", "textile", "tegaki", "watercolor", "ukiyoe", "stainedglass", "blueprint", "neon", "sumie"],
|
|
25
|
+
"default": "kirie"
|
|
20
26
|
},
|
|
21
27
|
"Format": {
|
|
22
28
|
"type": "string",
|
|
@@ -90,10 +96,15 @@
|
|
|
90
96
|
"example": { "data_key": "20260618aBcDeFgHiJ" }
|
|
91
97
|
},
|
|
92
98
|
"redownload_map": {
|
|
93
|
-
"description": "
|
|
99
|
+
"description": "生成済みの地図を、再生成せずに別の描き方/カラーテーマ/形式で再ダウンロードする",
|
|
94
100
|
"type": "object",
|
|
95
101
|
"properties": {
|
|
96
102
|
"data_key": { "type": "string", "description": "以前のgenerate_*ツール呼び出しが返したdataKey", "required": true },
|
|
103
|
+
"drawing_style": {
|
|
104
|
+
"oneOf": [{ "$ref": "#/definitions/DrawingStyle" }, { "type": "null" }],
|
|
105
|
+
"default": null,
|
|
106
|
+
"description": "ユーザーが明示的に要求した場合のみ設定。color_setを指定しなければ、その描き方の既定のカラーテーマになる"
|
|
107
|
+
},
|
|
97
108
|
"color_set": {
|
|
98
109
|
"oneOf": [{ "$ref": "#/definitions/ColorSet" }, { "type": "null" }],
|
|
99
110
|
"default": null,
|
|
@@ -103,7 +114,7 @@
|
|
|
103
114
|
},
|
|
104
115
|
"required": ["data_key"],
|
|
105
116
|
"constraints": ["canvas_width/canvas_heightは廃止済み"],
|
|
106
|
-
"example": { "data_key": "20260618aBcDeFgHiJ", "
|
|
117
|
+
"example": { "data_key": "20260618aBcDeFgHiJ", "drawing_style": "ukiyoe" }
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
120
|
}
|
|
@@ -195,8 +195,8 @@
|
|
|
195
195
|
"properties": {
|
|
196
196
|
"text": {
|
|
197
197
|
"type": "string",
|
|
198
|
-
"pattern": "^Map saved: .+ \\(dataKey=.+, colorSet=.*, format=(png|svg)\\)$",
|
|
199
|
-
"description": "'Map saved: <path> (dataKey=<dataKey>, colorSet=<color_set|None>, format=<png|svg>)'。generate_*系と異なりDownload/Open in editorのリンク案内は含まれない"
|
|
198
|
+
"pattern": "^Map saved: .+ \\(dataKey=.+, drawingStyle=.*, colorSet=.*, format=(png|svg)\\)$",
|
|
199
|
+
"description": "'Map saved: <path> (dataKey=<dataKey>, drawingStyle=<drawing_style|None>, colorSet=<color_set|None>, format=<png|svg>)'。generate_*系と異なりDownload/Open in editorのリンク案内は含まれない"
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -210,9 +210,9 @@
|
|
|
210
210
|
"notes": [
|
|
211
211
|
"redownload_mapにはpendingパターンはない(既存dataKeyのデータを即座にダウンロードするだけで、生成ジョブのポーリングを行わない)。",
|
|
212
212
|
"successのテキストにはDownload/Open in editorのリンク案内自体が含まれない。元のgenerate_*呼び出し結果に含まれていたリンクをそのまま使い回す想定。",
|
|
213
|
-
"color_setを指定しない場合、text内は'colorSet=None'という文字列になる(Pythonのf-stringでNoneがそのまま埋め込まれるため)。"
|
|
213
|
+
"drawing_style・color_setを指定しない場合、text内は'drawingStyle=None'・'colorSet=None'という文字列になる(Pythonのf-stringでNoneがそのまま埋め込まれるため)。"
|
|
214
214
|
],
|
|
215
|
-
"example_success_text": "Map saved: C:\\Users\\you\\Downloads\\map_20260618aBcDeFgHiJ_20260618_120500.svg (dataKey=20260618aBcDeFgHiJ, colorSet=
|
|
215
|
+
"example_success_text": "Map saved: C:\\Users\\you\\Downloads\\map_20260618aBcDeFgHiJ_20260618_120500.svg (dataKey=20260618aBcDeFgHiJ, drawingStyle=None, colorSet=darkBlue, format=svg)",
|
|
216
216
|
"example_error_texts": [
|
|
217
217
|
"Error executing tool redownload_map: Download failed (404): <backend error text>"
|
|
218
218
|
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|