Skip to main content
Glama
alexandre-do

vancouver-city-opendata-mcp

by alexandre-do

Vancouver City Open Data MCP

An MCP server that exposes the City of Vancouver Open Data Portal (Opendatasoft Explore API v2.1) as tools an LLM can call directly: search datasets, inspect their schema, query/filter records, discover facet values, and export bounded slices of data.

Features

  • search_datasets — full-text and ODSQL search across the ~200 datasets in the catalog.

  • get_dataset — metadata and field schema for a single dataset.

  • query_records — filter/sort/paginate a dataset's records with ODSQL (where, select, order_by, group_by, q, refine).

  • get_facets — discover valid filter values (and counts) before writing a where/refine clause.

  • export_dataset — bulk export in csv/json/geojson/parquet, capped at a configurable row limit.

  • Runs over stdio (for Claude Desktop/Claude Code) or Streamable HTTP (for remote deployment) from the same codebase.

  • No API key required for public read access; an optional key raises Opendatasoft's rate limits.

Related MCP server: MCP Data Vermont

Install

npm install
npm run build

Usage — stdio (Claude Desktop / Claude Code)

stdio is the default transport — running the built binary with no flags starts it directly.

Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "vancouver-opendata": {
      "command": "node",
      "args": ["/absolute/path/to/vancouver-city-opendata-mcp/dist/index.js"]
    }
  }
}

Or explore it interactively with the MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Usage — HTTP

MCP_TRANSPORT=http PORT=3000 node dist/index.js
# or: node dist/index.js --http

This exposes a single /mcp endpoint implementing the Streamable HTTP transport (session lifecycle via the mcp-session-id header — POST to initialize/call tools, GET for the SSE stream, DELETE to close a session).

curl -s -X POST http://127.0.0.1:3000/mcp \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'

Note: there is no inbound authentication in v1. If deploying the HTTP transport somewhere reachable beyond localhost, put it behind your own auth/reverse proxy, and set ALLOWED_HOSTS for DNS-rebinding protection.

Environment variables

Variable

Default

Description

ODS_BASE_URL

https://opendata.vancouver.ca/api/explore/v2.1

Base URL of the Opendatasoft Explore API v2.1 to query.

ODS_API_KEY

(none)

Optional Opendatasoft API key, sent as Authorization: Apikey <key>. Not required for public data.

MCP_TRANSPORT

stdio

stdio or http (overridden by the --stdio/--http CLI flags).

HOST

127.0.0.1

Host to bind the HTTP transport to.

PORT

3000

Port used when MCP_TRANSPORT=http.

ALLOWED_HOSTS

(none)

Comma-separated hostnames allowed to reach the HTTP transport.

EXPORT_ROW_CAP

5000

Hard cap on rows export_dataset will return, regardless of the caller's requested limit.

Rate limits

Opendatasoft enforces a public per-IP quota (observed at 15,000 requests/day, plus per-dataset limits) surfaced via X-RateLimit-* response headers. export_dataset and friends will return a clear isError message if you're throttled. Set ODS_API_KEY to raise your limits.

Development

npm run test          # unit tests (no network access required)
RUN_LIVE_TESTS=1 npm test   # also runs the opt-in suite against the real API
npm run dev            # tsc --watch

License

MIT

Available Tools

5 tools
export_datasetA

Export rows from a dataset in csv, json, geojson, or parquet format. Returns the data inline as text (parquet is base64-encoded binary, since this is not a file-download channel) and is hard-capped at 5000 rows regardless of the requested limit. For larger datasets, narrow the export with where/select, or use query_records with offset-based pagination instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of rows to export, capped at 5000
whereNoODSQL boolean expression to filter exported rows
formatNocsv
selectNoComma-separated field list to include in the export
orderByNoODSQL order_by expression
datasetIdYesThe dataset_id, e.g. "greenest-city-projects"

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full behavioral burden. It does so well: it discloses that the data is returned inline as text, that parquet is base64-encoded because this is not a file-download channel, and that there is a hard cap of 5000 rows regardless of the requested limit. These are non-obvious runtime characteristics an agent needs to know before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences deliver the purpose, the unusual output behavior, and the fallback path – all in a front-loaded, focused structure. Every sentence earns its place and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description still covers the return format, encoding nuance, row cap, and a pagination alternative. The schema covers parameter specifics, so the description is complete enough for an agent to invoke the tool correctly and set expectations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is high at 83%, and each parameter already has a meaningful schema-level description. The tool description does not materially extend parameter semantics beyond what the schema already documents, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('export rows') applied to a concrete resource ('a dataset') and explicitly enumerates the supported serialization formats (csv, json, geojson, parquet). It also distinguishes this from sibling tools by naming query_records as the alternative for larger datasets, so an agent can select it without opening every schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear when-to-use and when-not-to-use guidance: use this for exporting, and for larger datasets either narrow with where/select or switch to query_records with offset-based pagination. This directly addresses the main selection ambiguity among the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_datasetA

Get full metadata for a single dataset by its dataset_id, including its field schema (name, type, label, description) needed to write select/where/order_by expressions for query_records.

ParametersJSON Schema
NameRequiredDescriptionDefault
datasetIdYesThe dataset_id, e.g. "greenest-city-projects"

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavior. It states it returns metadata and field schema, implying a read operation, but does not explicitly declare read-only status, error handling, or any side effects. For a simple fetch tool this is acceptable but not exemplary; more transparency about what happens on invalid IDs would improve it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that leads with the primary purpose and immediately follows with the key output details. No filler or redundant phrasing; every clause adds value, making it highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no output schema, the description explains the returned content (full metadata, field schema) and why it's needed (query expression writing). It lacks explicit return structure details, but 'full metadata' covers the breadth. Given the tool's simplicity, this is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides a complete description of datasetId with an example, so schema coverage is 100%. The tool description does not add additional parameter semantics beyond that, but it does reinforce the purpose by linking the parameter to the returned schema. Baseline 3 is appropriate since the schema already handles the meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get', the resource 'full metadata for a single dataset', and the identifier 'dataset_id'. It explicitly names the output (field schema with name, type, label, description) and its purpose for writing query expressions, which distinguishes it from siblings like search_datasets or query_records without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly ties usage to preparing for query_records by mentioning the need for field schema in select/where/order_by expressions. This gives clear context for when to use it, though it doesn't explicitly state when not to use it (e.g., for searching datasets, which would be search_datasets). The guidance is implicit but strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_facetsA

Get facet values and their record counts for a dataset's filterable fields. Call this before query_records to discover valid values for where/refine filters instead of guessing.

ParametersJSON Schema
NameRequiredDescriptionDefault
whereNoODSQL boolean expression to narrow facet counts
refineNoRepeatable facet filters, each formatted as "field:value"
datasetIdYesThe dataset_id, e.g. "greenest-city-projects"

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are absent, so the description carries the behavioral burden. The verb 'get' implies a read-only operation and the description states it returns counts, but it does not disclose pagination, privacy scoping, or any side effects. It gives useful contextual positioning but stops short of a full behavioral profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no fluff. The functional purpose is front-loaded, followed by a succinct, non-repetitive usage directive. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity—three parameters, one required, no nested objects, and no output schema—the description is largely sufficient. It conveys the tool's purpose, return content, and the immediate usage context, leaving only peripheral details like error behavior or pagination unexplained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description mentions 'where' and 'refine' filters only to explain the return value's purpose; it does not add new semantics or formats for those parameters beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb-resource pair ('Get facet values and their record counts') and confines the scope to a dataset's filterable fields. It also distinguishes the tool from query_records by saying it should be called first, which disambiguates it from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly instructs when to call the tool ('Call this before query_records') and why, to discover valid filter values 'instead of guessing.' This is a clear, actionable usage directive that names the correlated sibling and the problem avoids.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_recordsA

Query and filter records within a dataset using ODSQL (where/select/order_by/group_by/q/refine), with pagination via limit/offset. For geographic datasets, results may include a geom GeoJSON field. Call get_dataset first if you don't know the field names.

ParametersJSON Schema
NameRequiredDescriptionDefault
qNoFull text search within the dataset's records
limitNo
whereNoODSQL boolean expression, e.g. "category1='City projects'"
offsetNo
refineNoRepeatable facet filters, each formatted as "field:value". Use get_facets to discover valid values.
selectNoComma-separated field list or ODSQL expressions to return
groupByNoODSQL group_by expression, used with aggregation in select
orderByNoODSQL order_by expression, e.g. "name asc"
datasetIdYesThe dataset_id, e.g. "greenest-city-projects"

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It usefully reveals pagination behavior and the optional geom field for geographic datasets, but it does not mention response shape, error or rate-limit behavior, or the read-only nature beyond the word 'Query'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with no filler: the core capability is stated first, followed by a useful output caveat and a practical prerequisite. The structure is front-loaded and each sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a 9-parameter query tool with no annotations and no output schema, this description does solid work: it explains the query language, pagination, a special output field, and a preparation step. The main gap is not addressing when to choose export_dataset to pull a full dataset instead.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 78%, so the schema already explains most parameters. The description adds that limit/offset handle pagination and that the ODSQL clauses are where/select/order_by/group_by/q/refine, but it does not substantially deepen the meaning of any individual parameter beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description is specific about the verb and resource: it queries and filters records within a dataset using ODSQL, and it lists the main query clauses. It clearly targets record-level access rather than dataset-level operations, but it does not explicitly contrast with export_dataset, so a little ambiguity remains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a clear, actionable prerequisite: call get_dataset first if field names are unknown. However, it does not explicitly say when to prefer export_dataset or get_facets over this tool, so exclusions and alternative routing are incomplete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_datasetsA

Search/list datasets in the City of Vancouver Open Data Portal catalog. Supports full-text search (q) and/or an ODSQL boolean filter (where). Returns dataset_id, title, description, theme, license, and record counts for each match.

ParametersJSON Schema
NameRequiredDescriptionDefault
qNoFree text search across dataset metadata
limitNo
whereNoODSQL boolean expression to filter datasets, e.g. "has_records=true"
offsetNo
orderByNoODSQL order_by expression, e.g. "modified desc"

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It says 'Search/list' which strongly implies a read-only operation, and it states the return fields. However, it does not explicitly declare that the operation is non-destructive or that it does not modify data. It also does not mention any rate limits, permissions, or error behavior. The description is adequate but not comprehensive for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact sentence that front-loads the core purpose ('Search/list datasets'), then specifies supported search modes and return fields. There is no redundant or filler content; every clause contributes useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with five parameters and no output schema, the description covers the purpose, supported parameters (q and where), and return fields. It does not explicitly explain pagination via limit/offset or ordering via orderBy, but those are defined in the schema. It is complete enough for an agent to understand what the tool does and what it returns, though it could add a note about pagination behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 60%: q, where, and orderBy have descriptions; limit and offset only have defaults. The description adds context for q and where (full-text search and ODSQL boolean filter), and clarifies that they can be used together ('and/or'). It does not mention limit or offset, and does not fully compensate for the missing descriptions. The added value over the schema is moderate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'search/list' and the resource 'datasets in the City of Vancouver Open Data Portal catalog'. It also enumerates the returned fields, making the tool's purpose unambiguous. The focus on searching/listing datasets distinguishes it from siblings like get_dataset (single dataset retrieval), query_records (records within a dataset), get_facets, and export_dataset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: when you need to search or list datasets, optionally using full-text search or an ODSQL filter. It does not explicitly name alternatives or state when not to use it, but the context is clear. It does not say 'use this instead of get_dataset', but the distinction is evident from the description's scope.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedexport_dataset
    • First observedget_dataset
    • First observedget_facets
    • First observedquery_records
    • First observedsearch_datasets

TDQS

A4.3/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct stage of the open-data workflow: catalog search, metadata/schema retrieval, record querying, facet discovery, and dataset export. Even though query_records and export_dataset both return rows, their intended use cases are clear and non-conflicting.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern: search_datasets, get_dataset, query_records, get_facets, export_dataset. The pattern is predictable and makes it easy to infer tool behavior from the name alone.

Tool Count5/5

Five tools is well-scoped for an open-data portal MCP server. Each tool earns its place by covering a necessary part of the exploration-and-extraction workflow without unnecessary redundancy.

Completeness5/5

The server covers the full read-only lifecycle for open data: discover datasets, inspect schema, explore facet values, query records, and export in multiple formats. There are no obvious dead ends or missing actions that would prevent an agent from accomplishing the apparent purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables querying Calgary open data from data.calgary.ca using the Socrata SODA API through natural language questions or direct tool calls.
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables searching, querying, and retrieving metadata from Vermont Open Data (data.vermont.gov) datasets using Socrata SoQL, all via natural language.
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables querying and searching the Providence Open Data catalog via Socrata SoQL, including dataset search, data querying, and metadata retrieval.
    7
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables searching and querying Virginia Open Data (datahub.va.gov) via the Socrata API, providing tools to search datasets, run SoQL queries, and retrieve metadata.
    8
    MIT