Toronto MCP Server

$npx mcp-remote https://toronto-mcp.s-a62.workers.dev/sse
README.md

Intelligently query, analyze, and retrieve datasets from Toronto's open data.

Toronto MCP Server: Toronto Open Data Tools

This project implements a Model Context Protocol (MCP) server for Toronto Open Data, deployable on Cloudflare Workers. It exposes a comprehensive set of tools for intelligently querying, analyzing, and retrieving datasets from Toronto's CKAN-powered open data portal, making them accessible to MCP-compatible clients like Claude Desktop, Cursor, and other AI assistants.

๐Ÿš€ Live Server

Deployed at: https://toronto-mcp.s-a62.workers.dev

  • SSE Endpoint: https://toronto-mcp.s-a62.workers.dev/sse (for Claude Desktop)
  • MCP Endpoint: https://toronto-mcp.s-a62.workers.dev/mcp (for other clients)

What does it do?

  • Provides a remote MCP server exposing tools for Toronto's Open Data via the CKAN API
  • Intelligently discovers relevant datasets using advanced relevance scoring
  • Analyzes data freshness patterns with comprehensive update frequency tracking
  • Provides deep data structure insights including field analysis and schema information
  • Enables natural language querying of Toronto's 500+ open datasets
  • Supports comprehensive data analysis combining multiple analytical dimensions

๐Ÿ› ๏ธ Features

Basic CKAN Tools

  • list_datasets: List all available datasets
  • search_datasets: Search datasets by keyword
  • get_package: Retrieve complete metadata for a dataset
  • get_first_datastore_resource_records: Get records from the first active resource
  • get_resource_records: Get records from a specific resource by ID

๐Ÿง  Advanced Analysis Tools

  • find_relevant_datasets: Intelligently find and rank datasets using relevance scoring (title, description, tags, organization)
  • analyze_dataset_updates: Analyze update frequencies with categorization (daily, weekly, monthly, quarterly, annually, irregular)
  • analyze_dataset_structure: Deep-dive into dataset structure with field definitions, data types, record counts, and optional data previews
  • get_data_categories: Explore all available organizations and topic groups
  • get_dataset_insights: Comprehensive analysis combining relevance ranking, update frequency, and data structure insights

๐Ÿ’ก Use Cases

For AI Assistants & Researchers

  • "What traffic data is available in Toronto?" โ†’ Ranked datasets with relevance scores and update frequencies
  • "How current is Toronto's environmental data?" โ†’ Update frequency analysis across environmental datasets
  • "What fields are in the building permits dataset?" โ†’ Complete schema analysis with data types and sample records
  • "Give me insights about Toronto's budget data" โ†’ Comprehensive analysis with relevance, freshness, and structure
  • "Which datasets update daily?" โ†’ Frequency-based filtering and categorization

For Data Scientists & Analysts

  • Discover datasets relevant to specific research questions
  • Assess data quality and reliability through update patterns
  • Understand data structure before detailed analysis
  • Find related datasets across different city departments
  • Evaluate data completeness and field availability

๐Ÿ—๏ธ Tech Stack

  • Cloudflare Workers: Serverless deployment platform
  • Model Context Protocol (MCP): Standard for AI tool integrations
  • TypeScript: Type safety and modern development
  • Zod: Runtime parameter validation
  • CKAN API: Direct integration with Toronto Open Data

๐Ÿ“ Project Structure

toronto-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts                 # MCP server setup and routing
โ”‚   โ””โ”€โ”€ ckanTools.ts            # Toronto Open Data tools implementation
โ”œโ”€โ”€ test-runner.ts              # Automated testing framework
โ”œโ”€โ”€ test-deployment.ts          # Deployment validation script
โ”œโ”€โ”€ claude-mcp-config.json      # Claude Desktop configuration
โ”œโ”€โ”€ evaluation-guide.md         # Comprehensive testing strategies
โ”œโ”€โ”€ example-usage.md            # Usage examples and patterns
โ”œโ”€โ”€ testing-guide.md            # Automated testing documentation
โ””โ”€โ”€ README.md                   # This file

๐Ÿš€ Quick Start

1. Deploy Your Own Instance

# Clone and deploy
git clone <your-repo>
cd toronto-mcp
npm install
wrangler deploy

2. Test Deployment

# Install testing dependencies
npm install tsx

# Test your deployment
npx tsx test-deployment.ts https://your-worker.workers.dev

3. Connect to Claude Desktop

Create or edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "toronto-mcp": {
      "command": "npx",
      "args": ["mcp-remote", "https://toronto-mcp.s-a62.workers.dev/sse"]
    }
  }
}

Restart Claude Desktop and start asking questions about Toronto's open data!

๐Ÿงช Testing & Validation

Quick Connectivity Test

npx tsx test-deployment.ts https://toronto-mcp.s-a62.workers.dev

Automated Testing Framework

# Run mock tests (validates framework)
npm test

# Test specific deployment
npm run test

Tools (10)

list_datasetsList all available datasets
search_datasetsSearch datasets by keyword
get_packageRetrieve complete metadata for a dataset
get_first_datastore_resource_recordsGet records from the first active resource
get_resource_recordsGet records from a specific resource by ID
find_relevant_datasetsIntelligently find and rank datasets using relevance scoring
analyze_dataset_updatesAnalyze update frequencies with categorization
analyze_dataset_structureDeep-dive into dataset structure with field definitions and data types
get_data_categoriesExplore all available organizations and topic groups
get_dataset_insightsComprehensive analysis combining relevance ranking, update frequency, and structure insights

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "toronto-mcp": {
      "command": "npx",
      "args": ["mcp-remote", "https://toronto-mcp.s-a62.workers.dev/sse"]
    }
  }
}

Try it

โ†’What traffic data is available in Toronto?
โ†’How current is Toronto's environmental data?
โ†’What fields are in the building permits dataset?
โ†’Give me insights about Toronto's budget data
โ†’Which datasets update daily?

Frequently Asked Questions

What are the key features of Toronto MCP Server?

Intelligently discovers relevant datasets using advanced relevance scoring. Analyzes data freshness patterns with comprehensive update frequency tracking. Provides deep data structure insights including field analysis and schema information. Enables natural language querying of Toronto's 500+ open datasets. Supports comprehensive data analysis combining multiple analytical dimensions.

What can I use Toronto MCP Server for?

Researchers assessing data quality and reliability through update patterns. Data scientists understanding data structure before detailed analysis. Finding related datasets across different city departments. Evaluating data completeness and field availability for specific research questions. Filtering Toronto city data based on update frequency (daily, weekly, etc.).

How do I install Toronto MCP Server?

Install Toronto MCP Server by running: npx mcp-remote https://toronto-mcp.s-a62.workers.dev/sse

What MCP clients work with Toronto MCP Server?

Toronto MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Toronto MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free