datagovma-mcp
Click on "Deploy 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., "@datagovma-mcpsearch for datasets about education in Morocco"
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.
datagovma-mcp
MCP server for the Moroccan Open Data portal (data.gov.ma).
datagovma-mcp exposes curated MCP tools backed by CKAN Action API endpoints so AI clients can discover datasets, resources, organizations, and groups in a consistent typed shape.
What this project provides
Streamable HTTP MCP server built with FastMCP.
Typed and validated tool inputs/outputs.
Centralized CKAN envelope validation (
successchecks, JSON checks, timeout handling).Test suite covering success and error paths.
Docker image and Docker Compose setup.
Related MCP server: data-bs-mcp
Implemented MCP tools
MCP tool | CKAN action | Purpose |
|
| Check portal identity and CKAN version. |
|
| Full-text search with paging and optional facets. |
|
| Fetch one dataset by slug or UUID. |
|
| List dataset names with pagination. |
|
| Fetch one resource and download metadata. |
|
| Search resources using strict |
|
| List organization names with pagination. |
|
| Fetch organization details and optional datasets. |
|
| List group names with pagination. |
|
| Fetch group details and optional datasets. |
|
| Aggregate facet buckets ( |
Requirements
Python
>=3.11uv for dependency management
Docker (optional, for containerized runs)
Quick start (local)
uv sync --frozen --group dev
cp .env.example .env
set -a && source .env && set +a
uv run datagovma-mcpDefault endpoint:
MCP:
http://127.0.0.1:8000/mcpHealth:
http://127.0.0.1:8000/healthz
Quick health check:
curl -fsS http://127.0.0.1:8000/healthzExpected response:
200 OKwith bodyok.
Run with Docker
docker compose up --buildThe service starts on port 8000 by default and exposes /mcp and /healthz.
Connect from LLM clients
Claude Desktop
After the server is running, edit:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Then add:
{
"mcpServers": {
"opengovma": {
"command": "npx",
"args": ["mcp-remote", "http://127.0.0.1:8000/mcp"]
}
}
}Claude Code
Add the server with Claude Code CLI:
claude mcp add --transport http opengovma http://127.0.0.1:8000/mcpCodex (Desktop app and CLI)
Add the server with Codex CLI:
codex mcp add opengovma --url http://127.0.0.1:8000/mcpVS Code (GitHub Copilot MCP)
Create .vscode/mcp.json in your workspace (or open your user MCP config via command palette) and add:
{
"servers": {
"opengovma": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp"
}
}
}Cursor
Add this to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"opengovma": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}Configuration
Environment variables are loaded by your shell or container runtime.
Variable | Default | Description |
|
| Host interface used by Uvicorn inside the app. |
|
| Docker Compose helper mapped to |
|
| Listening port. |
|
| Number of worker processes ( |
|
| Hot reload mode for development ( |
|
| HTTP keep-alive timeout in seconds ( |
|
| One of |
|
| One of |
Notes:
MCP_RELOAD=truerequiresMCP_WORKERS=1.MCP_LOG_FORMAT=richfalls back to plain logs if Rich is unavailable.
Continuous integration
GitHub Actions workflow: .github/workflows/ci.yml
CI runs on pull requests and pushes to main/master and includes:
dependency review (PR only)
lint (
ruff)format check (
ruff format --check)type check (
mypy)tests (
pytest)package build (
uv build)
Contributing
Contributions are welcome. See CONTRIBUTING.md for setup, checks, and PR guidance.
License
Licensed under the MIT License. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for finding authoritative primary data sources and official portals.
dati.gov.it MCP — Italy's national open-data portal (CKAN API).
data.gov.il MCP — Israel national open-data portal (CKAN API).
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides access to government datasets from Data.gov, enabling users to search packages, view dataset details, list groups and tags, and access resources by URL.427 npm19MIT
- FlicenseAqualityCmaintenanceMCP server for querying Huwise/Opendatasoft data portals. Enables dataset search, metadata retrieval, record filtering with ODSQL, and data export.53-
- FlicenseNot gradedqualityDmaintenanceMCP server to query French Open Data from data.gouv.fr-
- AlicenseAqualityCmaintenanceAn MCP server to find and fetch Norwegian open government data from data.norge.no. Enables search, metadata retrieval, and data download.53MIT