- Home
- MCP servers
- Government of Canada Open Data
Government of Canada Open Data
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"krunal16-c-gov-ca-mcp": {
"command": "python",
"args": [
"-m",
"gov_mcp.server"
],
"env": {
"YOUR_ENV_VAR": "VALUE"
}
}
}
}You have two Python-based MCP servers for Canada's Open Government data. One provides universal dataset discovery and metadata access, and the other focuses on transportation infrastructure data with national coverage. Run them locally for development or deploy them in containers to enable client applications to query datasets and infrastructure information efficiently.
How to use
Connect to the two MCP servers from your MCP client to discover datasets and query transportation infrastructure. Start the servers locally, then use an MCP client to issue standard requests for dataset search, schemas, and transport-focused queries.
How to install
Prerequisites: you need Python and pip installed on your system.
Step 1: Clone the project and install the package dependencies.
# Clone and install
# Assuming you have a working Git environment
cd gov_mcp
pip install -e .
# Or install dependencies directly
pip install -r requirements.txt
Step 2: Run the Dataset Discovery MCP server.
python -m gov_mcp.server
Step 3: Run the Transportation Infrastructure MCP server.
python -m gov_ca_transportation.server
Configuration and runtime notes
SSE transport is available for HTTP-based streaming. Start either server with the --sse flag and a port to enable the SSE endpoint. When SSE is enabled, the endpoint is shown in the server logs and looks like http://0.0.0.0:PORT/sse.
# Example: start Transportation MCP with SSE on port 8001
python -m gov_ca_transportation.server --sse --port 8001
# Example: start Dataset Discovery MCP with SSE on port 8002
python -m gov_mcp.server --sse --port 8002
Docker and deployment (high level)
You can run both MCP servers in containers or together using Docker Compose. Build images from the provided Dockerfiles and then run the containers, optionally exposing the SSE endpoints on specific ports. Logs can be viewed with docker-compose logs -f and containers stopped with docker-compose down.
Notes on data sources and usage
The Dataset Discovery MCP provides access to 250,000+ Canadian government datasets, enabling topic-based browsing, organization filtering, and dataset schema retrieval. The Transportation Infrastructure MCP focuses on bridge conditions, replacement costs, and trains/airports/ports across Canada, leveraging Statistics Canada data for national coverage.
Security and access considerations
If you enable SSE, ensure your client supports Server-Sent Events (EventSource in browsers, or equivalent in libraries) to receive streaming MCP events and results.
Troubleshooting and tips
If a server fails to start, verify Python is installed and the correct working directory contains the project package. Check for missing dependencies in requirements.txt and install them with pip. If you need to access logs, use docker-compose logs -f when running via Docker, or monitor terminal output when running the Python modules directly.
Examples of practical usage
- Start both servers, then connect a client to search datasets and query transportation data. - Use the Dataset Discovery MCP to fetch a dataset schema and obtain download URLs. - Use the Transportation MCP to analyze bridge conditions or retrieve infrastructure costs by province.
Summary of available endpoints and commands
The servers are started with Python modules and can optionally expose SSE endpoints for streaming results. The canonical start commands are shown earlier in this section. Use those exact commands to run the local MCP servers and access their capabilities.
Architecture and data sources overview
The architecture includes two MCP servers: one for dataset discovery (gov_mcp) and one for transportation infrastructure (gov_ca_transportation). The transportation server integrates Statistics Canada data for bridge conditions and costs, complemented by provincial data sources for broader coverage.
Available tools
search_datasets
Search across 250,000+ Canadian government datasets
get_dataset_schema
Get complete dataset schema with field definitions and download URLs
list_organizations
Browse datasets by department or organization
browse_by_topic
Explore datasets by subject area
check_available_mcps
Check which MCPs are available
get_activity_stream
See recently updated datasets
query_datastore
Query data directly (fallback mode)
query_bridges
Search bridge infrastructure by province with StatCan data
analyze_bridge_conditions
Aggregate bridge condition analysis using Statistics Canada data
get_infrastructure_costs
Get replacement costs by condition from Statistics Canada
query_ports_airports
Search airports, ports, marinas, heliports
query_railways
Search railway lines and stations
query_tunnels
Search tunnel infrastructure
compare_across_regions
Compare infrastructure across provinces