Skip to main content
Glama

Yaizu Smart City MCP Server

by moma1992

焼津市スマートシティ MCP サーバー

焼津市のオープンデータを活用したModel Context Protocol (MCP) サーバー。Claude Desktop および Claude Code から焼津市スマートシティAPIへのアクセスを提供します。

特徴

提供ツール

  1. search_api_docs: API仕様検索機能 - 47種類のAPI仕様書から検索
  2. get_api_details: API詳細情報取得
  3. generate_api_command: APIコマンド自動生成
  4. execute_yaizu_api: 焼津市API実行
  5. get_yaizu_api_catalog: APIカタログ取得
  6. get_yaizu_city_data: 焼津市基本データ取得
  7. search_yaizu_facilities: 施設検索
  8. login_yaizu_api_portal: APIポータルログイン

提供リソース

  1. yaizu://info: 焼津市情報
  2. yaizu://status: MCPサーバー状態
  3. yaizu://catalog-summary: APIカタログサマリー
  4. yaizu://catalog-detailed: APIカタログ詳細

インストール

必要要件

  • Python 3.13.7 以上
  • uv 0.8.13 以上

セットアップ

# リポジトリのクローン git clone https://github.com/moma1992/smartcity-mcp.git cd smartcity-mcp # 依存関係のインストール uv sync # 環境変数の設定 cp .env.example .env # .envファイルを編集してAPIキーを設定

Claude Desktop 設定

  1. Claude Desktop の設定ファイルを開く:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. 以下の設定を追加:
{ "mcpServers": { "yaizu-smartcity": { "command": "/path/to/uv", "args": [ "--directory", "/path/to/smartcity-mcp", "run", "mcp/server.py" ] } } }
  1. パスを実際の環境に合わせて修正

使用方法

開発・デバッグ

# MCP Inspector で開発サーバー起動 uv run mcp dev mcp/server.py # 直接実行 uv run python mcp/server.py # 統合テスト実行 uv run python tests/test_mcp_integration.py

Claude Desktop での使用

Claude Desktop を起動後、以下のようなコマンドが使用可能:

焼津市のイベント情報を検索して
防災施設を検索して
観光スポットの一覧を取得して

プロジェクト構成

smartcity-mcp/ ├── mcp/ │ ├── server.py # MCPサーバー本体 │ └── scraper.py # APIカタログスクレイピング ├── scripts/ │ ├── pdf_to_json_generator.py # PDF→JSON変換 │ └── ... # その他のデータ処理スクリプト ├── tests/ │ └── test_mcp_integration.py # 統合テスト ├── data/ │ ├── api_specs/ # 47種類のAPI仕様書(JSON) │ ├── documentation/ # PDFドキュメント │ └── openapi/ # OpenAPI仕様書 ├── pyproject.toml # プロジェクト設定 ├── CLAUDE.md # Claude用開発ガイド └── README.md # このファイル

API 仕様

焼津市API

  • 基本URL: https://api.smartcity-yaizu.jp/v2/entities
  • 認証: APIキー(apikeyヘッダー)
  • 形式: FIWARE NGSIv2

対応エンティティ(一部)

  • 防災情報: Aed, EvacuationShelter, DisasterMail
  • 観光情報: Event, TouristAttraction, SightseeingMapStore
  • 環境情報: PrecipitationGauge, WaterLevelGauge
  • 公共施設: PublicFacility, HospitalAndClinic

技術スタック

  • フレームワーク: FastMCP (MCP Python SDK)
  • 非同期処理: asyncio
  • HTTPクライアント: aiohttp, httpx
  • PDF処理: PyMuPDF, PyPDF2
  • 環境管理: python-dotenv
  • パッケージ管理: uv

トラブルシューティング

エラー: "No API key found"

.envファイルにYAIZU_API_KEYを設定してください

エラー: "Server disconnected"

→ Claude Desktop設定のパスを確認してください

エラー: "Module not found"

uv syncで依存関係をインストールしてください

ライセンス

MIT License

貢献

Issues や Pull Request を歓迎します。

関連情報

サポート

問題が発生した場合は、Issuesで報告してください。

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables access to Yaizu City's open data and smart city APIs through Claude Desktop. Provides tools for searching facilities, retrieving city data, accessing disaster information, tourism data, and other municipal services.

  1. 特徴
    1. 提供ツール
    2. 提供リソース
  2. インストール
    1. 必要要件
    2. セットアップ
    3. Claude Desktop 設定
  3. 使用方法
    1. 開発・デバッグ
    2. Claude Desktop での使用
  4. プロジェクト構成
    1. API 仕様
      1. 焼津市API
      2. 対応エンティティ(一部)
    2. 技術スタック
      1. トラブルシューティング
        1. エラー: "No API key found"
        2. エラー: "Server disconnected"
        3. エラー: "Module not found"
      2. ライセンス
        1. 貢献
          1. 関連情報
            1. サポート

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/moma1992/smartcity-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server