Skip to content

Commit 3ed0c20

Browse files
authored
Merge pull request #120 from mfukushim/dev_release
V0.1.0
2 parents 3ec9d22 + f55aca1 commit 3ed0c20

26 files changed

Lines changed: 3006 additions & 1305 deletions

Dockerfile

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
21
FROM node:lts-alpine AS build
2+
3+
# Set working directory
34
WORKDIR /app
45

56
# Install build dependencies
@@ -14,14 +15,23 @@ COPY package.json pnpm-lock.yaml ./
1415
# Install dependencies
1516
RUN pnpm install --frozen-lockfile
1617

17-
# Copy source and build
18+
# Copy package files
19+
#COPY package*.json ./
20+
21+
# Install all dependencies (need dev deps for TypeScript compilation)
22+
#RUN npm ci
23+
24+
# Copy source code
1825
COPY . .
26+
27+
# Build the TypeScript code
1928
RUN pnpm run build-esm
2029

30+
# Start the server directly with node
31+
#CMD ["node", "dist/index.js"]
2132
# Runtime image
2233
FROM node:lts-alpine AS runtime
2334
WORKDIR /app
24-
2535
# Copy application files
2636
COPY --chown=node:node --from=build /app/package.json ./package.json
2737
COPY --chown=node:node --from=build /app/build ./build
@@ -34,5 +44,47 @@ COPY --chown=node:node --from=build /app/node_modules ./node_modules
3444
# Drop privileges: run as non-root user provided by the base image
3545
USER node
3646

47+
# Set transport mode to HTTP
48+
ENV TRANSPORT=http
49+
3750
# Use stdio server entrypoint
38-
ENTRYPOINT ["node", "build/esm/mapTraveler.js"]
51+
CMD ["node", "build/esm/mapTraveler.js"]
52+
53+
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
54+
#FROM node:lts-alpine AS build
55+
#WORKDIR /app
56+
57+
## Install build dependencies
58+
#RUN apk add --no-cache git python3 make g++
59+
#
60+
## Install pnpm
61+
#RUN npm install -g pnpm
62+
#
63+
## Copy files for install
64+
#COPY package.json pnpm-lock.yaml ./
65+
#
66+
## Install dependencies
67+
#RUN pnpm install --frozen-lockfile
68+
#
69+
## Copy source and build
70+
#COPY . .
71+
#RUN pnpm run build-esm
72+
#
73+
## Runtime image
74+
##FROM node:lts-alpine AS runtime
75+
##WORKDIR /app
76+
#
77+
## Copy application files
78+
#COPY --chown=node:node --from=build /app/package.json ./package.json
79+
#COPY --chown=node:node --from=build /app/build ./build
80+
#COPY --chown=node:node --from=build /app/assets ./assets
81+
#COPY --chown=node:node --from=build /app/drizzle ./drizzle
82+
#
83+
## Copy installed node_modules
84+
#COPY --chown=node:node --from=build /app/node_modules ./node_modules
85+
#
86+
## Drop privileges: run as non-root user provided by the base image
87+
#USER node
88+
#
89+
## Use stdio server entrypoint
90+
#ENTRYPOINT ["node", "build/esm/mapTraveler.js"]

README.md

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ From an MCP client such as Claude Desktop, you can give instructions to the avat
1111

1212
<img alt="img_5.png" src="https://raw.githubusercontent.com/mfukushim/map-traveler-mcp/for_image/tools/img_5.png" width="400"/>
1313

14+
> Added gemini-2.5-flash-image-preview (nano-banana) to travel image generation
15+
16+
Support for nano-banana has been added. Nano-banana's semantic mask allows you to generate composite travel images in a short time without setting remBg.
17+
18+
> Supports both Streamable-HTTP and stdio (compliant with Smithery.ai's config interface)
19+
20+
It can be used as a stdio-type MCP as before, or as Streamable-HTTP.
21+
Although it supports multiple users, the database API must be specified per session using the Smithery.ai config interface.
22+
Since it supports both Streamable-HTTP and stdio, it is expected to work as is with the previous MCP client, but if you use the previous stdio version, please use v0.0.x (v0.0.81).
23+
``` npx -y @mfukushim/map-traveler-mcp@0.0.81 ```
24+
1425
> Now supports librechat https://www.librechat.ai/.
1526
1627
> Now supports Smithery https://smithery.ai/server/@mfukushim/map-traveler-mcp (images are excluded because they are heavy to run).
@@ -101,8 +112,9 @@ The SNS-compatible version controls SNS input and output while having a travel c
101112
You will need to obtain and set access keys for multiple APIs, such as for accessing multiple Google maps and generating images.
102113
Use of the API may incur charges.
103114

104-
#### Settings for using with Claude Desktop
105-
claude_desktop_config.json
115+
#### Settings for using with Claude Desktop
116+
117+
- claude_desktop_config.json (stdio type)
106118
```json
107119
{
108120
"mcpServers": {
@@ -111,6 +123,8 @@ claude_desktop_config.json
111123
"args": ["-y", "@mfukushim/map-traveler-mcp"],
112124
"env":{
113125
"MT_GOOGLE_MAP_KEY":"(Google Map API key)",
126+
"MT_GEMINI_IMAGE_KEY": "(Gemini Image Api key)",
127+
"MT_MAX_RETRY_GEMINI": "(Number of retries when generating Gemini images Default: 0)",
114128
"MT_MAP_API_URL": "(Optional: Map API custom endpoint. Example: direction=https://xxxx,places=https://yyyy )",
115129
"MT_TIME_SCALE": "(Optional:Scale of travel time on real roads duration. default 4)",
116130
"MT_SQLITE_PATH":"(db save path: e.g. %USERPROFILE%/Desktop/traveler.sqlite ,$HOME/traveler.sqlite )",
@@ -139,13 +153,60 @@ claude_desktop_config.json
139153
"MT_IMAGE_WIDTH": "(Option: Output image width (pixels) Default is 512)",
140154
"MT_NO_IMAGE": "(Options: true = do not output image, not specified = output image if possible, default is not specified)",
141155
"MT_NO_AVATAR": "(Option: true = Output StreetView image as is without avatar superimposition. Not specified = Superimpose avatar image. Default is not specified.)",
142-
"MT_FEED_TAG": "(Optional: Specify the feed tag when posting to SNS (#required, 15 characters or more) Default is #geo_less_traveler)"
156+
"MT_FEED_TAG": "(Optional: Specify the feed tag when posting to SNS (#required, 15 characters or more) Default is #geo_less_traveler)",
157+
"MT_MAX_SESSIONS": "(Maximum number of sessions when using Streamable-http)",
158+
"MT_SESSION_TTL_MS": "(Session TTL when using Streamable-http)",
159+
"MT_SERVICE_TTL_MS": "(Service TTL when using Streamable-http)"
143160
}
144161
}
145162
}
146163
}
164+
```
165+
166+
- claude_desktop_config.json (streamable-http type)
167+
The above MT_ environment variables should be set as environment variables for the server that runs the map-traveler-mcp web service.
168+
```json
169+
{
170+
"mcpServers": {
171+
"traveler": {
172+
"type": "streamable-http",
173+
"url": "https://(mcp server address)/mcp?config=(base64 config json)"
174+
}
175+
}
176+
}
177+
```
178+
179+
base64 config json (Smithery.ai Expansion)
180+
By concatenating the json in the following format into a single line of string, converting it to base64, and setting it as (base64 setting json), you can overwrite different APIs and settings for each user session.
181+
If the database is not set base64 config json, it will be shared across the entire service (the location of the traveler will be shared across the database and counted for one person).
182+
We plan to reconsider the operation of assigning an individual UserId for each session once the MCP authentication mechanism has become a little clearer.
183+
```json
184+
{
185+
"MT_GOOGLE_MAP_KEY": "xxxyyyzzz",
186+
"MT_GEMINI_IMAGE_KEY": "xxyyzz",
187+
"MT_MAX_RETRY_GEMINI": "1",
188+
"MT_TURSO_URL": "libsql://xxxyyyzzz",
189+
"MT_TURSO_TOKEN": "abcdabcd",
190+
"MT_BS_ID": "xyxyxyxyx",
191+
"MT_BS_PASS": "1234xyz",
192+
"MT_BS_HANDLE": "aabbccdd",
193+
"MT_FILTER_TOOLS": "tips,set_traveler_location",
194+
"MT_MOVE_MODE": "direct",
195+
"MT_FEED_TAG": "#abcdefgabcdefgabcdefg"
196+
}
197+
```
198+
(All json values can be omitted)
199+
↓ (json text concatenation)
200+
```text
201+
{"MT_GOOGLE_MAP_KEY": "xxxyyyzzz", "MT_GEMINI_IMAGE_KEY": "xxyyzz", "MT_MAX_RETRY_GEMINI": "1", "MT_TURSO_URL": "libsql://xxxyyyzzz", "MT_TURSO_TOKEN": "abcdabcd", "MT_BS_ID": "xyxyxyxyx", "MT_BS_PASS": "1234xyz", "MT_BS_HANDLE": "aabbccdd", "MT_FILTER_TOOLS": "tips,set_traveler_location", "MT_MOVE_MODE": "direct", "MT_FEED_TAG": "#abcdefgabcdefgabcdefg"}
202+
```
203+
↓ (Set the base64 version to config=)
204+
```text
205+
eyJNVF9HT09HTEVfTUFQX0tFWSI6ICJ4eHh5eXl6enoiLCAiTVRfR0VNSU5JX0lNQUdFX0tFWSI6ICJ4eHl5enoiLCAiTVRfTUFYX1JFVFJZX0dFTUlOSSI6ICIxIiwgIk1UX1RVUlNPX1VSTCI6ICJsaWJzcWw6Ly94eHh5eXl6enoiLCAiTVRfVFVSU09fVE9LRU4iOiAiYWJjZGFiY2QiLCAiTVRfQlNfSUQiOiAieHl4eXh5eHl4IiwgIk1UX0JTX1BBU1MiOiAiMTIzNHh5eiIsICJNVF9CU19IQU5ETEUiOiAiYWFiYmNjZGQiLCAiTVRfRklMVEVSX1RPT0xTIjogInRpcHMsc2V0X3RyYXZlbGVyX2xvY2F0aW9uIiwgIk1UX01PVkVfTU9ERSI6ICJkaXJlY3QiLCAiTVRfRkVFRF9UQUciOiAiI2FiY2RlZmdhYmNkZWZnYWJjZGVmZyJ9
147206
```
148-
> NOTE: The environment variables have been renamed to standard snake case. The MT_ prefix is ​​added because they may be used in conjunction with other environment variables, such as in librechat. The old names can still be used for backward compatibility.
207+
208+
209+
> NOTE: The environment variables have been renamed to standard snake case. The MT_ prefix is added because they may be used in conjunction with other environment variables, such as in librechat. The old names can still be used for backward compatibility.
149210
150211
Please set the following three Credentials for Google Map API.
151212
- Street View Static API
@@ -368,7 +429,7 @@ To use the MCP function in libreChat, use the Agents function.
368429
## Smithery
369430

370431
Please refer to https://smithery.ai/server/@mfukushim/map-traveler-mcp.
371-
Remote MCP (stdio mode) is supported, but the configuration feature has been removed because image generation was too heavy to run.
432+
Remote MCP (Streamable-http mode) is supported. Image generation is only available on nano-banana.
372433
Database settings can now be recorded with Turso sqlite, so if you configure Turso, your travel progress will also be saved.
373434
<img alt="smithery.png" src="tools/smithery.png" width="400"/>
374435

@@ -447,5 +508,8 @@ or
447508
https://modelcontextprotocol.io/specification/2025-06-18/server/tools
448509
- Fixed an issue where some functions, such as SNS functions, could not be called regardless of the env settings due to an initialization error.
449510

511+
- Added support for Streamable-http. This was done in a hurry, so if you experience any issues, please consider using version 0.0.81 or similar.
512+
513+
- Support for nano-banana (gemini-2.5-flash-image-preview) image generation has been added. When using nano-banana, no rembg settings are required. The characteristics of the avatar prompt have changed, so image generation may fail with the previous avatar prompt. In this case, you will need to adjust the avatar appearance prompt to one that is acceptable for nano-banana.
450514

451515
[![MseeP.ai Security Assessment Badge](https://mseep.net/pr/mfukushim-map-traveler-mcp-badge.png)](https://mseep.ai/app/mfukushim-map-traveler-mcp)

README_jp.md

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ Claude DesktopなどのMCP clientから、アバターに指示をして、移
1212

1313
<img alt="img.png" src="https://raw.githubusercontent.com/mfukushim/map-traveler-mcp/for_image/tools/img.png" width="400"/>
1414

15+
> 旅画像生成にgemini-2.5-flash-image-preview (nano-banana) を追加しました
16+
17+
nano-bananaに対応しました。nano-bananaのセマンティック マスクによりremBgの設定なしに短時間で旅の合成画像が生成できるようになりました。
18+
19+
> Streamable-HTTP/stdio 両対応しました(Smithery.ai仕様のconfigインタフェースに準拠)
20+
21+
今まで通りstdio型MCPとしても使えますし、Streamable-HTTP としても使えます。
22+
マルチユーザ対応ですが、dbのAPIはSmithery.ai仕様のconfigインタフェースにてセッション毎指定になります。
23+
Streamable-HTTP/stdio 両対応なので従来のMCPクライアントでもそのままで動く想定ですが、
24+
従来のstdio版を使用する場合は v0.0.x (v0.0.81) をお使いください。
25+
``` npx -y @mfukushim/map-traveler-mcp@0.0.81 ```
26+
1527
> librechat https://www.librechat.ai/ に対応しました。
1628
1729
> Smithery https://smithery.ai/server/@mfukushim/map-traveler-mcp に対応しました(画像は重いため除外しています)。
@@ -94,7 +106,7 @@ APIの使用には課金がかかることがあります。
94106

95107
#### Claude Desktopで使用する場合の設定
96108

97-
claude_desktop_config.json
109+
claude_desktop_config.json (stdio型)
98110
```json
99111
{
100112
"mcpServers": {
@@ -103,6 +115,8 @@ claude_desktop_config.json
103115
"args": ["-y", "@mfukushim/map-traveler-mcp"],
104116
"env": {
105117
"MT_GOOGLE_MAP_KEY":"(Google Map APIのキー)",
118+
"MT_GEMINI_IMAGE_KEY": "(GeminiImageApi_keyのキー)",
119+
"MT_MAX_RETRY_GEMINI": "(Gemini画像生成時のリトライ回数 デフォルト0回)",
106120
"MT_MAP_API_URL": "(オプション: Map APIカスタムエンドポイント 例 direction=https://xxxx,search=https://yyyy )",
107121
"MT_TIME_SCALE": "(オプション:道路での移動時間の尺度. default 4)",
108122
"MT_SQLITE_PATH":"(db保存ファイルのパス 例 %USERPROFILE%/Desktop/traveler.sqlite など)",
@@ -131,12 +145,56 @@ claude_desktop_config.json
131145
"MT_IMAGE_WIDTH": "(オプション: 出力する画像の幅(pixel) デフォルトでは512)",
132146
"MT_NO_IMAGE": "(オプション: true=画像を出力しない 未指定=画像出力可能なら画像を出力する デフォルトでは未指定)",
133147
"MT_NO_AVATAR": "(オプション: true=アバター合成をせずStreetView画像そのままを出力する 未指定=アバター画像を合成する デフォルトでは未指定)",
134-
"MT_FEED_TAG": "(オプション: SNSポスト時のフィードタグを指定する(#必須15文字以上) デフォルトでは#geo_less_traveler)"
148+
"MT_FEED_TAG": "(オプション: SNSポスト時のフィードタグを指定する(#必須15文字以上) デフォルトでは#geo_less_traveler)",
149+
"MT_MAX_SESSIONS": "(Streamable-http時の最大セッション数)",
150+
"MT_SESSION_TTL_MS": "(Streamable-http時のセッション維持時間)",
151+
"MT_SERVICE_TTL_MS": "(Streamable-http時のサービス維持時間)"
135152
}
136153
}
137154
}
138155
}
139156
```
157+
claude_desktop_config.json (streamable-http型)
158+
上記のMT_環境変数はmap-traveler-mcpのwebサービスを行うサーバーの環境変数に設定してください。
159+
```json
160+
{
161+
"mcpServers": {
162+
"traveler": {
163+
"type": "streamable-http",
164+
"url": "https://(mcpサーバー)/mcp?config=(base64設定json)"
165+
}
166+
}
167+
}
168+
```
169+
base64設定json (Smithery独自拡張)
170+
以下の形式のjsonを1行の文字列に連結してbase64変換したものを(base64設定json)に設定することで、ユーザのセッション毎に別のAPIや設定を上書きできます。
171+
dbは個別設定しないとサービス全体で共有されます(旅人のいる場所はdbで共有され1人分になる)
172+
セッション毎に個別UserIdを持たせる運用については、MCPの認証の仕組みがもう少しクリアになってから再検討する予定です。
173+
```json
174+
{
175+
"MT_GOOGLE_MAP_KEY": "xxxyyyzzz",
176+
"MT_GEMINI_IMAGE_KEY": "xxyyzz",
177+
"MT_MAX_RETRY_GEMINI": "1",
178+
"MT_TURSO_URL": "libsql://xxxyyyzzz",
179+
"MT_TURSO_TOKEN": "abcdabcd",
180+
"MT_BS_ID": "xyxyxyxyx",
181+
"MT_BS_PASS": "1234xyz",
182+
"MT_BS_HANDLE": "aabbccdd",
183+
"MT_FILTER_TOOLS": "tips,set_traveler_location",
184+
"MT_MOVE_MODE": "direct",
185+
"MT_FEED_TAG": "#abcdefgabcdefgabcdefg"
186+
}
187+
```
188+
(jsonの個々の値はすべて省略可能)
189+
↓ (jsonをテキスト連結)
190+
```text
191+
{"MT_GOOGLE_MAP_KEY": "xxxyyyzzz", "MT_GEMINI_IMAGE_KEY": "xxyyzz", "MT_MAX_RETRY_GEMINI": "1", "MT_TURSO_URL": "libsql://xxxyyyzzz", "MT_TURSO_TOKEN": "abcdabcd", "MT_BS_ID": "xyxyxyxyx", "MT_BS_PASS": "1234xyz", "MT_BS_HANDLE": "aabbccdd", "MT_FILTER_TOOLS": "tips,set_traveler_location", "MT_MOVE_MODE": "direct", "MT_FEED_TAG": "#abcdefgabcdefgabcdefg"}
192+
```
193+
↓ (base64化したものをconfig=に設定する)
194+
```text
195+
eyJNVF9HT09HTEVfTUFQX0tFWSI6ICJ4eHh5eXl6enoiLCAiTVRfR0VNSU5JX0lNQUdFX0tFWSI6ICJ4eHl5enoiLCAiTVRfTUFYX1JFVFJZX0dFTUlOSSI6ICIxIiwgIk1UX1RVUlNPX1VSTCI6ICJsaWJzcWw6Ly94eHh5eXl6enoiLCAiTVRfVFVSU09fVE9LRU4iOiAiYWJjZGFiY2QiLCAiTVRfQlNfSUQiOiAieHl4eXh5eHl4IiwgIk1UX0JTX1BBU1MiOiAiMTIzNHh5eiIsICJNVF9CU19IQU5ETEUiOiAiYWFiYmNjZGQiLCAiTVRfRklMVEVSX1RPT0xTIjogInRpcHMsc2V0X3RyYXZlbGVyX2xvY2F0aW9uIiwgIk1UX01PVkVfTU9ERSI6ICJkaXJlY3QiLCAiTVRfRkVFRF9UQUciOiAiI2FiY2RlZmdhYmNkZWZnYWJjZGVmZyJ9
196+
```
197+
140198
> 注意:環境変数の名称を一般的なスネークケースに変更しました。librechatなどで他の環境変数と合わせて使う場合があるため、接頭語としてMT_を付けています。従来の名称も後方互換性のために使うことができます。
141199
142200
Google Map APIは以下の4つの権限を設定してください。
@@ -353,7 +411,7 @@ libreChatにはMCPのリソース機能がないため、代わりに
353411
## Smitheryでの実行
354412

355413
https://smithery.ai/server/@mfukushim/map-traveler-mcp を参照ください。
356-
remote MCP(stdioモード)に対応しています。ただし画像生成は重すぎるようなので設定機能を外しています
414+
remote MCP(Streamable-http)に対応しています。画像生成はnano-bananaのみ使えます
357415
db設定をTurso sqliteで記録出来るようにしたので、Tursoの設定を行えば旅の過程も保持されます。
358416
<img alt="smithery.png" src="tools/smithery.png" width="400"/>
359417

@@ -430,6 +488,10 @@ MCPの呼び出しを直接Effectで処理するほうがシンプルになる
430488
スキーマにtitleを入れました。outputSchemaとstructured responseは将来取り入れる予定ですが今回は取り込んでいません。旅botの出力はテキストとしては単純なため構造化はまだ必要ないと考えています。
431489
https://modelcontextprotocol.io/specification/2025-06-18/server/tools
432490

433-
- 初期化の誤りによりenvの設定にかかわらずSNS関数などが呼び出せないの問題を修正しました。
491+
- 初期化の誤りによりenvの設定にかかわらずSNS関数などが呼び出せないの問題を修正しました。
492+
493+
- Streamable-httpに対応しました。急いでやったので不具合がある場合は 0.0.81 などを使用することを検討ください。
494+
495+
- nano-banana(gemini-2.5-flash-image-preview)の画像生成に対応しました。nano-bananaを使う際はrembgに関する設定は不要です。アバターのプロンプトの特性が変わったので、従来のアバタープロンプトでは画像生成がエラーになる場合があります。その際はnano-bananaで許容されるようなアバターの姿のプロンプトに調整する必要があります。
434496

435497
[![MseeP.ai Security Assessment Badge](https://mseep.net/pr/mfukushim-map-traveler-mcp-badge.png)](https://mseep.ai/app/mfukushim-map-traveler-mcp)

globalSetup.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)