Skip to main content
Glama
README.md
# Docket

[![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![MCP](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/)

**Universal Public Record Interface** — An MCP Server that connects AI agents to public data.

---

## What is Docket?

Docket bridges AI agents and the global ecosystem of public records through the [Model Context Protocol](https://modelcontextprotocol.io/). It provides type-safe, validated access to datasets from thousands of government portals powered by the [Socrata Open Data API](https://dev.socrata.com/).

Think of it as "USB-C for public data access" — a universal connector between AI and government data.

---

## Quick Start

```bash
# Clone and install
git clone https://github.com/your-org/docket.git && cd docket
uv sync

# Run the server
uv run src/docket/server.py
```

For detailed setup, see the [Getting Started Tutorial](docs/tutorials/getting-started.md).

---

## Features

- šŸ” **Semantic Search** — Find datasets across 1000+ government portals
- šŸ“Š **Dynamic Schema Generation** — Auto-generate Pydantic models from any dataset
- āœ… **Runtime Validation** — Type-checked records with automatic error handling
- šŸ”Œ **MCP Compatible** — Works with Claude Desktop and any MCP-compliant host
- šŸš€ **Streaming Pagination** — Memory-efficient handling of large datasets
- šŸ” **Input Validation** — Secure by default with comprehensive input sanitization

---

## Documentation

šŸ“– **[Full Documentation](docs/index.md)**

| Section | Description |
|---|---|
| [Getting Started](docs/tutorials/getting-started.md) | First-time setup and hello world |
| [Claude Desktop](docs/how-to/claude-desktop.md) | Connect Docket to Claude |
| [Query Datasets](docs/how-to/query-datasets.md) | Search and fetch public records |
| [Tools Reference](docs/reference/tools.md) | Complete API specification |
| [Architecture](docs/explanation/architecture.md) | System design and MCP details |

---

## Available Tools

| Tool | Description |
|---|---|
| `search_public_records` | Search across Socrata catalogs for datasets |
| `fetch_dataset_schema` | Get JSON Schema for a dataset's structure |
| `query_dataset_records` | Retrieve validated records from a dataset |

---

## Configuration

Create a `.env` file from the template:

```bash
cp .env.example .env
```

Add your [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) for higher rate limits:

```ini
SOCRATA_APP_TOKEN=your_token_here
```

---

## Claude Desktop Integration

Add to your Claude Desktop config:

```json
{
  "mcpServers": {
    "docket": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/docket", "src/docket/server.py"],
      "env": {
        "SOCRATA_APP_TOKEN": "your_token_here"
      }
    }
  }
}
```

See [How to Connect to Claude Desktop](docs/how-to/claude-desktop.md) for details.

---

## Example Usage

Once connected to Claude Desktop:

> "Find parking violation datasets in New York City"

> "What columns are in the 311 complaints dataset (erm2-nwe9)?"

> "Get me 20 recent building permit records from Seattle"

---

## Requirements

- Python 3.13+
- [uv](https://github.com/astral-sh/uv) (recommended) or pip
- Socrata App Token (optional but recommended)

---

## Development

```bash
# Install dev dependencies
uv sync

# Run tests
uv run pytest

# Type check
uv run mypy src/

# Lint
uv run ruff check src/
```

---

## Contributing

Contributions are welcome! Please see our contributing guidelines (coming soon).

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Run tests and linting
5. Submit a pull request

---

## License

MIT License — see [LICENSE](LICENSE) for details.

---

## Acknowledgments

- [Model Context Protocol](https://modelcontextprotocol.io/) — The universal AI connector standard
- [Socrata Open Data API](https://dev.socrata.com/) — Public data infrastructure
- [Pydantic](https://docs.pydantic.dev/) — Data validation library
- [FastMCP](https://gofastmcp.com/) — MCP server framework

TDQS

B3.3/5.0

Scored across 3 tools

Disambiguation4/5

The three tools map to distinct stages of a workflow: find datasets, inspect schema, retrieve records. However, 'search_public_records' actually searches dataset metadata (not records), which could be confused with 'query_dataset_records' that does fetch records, creating a mild naming-driven ambiguity.

Naming Consistency4/5

All three follow a snake_case verb_noun pattern (search_, fetch_, query_), which is largely consistent. The verbs differ (search/fetch/query) in a way that is readable but slightly less uniform than an ideal set.

Tool Count4/5

Three tools is on the lean side but justified: discovery, schema inspection, and record retrieval form a complete minimal workflow with no redundant tools. It sits at the lower edge of the ideal range.

Completeness3/5

The core discover-schema-query lifecycle is covered, but query_dataset_records only supports a limit with no offset/pagination, filtering, or aggregation, which will block agents on anything beyond the first N records. Dataset-level metadata (row counts, last updated) is also absent.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues