Morocco communes: open data on Moroccan communes

Morocco communes

An MCP server with 13 tools gives an agent Morocco's administrative units: 1,503 communes, 2014 and 2024 censuses, boundaries

  • 50 ★ on the repository
  • Last commit
  • MIT
MCP server

Minimal access

Why this level

  • All 13 tools are read-only and call the project's remote server
  • Usage is counted anonymously by route and tool names
All reasons and checks

zkousama/morocco-communes

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/morocco-communes

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Minimal accessThe tool runs nothing and makes no network calls.

  • All 13 tools are read-only and call the project's remote server
  • Usage is counted anonymously by route and tool names

This is third-party code. Review the repository files before installing.

What it does

The project builds an open dataset, an HTTP API and a site from the tables of Morocco's High Commission for Planning (HCP) and OpenStreetMap data. The dataset describes 12 regions, 75 provinces and prefectures, 213 circles, 1,503 communes and 41 arrondissements, with official HCP codes, names in French and Arabic, and population for 2024 and 2014. For agents there is an MCP server with 13 read-only tools: search, get_commune, get_unit, communes_near, commune_at, list_communes, get_indicators, get_economy, get_housing, get_insights, get_neighbourhoods, get_douars and search_douars. They find a commune by name, code or coordinates and return census indicators on age, education, languages, work and housing, the number of economic establishments and the douars of rural communes. Search understands French and Arabic spellings, folds variants of Arabic letters and finds a city by a Latin spelling, for example titwan for Tétouan. The same data sits in the repository under data/v1 and is usable without the API, and there are npm and PyPI packages.

Who it is for. Analysts, journalists and developers working with Moroccan administrative and census data who want to put questions to an agent.

Good fit when

  • You need to find a commune by its French or Arabic name and get its official HCP code
  • You need a list of a province's communes above a population threshold
  • From coordinates you must find which commune a point lies in and which communes are nearby
  • Comparing the 2014 and 2024 censuses: population growth, unemployment, languages
  • A form needs a region, province and commune picker with an HCP code

Not a fit when

  • You need data for another country: the set covers only Morocco
  • You need current indicators beyond the 2014 and 2024 censuses and the 2024 establishment count
  • You need to write data: all 13 tools are read-only
  • You need boundaries under a licence without share-alike: geometry is ODbL with share-alike terms

Example request

Find the commune of Tétouan, show its population in 2014 and 2024 and name the nearby communes within 15 km.

MCP

Transport
http
Authentication
not required

Limitations

The data comes from HCP tables under CC BY 4.0 terms, while boundaries and five commune fields from OpenStreetMap are ODbL with share-alike, so the geometry directory cannot be used without keeping those terms. The npm and PyPI packages ship without the OpenStreetMap fields.

Pre-rendered files are served without counting, and calls to the alias and computed routes and the MCP server are counted in Cloudflare analytics by route and tool names. The author states that a row holds a day and a few categories and no keys, cookies or addresses. The README gives the MCP server's address only as the /mcp path on the project site.

How to disable. Remove the server entry from the client config, for Claude Code claude mcp remove with the name you chose. The server stores no data on your side and issues no keys.

FAQ

What does the dataset contain?

12 regions, 75 provinces and prefectures, 8 arrondissement prefectures, 213 circles, 1,503 communes and 41 arrondissements with official HCP codes, plus the 2014 and 2024 censuses, the 2024 establishment count, 33,189 douars and a 2014-to-2024 code crosswalk.

Which tools does the MCP server have?

Thirteen, all read-only: search, get_commune, get_unit, communes_near, commune_at, list_communes, get_indicators, get_economy, get_housing, get_insights, get_neighbourhoods, get_douars and search_douars. Setup instructions are on the site's /docs/mcp/ page.

Can I skip the API?

Yes. The data/v1 directory is committed and versioned, with JSON and CSV that open in Excel with Arabic names intact. There are also morocco-communes packages for npm and PyPI with pandas tables.

How does search handle spelling variants?

It takes French and Arabic, a slug or a code. It folds Arabic letter variants and matches a Latin spelling by consonants: titwan finds Tétouan and jdida finds El Jadida. A hand-made table covers 18 exonyms such as Fez and Port Lyautey.

Which licences apply to the data?

Attributes, indicators and economy come from HCP under CC BY 4.0, while geometry and five commune fields from OpenStreetMap are ODbL with share-alike. Each directory in data/v1 states its own licence.

Discussion

No questions or reviews yet.

data.gouv.fr MCP

data.gouv.fr MCP Server

Official

Official MCP server for France's open data portal: search, explore and query datasets straight from a chat with the agent

MCP serverExtended access1.6KRepository stars
Official

Official Data Commons MCP server: an agent finds statistical indicators and pulls observations for countries, regions and cities.

MCP serverExtended access149Repository stars

Data-gov-il-mcp opens Israeli government open data from data.gov.il to an agent: datasets, organizations, tags and table records.

MCP serverMinimal access111Repository stars

An MCP server for more than 40 open US government APIs: economy, health, Congress and lobbying, with over 300 tools.

MCP serverExtended access112Repository stars

An MCP server for Canadian government data: exchange rates, parliament, product recalls and drugs, reached through BM25 search.

MCP serverMinimal access62Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Morocco communes: open data on Moroccan communes (this card)nonot required50
US Government Open Data MCPnokey is optional112US open data, while this set covers Morocco with HCP censuses
GeoLens MCPyeskey is optional297a general geo service without Morocco's official codes and censuses

README in short

The README describes the dataset structure and three API tiers: pre-rendered files, aliases and computed answers, with 12,723 ready files on Cloudflare Pages. Next come data for programs and agents, a commune picker form, npm and PyPI packages, an Astro site in English, French and Arabic, and a section on usage counting.

README badge

Report a problem