Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,4 @@ client/opencontext-client-*

# Config yaml
config.yaml
examples/
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ Add to Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_conf
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-stdio-to-http",
"--transport",
"streamable-http",
"mcp-remote",
"https://YOUR-API-GATEWAY-URL"
]
}
Expand Down
59 changes: 0 additions & 59 deletions config.yaml

This file was deleted.

1 change: 1 addition & 0 deletions config.yaml
64 changes: 63 additions & 1 deletion docs/BUILT_IN_PLUGINS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Built-in Plugins Reference

OpenContext includes a built-in plugin for CKAN-based open data portals.
OpenContext includes built-in plugins for CKAN and Socrata open data portals.

## CKAN Plugin

Expand Down Expand Up @@ -52,6 +52,68 @@ This plugin uses CKAN's Action API:

See [CKAN API documentation](https://docs.ckan.org/en/latest/api/) for details.

## Socrata Plugin

For Socrata-based open data portals (e.g., data.cityofchicago.org, data.cityofnewyork.us, data.seattle.gov).

**Note:** Socrata requires a free app token. Register at [https://dev.socrata.com/register](https://dev.socrata.com/register).

### Configuration

```yaml
plugins:
socrata:
enabled: true
base_url: "https://data.cityofboston.gov"
portal_url: "https://data.cityofboston.gov"
city_name: "Boston"
app_token: "${SOCRATA_APP_TOKEN}" # Required
timeout: 30.0 # HTTP timeout (default: 30)
```

### Tools

- `socrata__search_datasets(query, limit)` - Search for datasets in the portal catalog
- `socrata__get_dataset(dataset_id)` - Get full metadata for a dataset (4x4 ID)
- `socrata__get_schema(dataset_id)` - Get column schema for constructing SoQL queries
- `socrata__query_dataset(dataset_id, soql_query)` - Query data using SoQL
- `socrata__list_categories()` - List all categories with dataset counts

### Examples

**Search datasets:**
```
Search for datasets about housing in Boston
```

**Get dataset:**
```
Get details about dataset wc4w-4jew
```

**Get schema (call before query_dataset):**
```
Get schema for dataset wc4w-4jew
```

**Query data:**
```
Query dataset wc4w-4jew with: SELECT * WHERE year > 2020 LIMIT 50
```

**List categories:**
```
List all dataset categories on Boston's open data portal
```

### Socrata API

This plugin uses two Socrata API layers:
- **Discovery API** (api.us.socrata.com) - Catalog search, categories
- **SODA3** (portal domain) - Dataset metadata, schema, data queries

See [Socrata developer documentation](https://dev.socrata.com/) for details.

## Custom Plugins

If your portal doesn't use CKAN, you can create a custom plugin. See [Custom Plugins Guide](CUSTOM_PLUGINS.md) for instructions.
Expand Down
27 changes: 0 additions & 27 deletions examples/boston-opendata/config.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions examples/custom-plugin/config.yaml

This file was deleted.

134 changes: 0 additions & 134 deletions examples/custom-plugin/custom_plugins/example_plugin/plugin.py

This file was deleted.

1 change: 1 addition & 0 deletions plugins/socrata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Socrata plugin for OpenContext."""
Loading
Loading