Skip to main content

FBI Crime Data MCP Server

PyPI CI codecov

An MCP (Model Context Protocol) server that provides access to the FBI's Crime Data Explorer API.

Query crime statistics, arrest data, hate crimes, NIBRS incidents, law enforcement employment, and more — directly from any MCP-compatible client.

Created for data journalists, researchers, and anyone interested in exploring US crime data with the power of language models. Initially created for use by the Policy Analyst Agent of the qsv Claude Cowork plugin.

Features

  • 17 tools covering a wide range of crime data topics
    • Crime trends and Summary Reporting System (SRS) crime data
    • National Incident Based Reporting System (NIBRS) incident-based data and national estimates
    • Arrest statistics with demographic breakdowns
    • Hate crime incidents by bias motivation
    • Expanded homicide and property crime details
    • Police employment, Law Enforcement Officers Killed and Assaulted (LEOKA), Law Enforcement Suicide Data Collection (LESDC), and use of force
    • Agency lookup, reference data, cache management, and spillover reading
  • Geographic query levels — national, state, and agency for most tools; some also support region (get_police_employment, get_nibrs_estimation) or agency-type / population-size breakdowns (get_nibrs_estimation) — all with automatic parameter validation
  • Smart yearly aggregation — monthly API data is automatically rolled up into yearly totals (sums for counts, unweighted averages for rates, last value for population), with an option for monthly granularity. Years with fewer than 12 months of data are flagged in a _partial_years key so partial-year sums are never mistaken for annual totals
  • Tiered disk-backed caching — 90-day time-to-live (TTL) for stable data (trends, reference, summaries, NIBRS estimation), 30-day TTL for dynamic data (incidents, arrests, agency lookups), and 1-day TTL for the homepage summary (refresh dates change frequently). Transient errors (timeouts, HTTP 5xx, rate-limit responses) are never cached
  • Spillover handling — responses exceeding 128K characters are saved to disk with a preview returned, so large queries are never silently truncated
  • Input validation — date format/ordering checks, offense and bias code validation, and level-based parameter requirements with clear error messages
  • Sliding-window rate limiting — 1,000 requests/hour with transparent wait-time feedback
  • Reference tools for agency lookups (by state, Originating Agency Identifier (ORI), or district with name filtering) and code translations

Quick Start

  1. Get a free API key from api.data.gov

  2. Run with Claude Desktop — add to your claude_desktop_config.json:

{
  "mcpServers": {
    "fbi-crime-data": {
      "command": "uvx",
      "args": ["fbi-crime-data-mcp"],
      "env": {
        "FBI_API_KEY": "your-api-key-here"
      }
    }
  }
}
  1. Or run directly:
FBI_API_KEY=your-key uvx fbi-crime-data-mcp

Available Tools (17)

Core Crime Data

Tool Description
get_summarized_crime_data SRS crime data — rates, actuals, clearances for violent crime, property crime, homicide, rape, robbery, assault, burglary, larceny, motor vehicle theft, arson
get_nibrs_data NIBRS incident-based data for 70+ offense types
get_arrest_data Arrest statistics by offense with optional demographic breakdowns (male, female, sex, race)
get_crime_trends National crime trend percent changes across 10 crime types
get_nibrs_estimation NIBRS national estimates by state, region, agency type, or population size

Specialized Crime Data

Tool Description
get_hate_crime_data Hate crime incidents by bias motivation (30+ categories)
get_expanded_homicide_data Supplementary Homicide Reports — victim/offender demographics, weapons, circumstances
get_expanded_property_data Expanded property crime details — stolen/recovered values for burglary, larceny, motor vehicle theft (MVT), robbery

Law Enforcement Data

Tool Description
get_police_employment Officer and civilian employee counts by gender, rates per 1,000 population
get_leoka_data Officers killed and assaulted — weapons, circumstances, demographics
get_lesdc_data Law enforcement suicide data — demographics, race, duty status, and more
get_use_of_force_data Use of force incidents resulting in death, serious injury, or firearm discharge

Overview

Tool Description
get_cde_homepage_summary CDE homepage summary — mission statement, navigation, data freshness, date ranges, and national crime trends

Reference & Lookup

Tool Description
lookup_agency Find law enforcement agencies by state, ORI code, or judicial district
get_reference_data State lists, offense/bias code lookups, data refresh dates
manage_cache View cache stats, clear all entries, or clear only expired entries
read_spillover Read spillover files saved when tool responses exceed the size limit

Large Responses

When a tool response exceeds 128,000 characters, the full result is saved to ~/.cache/fbi-crime-data-mcp/spillover/ and a truncated preview is returned with the file path. To avoid this, narrow your query (shorter date range, specific state/agency).

The preview, not the full payload, is what gets cached, so the cache and the spillover directory belong together. Clear both with manage_cache action="clear" rather than deleting the spillover directory by hand; otherwise cached previews point at files that no longer exist until the cache entry expires.

Data Sources

All data comes from the FBI's Crime Data Explorer API, which provides Uniform Crime Reporting (UCR) data including both the Summary Reporting System (SRS) and the National Incident-Based Reporting System (NIBRS).

API Rate Limits

  • Registered key: 1,000 requests per hour (rolling window)
  • DEMO_KEY: 30 requests per IP per hour

The server includes a built-in rate limiter (1,000 req/hr). The DEMO_KEY limit is enforced API-side.

For more info on the FBI's Crime Data API, see https://cde.ucr.cjis.gov/LATEST/webapp/#/pages/docApi.

Development

# Install dependencies
uv sync

# Run the server locally
FBI_API_KEY=your-key uv run fbi-crime-data-mcp

# Run tests (offline by default — never hits the network)
uv run pytest

# Run integration tests against the live API.
# DEMO_KEY works, but is capped at 30 requests per IP per hour.
FBI_API_KEY=your-key uv run pytest -m integration

License

MIT

Metadata

Release files for fbi-crime-data-mcp 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fbi-crime-data-mcp 0.5.1
File Size Uploaded Provenance
fbi_crime_data_mcp-0.5.1.tar.gz 156.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fbi-crime-data-mcp 0.5.1
File Interpreter ABI Platform
fbi_crime_data_mcp-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 202.3 kB

Release files / fbi_crime_data_mcp-0.5.1.tar.gz

Download URL fbi_crime_data_mcp-0.5.1.tar.gz
Size 156.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f0bf3806a3fa2d210847a4490ba0f90fbaf8cbafbec22a1b3e824cd0b46411cd
BLAKE2b-256 checksum
How to use checksums
f7c905ffb028eda7e07eb5c9cb1785b8a2fd22ff7e62168df5517c7211491c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / fbi_crime_data_mcp-0.5.1-py3-none-any.whl

Download URL fbi_crime_data_mcp-0.5.1-py3-none-any.whl
Size 46.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c8b3e0490e90c8b67c1843f75f6400bb333ebaaa7b43403d332e2cb5718d3a2
BLAKE2b-256 checksum
How to use checksums
8107059eb23c3fa30384ddaef93e99a02ce8e104d33f7a28e48dceb674816623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Security for fbi-crime-data-mcp 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fbi_crime_data_mcp-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page