mcpField
O
OpenGov MCP Server

OpenGov MCP Server

Local
github.com/srobbinLegal & Government14Updated 81w ago

About OpenGov MCP Server

OpenGov MCP Server connects MCP clients to Socrata-powered public data portals. It lets users discover datasets, inspect their structure, query records, and view portal statistics.

Key features

  1. 01Search datasets by keyword, category, or tag
  2. 02View dataset metadata and columns
  3. 03Query and retrieve dataset records
  4. 04Read portal usage statistics

Use cases

  1. 01Find public datasets across government portals
  2. 02Inspect fields before analyzing a dataset
  3. 03Query government records with SoQL
  4. 04Check a portal’s usage statistics

MCP support

Exposes Socrata open-data search, metadata, query, and statistics operations through a unified `get_data` tool for MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"opengov": {
"command": "npx",
"args": [
"-y",
"opengov-mcp-server"
],
"env": {
"DATA_PORTAL_URL": "<DATA_PORTAL_URL>"
}
}
}
}
Run commandnpx -y opengov-mcp-server
Environment variables to set
DATA_PORTAL_URL

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmopengov-mcp-server

Tools

1

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
typeenumYesThe type of operation to perform: - catalog: List datasets with optional search - categories: List all dataset categories - tags: List all dataset tags - dataset-metadata: Get detailed metadata for a specific dataset - column-info: Get column details for a specific dataset - data-access: Access records from a dataset (with query support) - site-metrics: Get portal-wide statisticscatalog | categories | tags | dataset-metadata | column-info | data-access | site-metrics
domainstringNoOptional domain (hostname only, without protocol). Used with all operation types.
querystringNoSearch or query string with different uses depending on operation type: - For type=catalog: Search query to filter datasets - For type=data-access: SoQL query string for complex data filtering
datasetIdstringNoDataset identifier required for the following operations: - For type=dataset-metadata: Get dataset details - For type=column-info: Get column information - For type=data-access: Specify which dataset to query (e.g., 6zsd-86xi)
soqlQuerystringNoFor type=data-access only. Optional SoQL query string for filtering data. This is an alias for the query parameter and takes precedence if both are provided.
selectstringNoFor type=data-access only. Specifies which columns to return in the result set.
wherestringNoFor type=data-access only. Filters the rows to be returned (e.g., "magnitude > 3.0").
orderstringNoFor type=data-access only. Orders the results based on specified columns (e.g., "date DESC").
groupstringNoFor type=data-access only. Groups results for aggregate functions.
havingstringNoFor type=data-access only. Filters for grouped results, similar to where but for grouped data.
qstringNoFor type=data-access only. Full text search parameter for free-text searching across the dataset.
limitnumberNoMaximum number of results to return: - For type=catalog: Limits dataset results - For type=data-access: Limits data records returned
offsetnumberNoNumber of results to skip for pagination: - For type=catalog: Skips dataset results - For type=data-access: Skips data records for pagination

Details

From the project README

OpenGov MCP Server

An MCP (Model Context Protocol) server that enables MCP clients like Claude Desktop to access Socrata Open Data APIs. This integration allows Claude Desktop to search for, retrieve, and analyze public datasets from government data portals.

Overview

This MCP server provides access to open data from any Socrata-powered data portal, including those from cities, states, and federal agencies such as:

No API key is required for basic usage, as the server accesses public data.

Features

With this MCP server, clients can:

  • Search and discover datasets by keyword, category, or tags
  • View dataset metadata and column information
  • Run SQL-like queries to retrieve and analyze data
  • Get portal usage statistics

Installation for Claude Desktop

Quick Setup with npx (Recommended)

The easiest way to use this MCP server is with npx, which doesn't require any installation:

  1. Create or edit your Claude Desktop configuration:

    Create or edit claude_desktop_config.json in your home directory:

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

    You can replace the DATA_PORTAL_URL with any Socrata-powered data portal.

  2. Restart Claude Desktop (if it was already running)

  3. Start using the MCP server:

    In Claude Desktop, you can now ask questions like:

    How many cars were towed in Chicago this month?
    

    and you can follow up with questions that drill further into detail:

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

    The first time you run a query, npx will automatically download and run the latest version of the server.

Manual Installation from Source

If you prefer to run from source (for development or customization):

  1. Clone this repository:

    git clone https://github.com/srobbin/opengov-mcp-server.git
    cd opengov-mcp-server
    
  2. Install dependencies and build:

    npm install
    npm run build
    
  3. Create Claude Desktop configuration:

    Create or edit claude_desktop_config.json in your home directory:

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

    Replace /path/to/your/opengov-mcp-server with the actual path where you cloned the repository.

  4. Restart Claude Desktop (if it was already running)

Available Tool: get_data

This MCP server provides a unified get_data tool that Claude Desktop uses to access Socrata data.

Parameters
  • type (string, required): Operation type

    • catalog: Search and list datasets
    • categories: List dataset categories
    • tags: List dataset tags
    • dataset-metadata: Get dataset details
    • column-info: Get dataset column information
    • data-access: Query and retrieve records
    • site-metrics: Get portal statistics
  • domain (string, optional): Data portal hostname (without protocol)

  • query (string, optional): Search query for datasets

  • datasetId (string): Dataset identifier for specific operations

  • soqlQuery (string, optional): SoQL query for filtering data

  • limit (number, optional): Maximum results to return (default: 10)

  • offset (number, optional): Results to skip for pagination (default: 0)

Example Queries

These are examples of how Claude Desktop will format queries to the MCP server:

// 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
}

Configuration Options

The server requires one environment variable:

  • DATA_PORTAL_URL: The Socrata data portal URL (e.g., https://data.cityofchicago.org)

This can be set:

  • In the Claude Desktop configuration (recommended)
  • In your environment variables
  • Via command line: DATA_PORTAL_URL=https://data.cityofchicago.org opengov-mcp-server

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.