OpenGov Socrata MCP server

Enables access to public government datasets from Socrata-powered portals through a unified tool for searching, querying, and analyzing data like budgets, crime statistics, and transportation information without requiring an API key.
Back to servers
Setup instructions
Provider
Scott Robbin
Release date
May 06, 2025
Language
Go
Stats
9 stars

OpenGov MCP Server is a Model Context Protocol server that enables MCP clients like Claude Desktop to access Socrata Open Data APIs. This integration allows you to search for, retrieve, and analyze public datasets from government data portals, including cities, states, and federal agencies.

Installation Options

Quick Setup with npx (Recommended)

The easiest way to use this MCP server is with npx:

  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, such as:

    • https://data.cityofchicago.org
    • https://data.cityofnewyork.us
    • https://data.sfgov.org
    • https://data.lacity.org
  2. Restart Claude Desktop (if it was already running)

  3. 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:

  1. Clone the 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)

Using the MCP Server

Once installed, you can ask Claude Desktop questions that require accessing public data, such as:

How many cars were towed in Chicago this month?

You can follow up with more detailed questions:

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

Available Tool Capabilities

The MCP server provides the following data access capabilities:

  • 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

Query Parameters

The server accepts the following parameters:

  • type (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 (optional): Data portal hostname (without protocol)

  • query (optional): Search query for datasets

  • datasetId: Dataset identifier for specific operations

  • soqlQuery (optional): SoQL query for filtering data

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

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

Example Query Formats

Here are example query formats that Claude Desktop will use automatically:

// 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 (as shown above), in your environment variables, or via command line.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

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

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later