Docket
# Docket
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[](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
Scored across 3 tools
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.
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.
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.
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.