Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.
PopNx MCPMCP servers for people who use AI · explained in plain words

Morocco communes

by zkousamaversion 1.9.1i★ 50iRuns in the cloud
Registry nameio.github.zkousama/morocco-communes

How to install

Overview

Description from the maker (original English)

Morocco's régions, provinces and communes: HCP codes, names, census population and boundaries

What you can do with it

We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.

  • Connection: Runs in the cloud
  • Transport: Streamable HTTP
  • Category: Law & government data

Install

Pick the AI app you use, then copy the settings.

Passed 4/4 checks · What you ask goes through the maker’s server (communes.pages.dev)

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude · about 2 min

No key, nothing to install · Set it up once on claude.ai or the desktop app, then use it in chat · free accounts can add 1

  1. Open Claude’s Connectors page

    CustomizeConnectors

    CustomizeConnectors1+ Add2https://…3Add4
  2. Click “+ Add” → “Add custom connector” and fill in these 2 fields

    Copy each value into the field with the same name in Claude, then click Continue

    Name · NameMorocco communes
    Remote MCP server URL · Addresshttps://communes.pages.dev/mcp

    Leave Authentication as Claude detected it, then click Add

  3. Turn it on in a chat

    +ConnectorsMorocco communes

  4. Try it

    Use Morocco communes and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Morocco communes or shows a Morocco communes tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with ChatGPT on business plans only

ChatGPT Business, Enterprise or Edu on the web, added by a workspace admin or owner · On Free, Plus or Pro: your ChatGPT plan cannot connect MCP yet

  1. Open ChatGPT’s add-MCP page on the web

    Plugins+Add custom MCP server

    ChatGPTPlugins1+2https://…3Create4
  2. Fill in the name and address

    Enter a name, paste the address under Connection, tick the risk warning and click Create as a plugin

    Name · NameMorocco communes
    Connection · Addresshttps://communes.pages.dev/mcp
  3. Pick Morocco communes in a chat

    Start a new chat and pick Morocco communes from your plugins before typing

  4. Try it

    Use Morocco communes and tell me what you can do for me, then show me one thing

    ✓ If ChatGPT says it is using Morocco communes or shows a Morocco communes tool in the answer, you are connected

Menu names checked against OpenAI’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Claude Code · about 2 min

No key, nothing to install

  1. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  2. Paste this command and press Enter

    claude mcp add --transport http morocco-communes https://communes.pages.dev/mcp
  3. Type /mcp in Claude Code

    You should see Morocco communes listed as connected

  4. Try it

    Use Morocco communes and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Morocco communes or shows a Morocco communes tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor · about 2 min

No key, nothing to install

  1. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  2. Open the AI chat in Cursor in Agent mode

  3. Try it

    Use Morocco communes and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Morocco communes or shows a Morocco communes tool in the answer, you are connected

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code · about 2 min

No key, nothing to install

  1. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  2. Open the AI chat in VS Code in Agent mode

  3. Try it

    Use Morocco communes and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Morocco communes or shows a Morocco communes tool in the answer, you are connected

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

Address for apps that connect over the web

Addresshttps://communes.pages.dev/mcp

JSON settings are under “For developers” below

Stuck? Ask people who use Morocco communes💬 Discussion →
For developers: Terminal commands and JSON settings

Over the web

Claude Code

claude mcp add --transport http morocco-communes https://communes.pages.dev/mcp

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "morocco-communes": {
      "url": "https://communes.pages.dev/mcp"
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "morocco-communes": {
      "type": "http",
      "url": "https://communes.pages.dev/mcp"
    }
  }
}

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
Not on npm/PyPI
Licencei
No licence stated
Connection
Runs in the cloud
Transport
streamable-http
Latest versioni
1.9.1
Published to registryi
Sep 30, 2026
Code last changedi
Oct 29, 2026
Maker
zkousama
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Connect over the internet in

ClaudeChatGPTGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatOpen WebUIRaycast

All apps, with pros and cons →

Related guides

What it can do

Tool names and descriptions exactly as the server reported them on Nov 10, 2026. The maker wrote them, not us; we show them as plain text.

  • search_douars

    Find douars, the villages and hamlets of Morocco's rural communes as HCP's 2024 census lists them, by name, in Arabic or in Latin letters: تشديرت and Tachdirt both find the douar of Asni. HCP names douars in Arabic only; the Latin name comes from a source where one writes it, and

  • search

    Find régions, provinces and préfectures, cercles, communes and arrondissements of Morocco by name. Takes French or Arabic, a slug, or another name a place is known by: Fez finds Fès, Mogador finds Essaouira. A neighbourhood's name finds the arrondissement or commune it's in, with

  • get_commune

    One commune's names, type, région, province and cercle, 2024 and 2014 population, the change between them, a point inside it, the communes it borders and how much boundary it shares with each, and in the 6 cities divided into them, its arrondissements with their population. Ident

  • communes_near

    Communes within a radius of a point, nearest first. Distance is measured to each commune's centroid, so the nearest commune isn't always the one that contains the point: commune_at gives that one.

  • commune_at

    The commune whose boundary contains a point, with its names, type, parents and population, and in Casablanca, Rabat, Fès, Marrakech, Salé and Tanger the arrondissement too. Use it to turn coordinates, from a map or a device, into a commune. Sidi Mohamed Benmansour has no boundary

  • list_communes

    Which commune has the most or the least of something is one call here: sort by that figure, and every commune in the filter comes back in order with its value, with no need to look them up one by one. Communes filtered by région, province or préfecture, cercle, type or population

  • get_unit

    One région, province, préfecture or cercle: its name in French and Arabic, its 2024 population and households, the units above it, how many units it holds, and the ones directly under it, named: a région's provinces, a province's cercles. This is the tool for a question about a u

  • get_indicators

    HCP's census figures for Morocco or any région, province or préfecture, cercle, commune or arrondissement: age, marital status, fertility, disability, schooling, illiteracy, the languages people read and write and the local languages they use, education, work, employment status a

  • get_economy

    HCP's 2024 count of economic establishments for Morocco or any région, province or préfecture, cercle, commune or arrondissement: how many establishments were mapped, how many are public services, how many are associations in premises of their own, how many are businesses, and ho

  • get_housing

    HCP's 2024 count of urban dwellings for Morocco or any unit that has an urban area: how many there are, how many are occupied, vacant or second homes, what kind they are (villa, apartment, traditional or modern Moroccan house, slum, rural-type), how old they are, what their walls

  • get_insights

    For a commune, up to 3 of its 2024 census figures that stand out: among the highest or lowest communes, moved far more or less than other communes since 2014, or far from its province's figure. Each comes with its context as numbers, worked out from the census: the commune's othe

  • get_neighbourhoods

    The neighbourhoods OpenStreetMap and Poste Maroc name in a commune, a city's arrondissements included, with the arrondissement each was placed in where it has a point, where its name comes from, and the postcodes Poste Maroc lists under it; and the commune's postcodes. The census

  • get_douars

    The douars of a rural commune from HCP's 2024 census, the villages and hamlets it's made of, grouped in its fractions (mashyakha), named in Arabic only. Each has its kind (grouped, split into sub-douars, or dispersed), its households and its people. A douar has its name in Latin

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 11, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account zkousama, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 13 days ago

  • … Not checked yet

    Has a licence

    We have not read this repo from GitHub yet

  • ✓ Pass

    Endpoint responds

    Responded in 517 ms (HTTP 200)

  • – Not applicable

    Sign-in with OAuth

    No sign-in needed

  • ✓ Pass

    No hidden instructions in tool descriptions

    Read 13 tool descriptions and found no hidden instructions to the AI

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in with Google to post

User reviews

No reviews yet

Sign in with Google to write a review

Compared with others in Law & government datai

  • More stars than 99% of the other 1805 servers in this category
  • Published to the registry more recently than 43% of the other 1805 servers in this category
  • Basic checks equal to or better than 100% of the other 1805 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Morocco communes safe?

It passed 4 of 4 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs in the maker’s cloud. Connect over the internet with nothing to install, but what you send passes through the maker’s servers.

Is it still maintained?

The GitHub repo last changed 13 days ago, and the latest version (1.9.1) reached the registry 42 days ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. It connects by URL, so apps that accept remote MCP servers work too, such as ChatGPT Business and above.

What can I use instead?

In the same category: Korean Law MCP, Global law, Tw Legal Rag

Alternatives

Servers in the same category from other makers, sorted by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Korean Law MCP

Korean law: statutes, precedents, ordinances, treaties and citation verification (법제처 API).

by chrisryugjWidely used★ 2.9KUpdated 8 days ago

Runs in the cloud

Global law

The law of nearly every country on earth, any date: read it, see what changed it, check citations.

by lexifinaGrowing★ 1.9KUpdated yesterday

Runs in the cloud✓ lexifina.com

Tw Legal Rag

Taiwan law MCP server: 22M court judgments, statutes, agency rulings, with citation checks

by aa0101181514Growing★ 345Updated today

Runs in the cloud

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

Morocco communes

An open dataset and HTTP API for Morocco's administrative divisions: 12 régions, 75 provinces and préfectures, 8 préfectures d'arrondissements, 213 cercles, 1,503 communes and 41 arrondissements, with official HCP geographic codes, names in French and Arabic, 2024 and 2014 population, HCP's census figures on age, education, languages, work and housing from both years, the 2024 count of economic establishments, the douars of the rural communes, and boundaries from OpenStreetMap.

HCP publishes the census as spreadsheets. This builds a dataset, an API and a site from them and from OpenStreetMap, and shows the working.

The dataset

data/v1/ is committed and versioned, so you can use it without the API at all. CHANGELOG.md says what each version added; the build refuses a version with no entry in it.

DirectoryHoldsLicence
attributes/every unit, JSON and CSVHCP, on CC BY 4.0 terms
geometry/one TopoJSON per région, and which communes border whichODbL, share-alike
indicators/the census indicators for every unit, 2024 and 2014, JSON and CSVHCP, on CC BY 4.0 terms
economy/the 2024 count of economic establishments for every unit, JSON and CSVHCP, on CC BY 4.0 terms
housing/the 2024 urban housing stock, by dwelling, JSON and CSVHCP, on CC BY 4.0 terms
douars/the 33,189 douars of the rural communes in 2024, each in its fraction, JSON and CSVHCP, on CC BY 4.0 terms
crosswalk/the 2014 ↔ 2024 reconciliationHCP, on CC BY 4.0 terms
insights/each commune's 2024 figures that stand out, with its neighbours and 2014 beside each, JSONthe lines this repository's own; the figures HCP, on CC BY 4.0 terms
sources.jsoneach source's digest, licence and vintage

The licences differ by directory and geometry/ carries its own LICENSE. Five fields on each commune (centroid, bbox, osm, areaKm2 and density) come from OpenStreetMap and are ODbL too; provenance.geometry marks them. Every level has a CSV that opens cleanly in Excel, Arabic included.

Rebuild it with pnpm dataset:build. From the same cache the output is byte-identical.

pnpm build also writes the boundaries as GeoJSON from the TopoJSON above: each commune, and each province and région outlined from its communes. They're served beside it rather than committed.

The API

Three tiers, and which one served a response is in its X-Api-Tier header.

Pre-rendered. 12,723 files written at build time and served straight from Cloudflare Pages, without running any code. Free and unmetered.

GET /api/regions.json                        GET /api/regions/01.json

GET /api/regions/01/provinces.json GET /api/regions/01/communes/page/1.json GET /api/provinces/01.511.json GET /api/provinces/01.511/cercles.json GET /api/cercles/01.511.05.json GET /api/communes/01.511.01.0.json GET /api/communes/page/1.json GET /api/communes/type/urban/page/1.json GET /api/communes/01.511.01.0/arrondissements.json GET /api/communes/09.581.01.07/neighbours.json GET /api/communes/01.511.01.0/indicators.json GET /api/communes/09.581.01.07/economy.json GET /api/communes/09.163.07.17/douars.json GET /api/communes/01.511.01.0/neighbourhoods.json GET /api/arrondissements/01.511.01.05.json GET /api/indicators.json GET /api/economy.json GET /api/version.json GET /data/v1/**

Alias. The query-string and extensionless shapes. A path-keyed asset store can't match on a query string, so the Worker resolves these to the file that already holds the answer and names it in Content-Location:

GET /api/communes?province=01.511&page=1     GET /api/communes?type=urban

GET /api/communes/tanger GET /api/communes/001511010 GET /api/communes/tanger/indicators GET /api/communes/tiznit/economy

Computed. The answers no file holds:

GET /api/search?q=tanger&levels=commune&limit=10

GET /api/douars/search?q=tachdirt GET /api/communes/near?lat=33.5731&lng=-7.5898&radius=15 GET /api/communes/at?lat=35.786&lng=-5.8125 GET /api/communes?province=01.511&type=urban GET /api/communes?sort=-population&min_population=100000 GET /api/communes?region=01&sort=-labour.unemploymentRate GET /api/communes?sort=-economy.establishments.jobs

A list sorts by any of the census indicators, by its path, and each commune it lists then carries the figure it was sorted by. 2014. before the path sorts by the 2014 figure and change. by how far a commune moved between the censuses. An establishment count goes under economy..

Search takes French, Arabic, a slug or a code. It folds the alef variants, ta-marbuta and alef maqsura the names actually carry, and the tatweel and vowel marks they never do but people type anyway. It matches names spelt another way by their consonants, so titwan finds Tétouan and jdida El Jadida. 01.511.01.0, 001511010, 1511010 and tanger all address one commune, and 18 exonyms are listed by hand because no amount of character folding gets from Fez to Fès or from Port Lyautey to Kénitra. A neighbourhood's name finds the commune or arrondissement it's in, and so does a 5-digit postcode. Douars have a search of their own, in Arabic or Latin letters: tachdirt and tashdirt both find تشديرت.

What's counted. The alias and computed routes and the MCP server count their own use in Workers Analytics Engine: the route with its codes taken out, or an MCP message's tool when it called one and its method otherwise, the name an MCP client gives itself, the first word of the User-Agent, the country, the status and how long it took. Pre-rendered files run no code, so they aren't counted. pnpm stats reads it back, with the npm, PyPI and GitHub numbers.

A second store, in D1, counts 5 kinds of row: a search, a place opened, a tool an assistant calls, the name an MCP client gives itself, and a file downloaded. An assistant connecting through the MCP server is counted by the name it gives itself, and each tool it calls by the tool's name and the place it asks about. A row is a day and a handful of categories, and no row holds a key, a cookie or an address that ties it to another. pnpm demand reads it back; the site's /docs/privacy/ page says exactly what's kept.

pnpm deploy:live switches it on. It applies the migration to the live database, builds the site with the most looked-up page read from that database, deploys it, then deploys the nightly rollup Worker. A plain pnpm build doesn't query the database and leaves that page empty. A failed write is swallowed, so pnpm demand a day after the first deploy is how to see rows are arriving.

Every response is enveloped with data, meta and links. Errors are RFC 9457 problem documents, and a well-formed code that names nothing is a 404 while something unsearchable is a 400. CORS is open.

Full reference: api/README.md.

For programs and agents
  • `/api/openapi.json`: an OpenAPI 3.1 description of every route, built from the same module the Worker reads its limits from, so the defaults and bounds it states are the ones enforced. Most agent frameworks turn it into tools directly.
  • `/llms.txt`: a short markdown map of the API and the dataset, in the llmstxt.org shape, for an LLM reading the site.
  • `/mcp`: 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, search_douars), so Claude, Claude Code and other MCP clients can query the data directly, census figures included. The site's /docs/mcp/ page has the setup for each client.
In a form, or offline
  • `/components/commune-picker.js`: a custom element that fills a région, a province and a commune from the static files, so a form posts the commune's HCP code. It's served with open CORS, and /docs/components/ has a React version beside it.
  • `morocco-communes`: the dataset as an npm package, in packages/morocco-communes/. Codes, names, parents and population as ES modules with types, one per level, and without the OpenStreetMap fields, so it carries no ODbL terms. pnpm npm:build builds it from data/v1, and the package takes the dataset's version number.
  • `morocco-communes` on PyPI: the same dataset for analysts, in packages/morocco-communes-py/. The units, both censuses, the establishments and the crosswalk, each table a pandas DataFrame, or a list of dicts with as_frame=False, which needs nothing but the standard library. pnpm py:build builds its data from data/v1, gzipped, and it takes the dataset's version too.

The docs site

site/ is an Astro site in English, French and Arabic, with a light and dark theme and a control to pick either or follow the system. It builds to static HTML: the home page, the standout figures, the compare page, the douars, 11 docs pages (the API reference, the MCP setup, the components, the npm package, the Python package, the downloads, the census figures, a glossary, how the standout figures are picked, how douars are named, and what the site counts), and a page for every région, province and commune, 4,845 pages in all.

The home page opens on a map of every commune, shaded by density, change since 2014, or urban and rural. Hovering one shows its figures and clicking opens its page. A commune's page has its figures and rank, a map of its province, the communes it borders, where its change sits among all of them, and its census figures: an age pyramid of men and women, headline rates beside the women's and the country's, and the languages its people use. A list of every commune filters as you type, in French or Arabic.

Its JavaScript is the map's hover and switch, the list's filter, the playground (a Solid island that queries whatever API it's deployed beside and shows the X-Api-Tier of each response), the picker on the components page, and the copy buttons.

Everything on it that describes the data or the API is generated at build time, by the scripts under site/scripts/:

  • map.ts draws the home map from the TopoJSON the API serves. Each shared border is one arc, simplified once for both of its communes, so the fills meet without slivers. Its colours were checked for contrast and colour-blind separation in both themes.
  • hierarchy.ts builds the code ladder, a real chain from région down to arrondissement.
  • charts.ts computes population change per région, the distribution of commune sizes, how little land half the population lives on, how many communes lost people, and the growth spread of the 207 crosswalked communes against the 1,286 whose code never changed. That last one is the reconciliation checking itself: the two distributions sit almost on top of each other.
  • downloads.ts lists the files under data/v1 with their real sizes, and fails the build on a file that isn't there.
  • reference.ts builds the API reference from buildOpenApi, with each example a real response from the emitted files or the Worker's own functions, and lists the MCP tools by connecting a client to the server. The French and Arabic pages read a translation of each line of the spec, and the build fails when one is missing or left over.

The région, province and commune pages are built from site/src/lib/places.ts, which reads data/v1 once per build: ranks, the communes each one borders, matched on shared boundary points, and small maps drawn the same way as the home map.

The charts are inline SVG and CSS, so they need no JavaScript and no charting library.

The Arabic pages are under /ar/ and read right to left. They lead with each unit's Arabic name and set HCP's Latin spelling beside it, and write numbers the wa

Only the beginning is shown; read the rest in the repo