Skip to main content
Glama
opengov-mcp-server

opengov-mcp-server

by srobbin

OpenGov MCP サーバー

Claude DesktopなどのMCPクライアントがSocrata Open Data APIにアクセスできるようにするMCP(Model Context Protocol)サーバー。この統合により、Claude Desktopは政府のデータポータルから公開データセットを検索、取得、分析できるようになります。

概要

この MCP サーバーは、次のような都市、州、連邦政府機関のデータを含む、Socrata を利用したあらゆるデータ ポータルからのオープン データへのアクセスを提供します。

サーバーは公開データにアクセスするため、基本的な使用には API キーは必要ありません。

Related MCP server: json-mcp-server

特徴

この MCP サーバーを使用すると、クライアントは次のことが可能になります。

  • キーワード、カテゴリ、タグでデータセットを検索して発見する

  • データセットのメタデータと列情報を表示する

  • SQLのようなクエリを実行してデータを取得および分析する

  • ポータルの使用統計を取得する

Claude Desktopのインストール

npx を使用したクイックセットアップ (推奨)

この MCP サーバーを使用する最も簡単な方法は、インストールを必要としない npx を使用することです。

  1. Claude Desktop 構成を作成または編集します。

    ホームディレクトリにclaude_desktop_config.jsonを作成または編集します。

    {
      "mcpServers": { 
        "opengov": {
          "command": "npx",
          "args": ["-y", "opengov-mcp-server@latest"],
          "env": {
            "DATA_PORTAL_URL": "https://data.cityofchicago.org"
          }
        }
      }
    }

    DATA_PORTAL_URL を、Socrata を利用した任意のデータ ポータルに置き換えることができます。

  2. Claude Desktopを再起動します(すでに実行されている場合)

  3. MCP サーバーの使用を開始します:

    Claude Desktop では、次のような質問をすることができるようになりました。

    How many cars were towed in Chicago this month?

    さらに詳細を掘り下げる質問を続けて行うことができます。

    Which make and color were towed the most?
    Also, were there any interesting vanity plates?

    初めてクエリを実行すると、npx はサーバーの最新バージョンを自動的にダウンロードして実行します。

ソースからの手動インストール

ソースから実行したい場合(開発またはカスタマイズ用):

  1. このリポジトリをクローンします:

    git clone https://github.com/srobbin/opengov-mcp-server.git
    cd opengov-mcp-server
  2. 依存関係をインストールしてビルドします:

    npm install
    npm run build
  3. Claude デスクトップ構成を作成します:

    ホームディレクトリにclaude_desktop_config.jsonを作成または編集します。

    {
      "mcpServers": { 
        "opengov": {
          "command": "node",
          "args": [
            "/path/to/your/opengov-mcp-server/dist/index.js"
          ],
          "env": {
            "DATA_PORTAL_URL": "https://data.cityofchicago.org"
          }
        }
      }
    }

    /path/to/your/opengov-mcp-serverリポジトリのクローンを作成した実際のパスに置き換えます。

  4. Claude Desktopを再起動します(すでに実行されている場合)

利用可能なツール: get_data

この MCP サーバーは、Claude Desktop が Socrata データにアクセスするために使用する統合get_dataツールを提供します。

パラメータ

  • type (文字列、必須): 操作の種類

    • catalog :データセットの検索と一覧表示

    • categories :データセットのカテゴリを一覧表示する

    • tags : データセットのタグを一覧表示する

    • dataset-metadata :データセットの詳細を取得する

    • column-info : データセットの列情報を取得する

    • data-access : レコードのクエリと取得

    • site-metrics : ポータルの統計情報を取得する

  • domain (文字列、オプション): データポータルのホスト名(プロトコルなし)

  • query (文字列、オプション): データセットの検索クエリ

  • datasetId (文字列): 特定の操作のデータセット識別子

  • soqlQuery (文字列、オプション): データをフィルタリングするための SoQL クエリ

  • limit (数値、オプション): 返される結果の最大数 (デフォルト: 10)

  • offset (数値、オプション):ページ区切りでスキップする結果(デフォルト:0)

クエリの例

これらは、Claude Desktop が MCP サーバーへのクエリをフォーマットする方法の例です。

// Find datasets about budgets
{
  "type": "catalog",
  "query": "budget",
  "limit": 5
}

// Get information about a dataset
{
  "type": "dataset-metadata",
  "datasetId": "6zsd-86xi"
}

// Query dataset records with SQL-like syntax
{
  "type": "data-access",
  "datasetId": "6zsd-86xi",
  "soqlQuery": "SELECT * WHERE amount > 1000 ORDER BY date DESC",
  "limit": 10
}

設定オプション

サーバーには 1 つの環境変数が必要です。

  • DATA_PORTAL_URL : Socrata データポータルの URL (例: https://data.cityofchicago.org )

設定できる内容:

  • Claude Desktop構成(推奨)

  • 環境変数で

  • コマンドライン経由: DATA_PORTAL_URL=https://data.cityofchicago.org opengov-mcp-server

Available Tools

1 tool
get_dataC

[City of Chicago | Data Portal] Access data and metadata to learn more about the city and its underlying information.

Inputs: type (required), domain, query, datasetId, +9 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion between tools, so disambiguation is perfect.

    Naming Consistency5/5

    The single tool name 'get_data' follows a clear verb_noun pattern, and consistency is trivially maintained.

    Tool Count1/5

    Only one tool is far below the typical 3-15 range for a well-scoped server, and the broad purpose of accessing open government data likely requires multiple tools.

    Completeness1/5

    The single generic 'get_data' tool cannot cover the expected operations for a government data portal, such as searching datasets, filtering, or accessing specific data types.

    Related MCP Connectors

    Related MCP Servers