Skip to content

probsJustin/michigan_data_mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

michigan-data-mcp

An MCP server that exposes Michigan state government open data (from data.michigan.gov) to AI agents. It wraps the Socrata Open Data API (SODA) so a model can discover datasets, inspect their schema, and run SoQL queries without needing to know the underlying URLs.

Tools

Tool Purpose
search_datasets(query, limit, offset) Free-text search over the Michigan catalog. Returns dataset_id, name, description, tags, permalink.
list_categories() Enumerate the categories used to classify datasets (Health, Transportation, etc.).
get_dataset_info(dataset_id) Metadata for a dataset, including column field_names and data types — always call this before querying so you use correct field names.
query_dataset(dataset_id, select, where, group, order, q, limit, offset) Run a SoQL query. Parameters map 1:1 to Socrata $select/$where/$group/$order/$q.

A michigan://portal resource is also exposed with a pointer to the portal.

Typical agent workflow

  1. search_datasets("traffic crashes") → pick a dataset_id.
  2. get_dataset_info("<dataset_id>") → read the columns and note the field_names.
  3. query_dataset("<dataset_id>", select="county, count(*) AS n", group="county", order="n DESC", limit=10).

SoQL uses the snake_case field_name from step 2, not the display name. Wrap string literals in single quotes (where="county = 'Wayne'").

Install

pip install -e .
# or with dev deps
pip install -e '.[dev]'

Run

michigan-data-mcp

The server speaks MCP over stdio. Set SOCRATA_APP_TOKEN to raise rate limits (register a free token at https://data.michigan.gov/profile/edit/developer_settings).

Claude Desktop / Claude Code config

Add to your MCP client config (e.g. ~/.config/claude/claude_desktop_config.json or ~/.claude.json under mcpServers):

{
  "mcpServers": {
    "michigan-data": {
      "command": "michigan-data-mcp",
      "env": {
        "SOCRATA_APP_TOKEN": "your-optional-token"
      }
    }
  }
}

Development

pip install -e '.[dev]'
pytest

License

MIT

About

An MCP server that exposes Michigan state government open data (from data.michigan.gov) to AI agents. It wraps the Socrata Open Data API (SODA) so a model can discover datasets, inspect their schema, and run SoQL queries without needing to know the underlying URLs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages