Skip to main content
Glama

jp-terrain-mcp

緯度・経度から、標高、地質、地震ハザードを調べるMCPサーバーです。MCP、CLI、Pythonライブラリから同じ機能を使えます。

準備 · MCP登録 · CLI · Python · 移行手順

準備

Python 3.12以上、uv、Gitが必要です。

git clone https://github.com/koizumikento/jp-terrain-mcp.git
cd jp-terrain-mcp
uv sync --locked

APIキーは不要です。

Related MCP server: geojp-mcp

MCPクライアントに登録する

設定例の /absolute/path/to/jp-terrain-mcp をクローン先の絶対パスに置き換えます。Windowsでは C:/projects/jp-terrain-mcp のように書けます。

Codex

codex mcp add jp-terrain-mcp -- uv --directory "/absolute/path/to/jp-terrain-mcp" run --locked jp-terrain-mcp
codex mcp list

新しいセッションで /mcp を開いて接続状態を確認します。

Claude Desktop / Cursor

Claude DesktopはOSに応じて次のファイルに設定します。

  • Windowsは %APPDATA%/Claude/claude_desktop_config.json

  • macOSは ~/Library/Application Support/Claude/claude_desktop_config.json

Cursorはプロジェクト内の .cursor/mcp.json を使います。mcpServers に次の項目を追加し、クライアントを再起動してください。

{
  "mcpServers": {
    "jp-terrain-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/jp-terrain-mcp",
        "run",
        "--locked",
        "jp-terrain-mcp"
      ]
    }
  }
}

uv が見つからない場合は、command に実行ファイルの絶対パスを指定してください。

ツール

データごとの入力条件、結果、出典と利用条件は、表のリンク先に記載しています。

ツール

データと操作の説明

get_elevation

国土地理院の標高

get_elevations

国土地理院の標高

get_geology

産総研の地質図

get_area_geology

産総研の地質図

get_earthquake_hazard

J-SHISの地震ハザード

get_hazard_intensity

J-SHISの地震ハザード

get_surface_ground_amplification

J-SHISの地震ハザード

CLIで使う

クローン先で実行します。取得結果はUTF-8のJSONとして標準出力に書き出します。

uv run jp-terrain-mcp elevation get-elevation --latitude 36.103543 --longitude 140.08531
uv run jp-terrain-mcp geology get-geology --latitude 39.7 --longitude 141.15
uv run jp-terrain-mcp hazard get-earthquake-hazard --latitude 35.6812 --longitude 139.7671

引数の説明は、各サブコマンドに --help を付けて確認できます。

Pythonで使う

自分のPythonプロジェクトの依存関係に追加します。

uv add "git+https://github.com/koizumikento/jp-terrain-mcp.git@main"

次のコードを example.py に保存し、uv run python example.py で実行します。

import asyncio

from jp_terrain_mcp import get_elevation

result = asyncio.run(get_elevation(latitude=36.103543, longitude=140.08531))
print(result)

ツールと同じ名前の非同期関数を利用できます。すでにイベントループがある場合は、直接 await してください。

出典と利用条件

コードはMITライセンスです。データは実行時に各提供元から取得します。取得データには、データ別の説明に記載した提供元の利用条件が適用されます。

開発

uv sync --locked
uv run ruff check .
uv run ty check
uv run pytest
uv build

Available Tools

7 tools
get_area_geologyB
Read-onlyIdempotent

List geological map legends in a WGS84 box up to 0.25° tall and wide.

Inputs: east (required), west (required), north (required), south (required), +2 more. Returns: object

get_earthquake_hazardB
Read-onlyIdempotent

Read the 30-year probability of meeting or exceeding a JMA intensity at a WGS84 point.

Inputs: latitude (required), longitude (required), minimum_jma_intensity. Returns: object

get_elevationB
Read-onlyIdempotent

Read the GSI elevation in metres and its measurement source at a WGS84 point.

Inputs: latitude (required), longitude (required). Returns: object

get_elevationsA
Read-onlyIdempotent

Compare GSI elevations for 1 to 10 supplied WGS84 points in input order.

Inputs: points (required). Returns: object

get_geologyA
Read-onlyIdempotent

Read the GSJ 1:200,000 geological map legend at a WGS84 point in Japan.

Inputs: latitude (required), longitude (required). Returns: object

get_hazard_intensityA
Read-onlyIdempotent

Read instrumental intensity at a specified exceedance probability at a WGS84 point.

Choose 3% or 6% for 30 years (default 3%), or 2%, 5%, 10% or 39% for 50 years (default 5%).

Inputs: latitude (required), longitude (required), period_years, exceedance_probability_percent. Returns: object

get_surface_ground_amplificationB
Read-onlyIdempotent

Read surface ground velocity amplification and geomorphology at a WGS84 point.

Inputs: latitude (required), longitude (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools are cleanly separated by resource (elevation, geology, seismic hazard, ground amplification) and by point-vs-area or single-vs-batch scope. The weakest boundary is get_earthquake_hazard vs get_hazard_intensity, which both return seismic hazard at a point and differ only in which quantity is the input versus the output; descriptions do disambiguate them, but they will still invite misselection.

    Naming Consistency4/5

    All names use a consistent snake_case get_ verb prefix, with singular/plural (get_elevation(s)) and area_ (get_area_geology) modifiers used predictably to signal scope. The one minor inconsistency is get_hazard_intensity, which drops the 'earthquake_' qualifier used by its sibling get_earthquake_hazard.

    Tool Count5/5

    Seven tools is a well-scoped set for a read-only terrain/geology/hazard lookup server, with each tool covering a distinct dataset or access pattern. No tools appear redundant or padded.

    Completeness4/5

    The surface covers point and batched/area queries across elevation, geology, seismic hazard and ground amplification, which is solid read-only lifecycle coverage for this domain. Minor gaps exist: no area/box variant for elevation, no batching for hazard or geology points, and no metadata/list tool describing available datasets or parameter vocabularies.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides Japanese station accessibility and hazard data via MCP tools, including toilet information, public toilet locations, and official hazard categories.
      1
      -
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Japanese address and parcel lookup using ReverseGeoJP and ChibanJP APIs, enabling AI agents to convert coordinates to addresses and vice versa.
      4
      47 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables access to Japan Meteorological Agency data through MCP, covering weather forecasts, warnings, earthquakes with seismic intensity, tsunami bulletins, and volcano alerts, with place-name lookup in kanji, kana, or romaji and no API key.
      7
      MIT