Skip to content

wegovnyc/nyc-contracting-explorer

Repository files navigation

NYC Contracting Explorer

A comprehensive platform for exploring New York City's procurement data, including vendor information, contracts, solicitations, and spending analysis. Features an AI-powered chatbot and MCP (Model Context Protocol) server for use with Claude Desktop.

Features

  • 🔍 Contract Search - Search 55,000+ NYC contracts by agency, vendor, or keyword
  • 🏢 Vendor Directory - Browse 34,000+ registered vendors with certification data
  • 📋 Solicitation Tracker - Monitor open and closed procurement opportunities
  • 💰 Spending Analysis - Analyze 147M+ transactions from Checkbook NYC
  • 🤖 AI Chatbot - Natural language queries powered by Google Gemini
  • 🔌 MCP Server - Claude Desktop integration for AI-assisted analysis

Quick Start

Prerequisites

  • Python 3.10+
  • pip

Installation

# Clone the repository
git clone https://github.com/wegovnyc/nyc-contracting-explorer.git
cd nyc-contracting-explorer

# Install dependencies
pip install -r requirements.txt

# Run the web application
python app.py

Visit http://localhost:5000 to access the explorer.

Claude Desktop Integration

Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
    "mcpServers": {
        "nyc-contracts": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-remote",
                "https://oce.wegov.nyc/mcp/mcp"
            ]
        }
    }
}

Restart Claude Desktop, then ask questions like:

  • "How many contracts did Parks have in 2023?"
  • "Show me vendor certification statistics"
  • "What are the top IT vendors for the city?"

MCP Tools Available

Statistics & Aggregation

Tool Description
get_database_overview Complete summary of all procurement data
get_contract_stats Count contracts by agency and/or fiscal year
get_agency_contracts Agency summary with top vendors
get_vendor_stats Vendor breakdown by certification type
get_solicitation_stats Solicitation trends by status and method
get_yearly_trends Year-over-year procurement trends

Search Tools

Tool Description
search_vendors Find vendors by name
search_contracts Search contracts by agency, vendor, status
search_solicitations Find solicitations by status or agency

Spending Data

Tool Description
get_spending_by_year Checkbook NYC spending by fiscal year
get_vendor_spending Spending history for specific vendor

Public Data Access

The spending data is available in a public S3 bucket for direct analysis:

Bucket: s3://nyc-databook-spending

Access Methods

  1. AWS CLI (no credentials needed):

    aws s3 ls s3://nyc-databook-spending/ --no-sign-request
    aws s3 cp s3://nyc-databook-spending/fiscal_year=2024/chunk_0001.parquet . --no-sign-request
  2. Direct HTTPS:

    https://nyc-databook-spending.s3.amazonaws.com/fiscal_year=2024/chunk_0001.parquet
    
  3. DuckDB (for analysis):

    INSTALL httpfs; LOAD httpfs;
    SELECT * FROM 's3://nyc-databook-spending/fiscal_year=2024/*.parquet' LIMIT 10;

Data Structure

Path Contents
fiscal_year=YYYY/ Spending transactions (Parquet, chunked)
contracts/fiscal_year=YYYY/ Contract data (Parquet)

Data spans FY2010-FY2026 with 147M+ spending transactions.

Data Sources

  • PASSPort (MOCS) - Vendor registrations, contracts, solicitations
  • Checkbook NYC - City spending transactions
  • City Record Online - Public notices and procurement announcements

Project Structure

nyc-contracting-explorer/
├── app.py              # Flask web application
├── mcp_server.py       # MCP server for Claude Desktop
├── serve_sse.py        # Streamable HTTP server with OAuth
├── chatbot.py          # Gemini-powered AI chatbot
├── build_database.py   # Database construction scripts
├── daily_update.py     # Daily data refresh
├── templates/          # Jinja2 HTML templates
├── static/             # CSS, JS, images
└── requirements.txt    # Python dependencies

Deployment

See Deployment Guide for production setup with nginx and systemd.

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting PRs.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors