convez.ai
MCP ServerIntegração & APIsIntermediário
npstorey

Civic AI Tools

npstorey/civic-ai-tools

Conecte IA a dados cívicos públicos via MCP com anti-alucinação

Ver no GitHub
BomPluginScore · de 0 a 100

Servidor MCP que conecta assistentes de IA a dados públicos governamentais, permitindo explorar datasets de 559 portais Socrata sem programação avançada. Oferece framework anti-alucinação e pacotes de evidência criptograficamente verificáveis para análises inspecionáveis e reproduzíveis.

Instalação

$npx convez-ai npstorey/civic-ai-tools

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
48
Forks
18
Acompanhando
1
Saúde
85%
Último commit
há 1 dia
Versão
—
Issues abertas
77
Contribuidores
3

Casos de uso

  • Explorar dados de reclamações 311, inspeções de restaurantes e violações habitacionais em NYC
  • Consultar demográficos e dados de população via Google Data Commons em linguagem natural
  • Gerar visualizações e dashboards dinâmicos a partir de datasets cívicos em tempo real

Veredito

Ferramenta robusta que democratiza acesso a dados públicos via IA, com foco em rastreabilidade e confiabilidade. Excelente para jornalistas, ativistas cívicos e pesquisadores que precisam interrogar dados governamentais sem expertise técnica profunda.

README

A tradução para o português deste README ainda está na fila.

Civic AI Tools

Open in GitHub Codespaces

Use AI to explore NYC Open Data and Google Data Commons — no advanced programming required.

Civic AI Tools connects AI assistants (GitHub Copilot, Cursor, Claude Code) to public datasets using the Model Context Protocol (MCP). Think of MCP as a universal adapter that lets AI talk directly to data sources — so you can ask questions in plain English and get answers from real civic data.

Built for civic technologists, government workers, journalists, and students exploring public data with AI.

Civic AI Tools sits at one layer of a broader landscape where open data meets AI: projects in this space address making data discoverable to AI, making AI mediation legible to humans, feeding signal back to data publishers, and orchestrating AI across civic-data domains. This project focuses on the second layer — evidence packages that make AI analyses inspectable, reproducible, and cryptographically verifiable. See docs/research/landscape-analysis.md for the wider landscape.

Integrating against the evidence registry? The reference implementation and its integration contract live in civic-ai-tools-website — start at docs/api/evidence-publish.md. This repo holds the protocol decisions (ADRs, the open-questions registry) and the Typed Standards Specification the contract cites.

What can you do with this?

  • Ask questions about NYC 311 complaints, restaurant inspections, or housing violations in plain English
  • Pull population, income, and demographic data from Google Data Commons
  • Generate visualizations and dashboards from live civic datasets
  • Compare statistics across cities and time periods

Example queries you can ask:

  • "What are the top 311 complaint types in NYC?"
  • "Show me restaurant inspection grades by borough"
  • "Compare NYC's population trend with Los Angeles and Chicago"

Quick start

Option 1: GitHub Codespaces (recommended — nothing to install)

  1. Click the "Open in GitHub Codespaces" button above
  2. Wait for the environment to build (everything is installed automatically)
  3. Open Copilot Chat (sidebar chat icon or Ctrl+Shift+I), switch to Agent mode, and start asking questions

Optional: For higher rate limits, add Codespaces Secrets before launching:

  • Go to your fork's Settings > Secrets and variables > Codespaces
  • Add SOCRATA_APP_TOKEN (get one free)
  • Add DC_API_KEY (get one free) — required for Data Commons

Without API keys, NYC Open Data queries still work (with lower rate limits). Data Commons is skipped if no key is set.

Option 2: Local setup

git clone https://github.com/npstorey/civic-ai-tools.git
cd civic-ai-tools
cp .env.example .env       # Add your API keys (see file for instructions)
./scripts/setup.sh         # Builds MCP servers and generates config files

Then open the project in your preferred tool:

  • VS Code + Copilot — Reload window (Ctrl+Shift+P > "Developer: Reload Window"), use Copilot Chat in Agent mode
  • Cursor — Open the folder in Cursor (restart if MCP servers don't appear)
  • Claude Code — Run claude in this directory and approve the MCP servers when prompted

See docs/setup.md for detailed instructions and troubleshooting.

What's included

MCP ServerData SourceWhat you can query
Socrata MCPNYC Open Data311 complaints, restaurant inspections, housing violations, traffic data, and 2,000+ other datasets
Data Commons MCPGoogle Data CommonsPopulation, income, demographics, and other statistical indicators across cities, states, and countries

Requirements (local setup only)

  • Node.js 18+
  • Python 3.11+
  • uv (recommended) — install with curl -LsSf https://astral.sh/uv/install.sh | sh

Example scripts

The examples/ directory contains standalone scripts you can run directly with uv:

uv run examples/real_data_analysis.py         # Fetch and analyze live NYC + Data Commons data
uv run examples/nyc_311_dashboard.py          # Launch a Streamlit dashboard of 311 data
uv run examples/create_html_visualizations.py # Generate an interactive HTML dashboard

See examples/README.md for the full list.

Related projects

RepositoryDescription
socrata-mcp-serverThe MCP server that connects AI tools to Socrata open data portals. This repo uses it as a dependency.
civic-ai-tools-websiteDemo website at civicaitools.org — side-by-side comparison of AI with and without live data access

Documentation

Getting started

Data and skills

Governance and discipline

Architecture

Research

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines — there are ways to help even if you don't write code.

Glossary

New to some of these terms? Here's a quick reference:

TermWhat it means
Repo (repository)A folder of code hosted on GitHub that tracks changes over time
CloneDownload a copy of a repo to your computer
MCPModel Context Protocol — a standard way for AI tools to connect to external data sources
APIApplication Programming Interface — a way for programs to request data from a service
API keyA password-like string that identifies you when making API requests
CodespaceA cloud development environment that runs in your browser — no local setup needed

License

Code in this repo is MIT (see LICENSE). The Typed Standards Specification text is CC BY 4.0 (declared in the document). Cross-repo license choices — including the fork attribution on socrata-mcp-server and the CC0 dedication on the project's directory data — are documented in LICENSING.md.

Disclaimer

This is a personal project and is not affiliated with, endorsed by, or representative of any employer or organization.

Ver o original no GitHub

Bom para

Relacionados