Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Toronto MCP Serverfind datasets about bike lanes and their update frequency"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 datasetssearch_datasets: Search datasets by keywordget_package: Retrieve complete metadata for a datasetget_first_datastore_resource_records: Get records from the first active resourceget_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 previewsget_data_categories: Explore all available organizations and topic groupsget_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
๐ Quick Start
1. Deploy Your Own Instance
2. Test Deployment
3. Connect to Claude Desktop
Create or edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Restart Claude Desktop and start asking questions about Toronto's open data!
๐งช Testing & Validation
Quick Connectivity Test
Automated Testing Framework
Manual Testing in Claude Desktop
Try these test queries to verify functionality:
Basic Search: "Find datasets about parking in Toronto"
Update Analysis: "How often does Toronto update traffic data?"
Data Structure: "What fields are in Toronto's building permits data?"
Comprehensive: "Give me insights about Toronto's environmental data"
Categories: "What departments provide open data in Toronto?"
๐ Success Metrics
Your MCP server is working correctly when:
โ Claude consistently selects appropriate tools for queries
โ Results include relevance scores and rankings
โ Update frequency information is categorized correctly
โ Data structure analysis shows complete field information
โ Response times are under 10 seconds for complex queries
โ Error handling provides helpful messages
๐ Documentation
๐ Example Usage Guide
Concrete examples of how to use each MCP tool, including JSON parameters and expected responses. Essential for understanding tool capabilities and integration patterns.
๐ Evaluation & Testing Guide
Comprehensive testing strategies, quality metrics, and evaluation criteria. Includes manual test queries, performance benchmarks, and success metrics for validating MCP server functionality.
๐งช Automated Testing Framework
TypeScript test framework for programmatic validation, performance monitoring, and automated quality assurance. Includes executable test cases and CI/CD integration patterns.
โ๏ธ Claude Desktop Configuration
Ready-to-use MCP server configuration for Claude Desktop integration.
๐ฏ Example Tool Usage
Natural Language Queries (via AI Assistant)
Direct Tool Calls (for developers)
๐ง Available Scripts
๐ Key Features
Intelligent Relevance Scoring
Weighted algorithm: Title (10pts) > Description (5pts) > Tags (3pts) > Organization (2pts)
Context-aware ranking: Matches user intent with appropriate datasets
Multi-keyword support: Handles complex queries effectively
Comprehensive Update Analysis
Frequency categorization: Daily, weekly, monthly, quarterly, annually, irregular
Metadata inference: Analyzes patterns when explicit schedules aren't available
Quality assessment: Identifies stale vs. actively maintained datasets
Deep Data Structure Insights
Complete schema analysis: Field names, types, constraints
Record statistics: Counts, completeness, data quality indicators
Sample data: Optional previews for quick assessment
Multi-resource support: Handles datasets with multiple files/formats
๐ Extending
To add more tools or data sources:
Edit
src/ckanTools.tsto add new tool functionsRegister new tools in
src/index.tsUpdate type definitions and validation schemas
Add corresponding tests in the testing framework
Example:
๐ค Contributing
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass:
npm testSubmit a pull request
๐ License
MIT License - see LICENSE file for details.
Built for intelligent open data discovery โข Powered by Toronto Open Data & CKAN API โข Enhanced for AI assistant integration