Calgary Open Data MCP Server
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., "@Calgary Open Data MCP ServerFind datasets related to public transit"
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.
Calgary Open Data MCP Server
An MCP (Model Context Protocol) server that gives AI assistants access to the Calgary Open Data portal. Search datasets, inspect schemas, and query any dataset using SoQL — all through a unified MCP interface.
Disclaimer: This project is unofficial and is not affiliated with, endorsed by, or connected to the City of Calgary. It queries publicly available data through the Socrata Open Data API.
Quick Start
Use the hosted server (no setup required)
Connect any MCP-compatible client to the hosted endpoint:
https://calgary-open-data.baobabtech.app/mcpRun locally with npx
npx calgary-open-data-mcpThis starts a local stdio MCP server — no cloning or configuration needed.
Related MCP server: CKAN MCP Server
Tools
The server exposes three tools:
search_datasets
Search the Calgary Open Data catalog by keyword, category, or tag.
Parameter | Type | Required | Description |
| string | no | Keyword search term |
| string | no | Filter by category name |
| string | no | Filter by tag |
| number | no | Results per page (1-100, default 10) |
| number | no | Pagination offset |
get_dataset_metadata
Get the full schema and metadata for a specific dataset.
Parameter | Type | Required | Description |
| string | yes | Socrata four-by-four ID (e.g. |
Returns column names, field names, data types, descriptions, tags, license, and last updated timestamp.
query_dataset
Query any dataset using SoQL (Socrata Query Language).
Parameter | Type | Required | Description |
| string | yes | Socrata four-by-four ID |
| string | no | Columns to return ( |
| string | no | Filter condition ( |
| string | no | Sort order ( |
| string | no | Group by columns ( |
| string | no | Post-aggregation filter ( |
| string | no | Full-text search across all text columns |
| number | no | Max rows to return (1-50000, default 100) |
| number | no | Pagination offset |
Client Configuration
All examples below use the hosted endpoint. Replace the URL with http://localhost:3000/mcp for local development.
Claude Desktop
Settings > Connectors > Add custom connector, enter:
https://calgary-open-data.baobabtech.app/mcpClaude Code
claude mcp add --transport http calgary-open-data https://calgary-open-data.baobabtech.app/mcpCursor
In .cursor/mcp.json:
{
"mcpServers": {
"calgary-open-data": {
"url": "https://calgary-open-data.baobabtech.app/mcp"
}
}
}ChatGPT
Settings > Apps & Connectors > Advanced settings, enable Developer mode, click Create, enter:
https://calgary-open-data.baobabtech.app/mcpnpx (stdio) for any MCP client
{
"mcpServers": {
"calgary-open-data": {
"command": "npx",
"args": ["-y", "calgary-open-data-mcp"]
}
}
}Self-Hosting
Vercel
The root of this repo is a Next.js app ready to deploy on Vercel.
git clone https://github.com/baobab-tech/calgary-open-data-mcp.git
cd calgary-open-data-mcp
pnpm installDeploy via the Vercel CLI or connect the repo in the Vercel dashboard.
Optional: Set a SOCRATA_APP_TOKEN environment variable in your Vercel project settings for higher Socrata API rate limits. Register for a free app token at data.calgary.ca.
Cloudflare Workers
A self-contained Cloudflare Worker lives in the cloudflare/ directory.
cd cloudflare
pnpm install
pnpm run login # authenticate with Cloudflare (first time only)
pnpm run dev # local development
pnpm run cf:deploy # deploy to CloudflareOptional: Set a SOCRATA_APP_TOKEN secret:
npx wrangler secret put SOCRATA_APP_TOKENDevelopment
Prerequisites
Setup
git clone https://github.com/baobab-tech/calgary-open-data-mcp.git
cd calgary-open-data-mcp
pnpm installRunning locally
Vercel (Next.js) dev server:
pnpm devMCP endpoint available at http://localhost:3000/mcp.
Cloudflare Worker dev server:
cd cloudflare
pnpm install
pnpm run devCLI (stdio):
pnpm build:cli
node dist/cli.jsType checking
# Root project (Vercel + CLI)
pnpm tsc --noEmit
# Cloudflare Worker
cd cloudflare && pnpm tsc --noEmitBuilding the CLI for npm
pnpm build:cliThis produces dist/cli.js — the file referenced by the bin field in package.json.
Project Structure
src/
lib/
socrata.ts Socrata API client (Discovery, Metadata, SODA)
tools.ts Shared MCP tool definitions
cli.ts npx entry point (stdio transport)
app/
[transport]/route.ts Vercel HTTP endpoint (Streamable HTTP)
page.tsx Landing page
layout.tsx
cloudflare/
src/index.ts Cloudflare Worker (self-contained)
wrangler.toml
package.jsonThe Vercel deployment and the npx CLI share tool definitions via src/lib/tools.ts. The Cloudflare Worker is self-contained since CF Workers use a different module runtime.
How It Works
This server wraps three layers of the Socrata Open Data API that powers data.calgary.ca:
Discovery API — catalog search across all datasets on the portal
Metadata API — detailed schema and column information per dataset
SODA API — the data query layer, using SoQL (a SQL-like query language)
Every dataset on the portal has a unique four-by-four ID (e.g. 35ra-9556). Use search_datasets to find IDs, get_dataset_metadata to understand the schema, then query_dataset to pull the data.
Transport
All remote endpoints use Streamable HTTP — the current MCP transport standard. The npx CLI uses stdio transport for local use.
Contributing
Contributions are welcome! Here's how to get started:
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Make your changes
Run type checking (
pnpm tsc --noEmit)Commit your changes (
git commit -m 'Add my feature')Push to the branch (
git push origin feature/my-feature)Open a Pull Request
Ideas for contributions
Additional tools (e.g. dataset export, geospatial queries)
Support for other Socrata-powered open data portals
Caching layer for frequently accessed metadata
Better error messages and input validation
Tests
Please open an issue first if you're planning a large change so we can discuss the approach.
License
MIT
Acknowledgements
City of Calgary Open Data for making public data accessible
Socrata / Tyler Data & Insights for the API platform
Model Context Protocol for the open standard
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/baobab-tech/calgary-open-data-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server