Skip to main content
Glama
@marocain/mcp-server

@marocain/mcp-server

by Hei33enberg

@marocain/mcp-server

npm ci license node Glama MCP Smithery MCP

The official Model Context Protocol server for marocain.investments — bringing {GIN}, our authored real-estate intelligence for Morocco, into any MCP client (Claude Desktop, IDEs, agents).

Discover, score and analyse Moroccan luxury real estate — then submit an enquiry that's routed on-platform. All the analysis is free; contact with the agent is always intermediated by the platform.

What is {GIN}?

{GIN} is the platform's proprietary scoring DNA. Instead of one blurry "AI score", it speaks with two coherent pillars fused into one honest verdict:

  • {GIN} Quality — how good the asset is (vision view/structural/condition + location + yield + WC 2030 catalyst + trust).

  • {GIN} Deal — how good the buy is (asking price vs. the M-Value AVM, adjusted for city momentum).

  • Fused verdict — one buy/hold/pass headline that can never disagree with the numbers ("Prime asset, priced to buy", "Cheap — verify condition", …).

It's the difference between a good property and a good deal — the question generic scores never answer. It's honest by design: an overpriced listing is told it's overpriced.

Related MCP server: Israel Real Estate MCP

Install

No install needed — run it straight from npm:

npx -y @marocain/mcp-server

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "marocain": {
      "command": "npx",
      "args": ["-y", "@marocain/mcp-server"]
    }
  }
}

Tools

Fourteen tools — eleven read-only analysis tools (sale and rental), a moat-safe enquiry tool, and two commerce tools (discover + order paid services).

Analyse — sales (free)

Tool

What it does

search_listings

Search AI-graded Moroccan for-sale listings by city, typology, price, rooms, free-text.

get_listing

Full detail for one listing — price (USD/MAD), AI scores, M-Value AVM, trust, {GIN} pillars + verdict.

get_gin_score

The {GIN} verdict: Quality + Deal pillars + the fused buy/hold/pass headline.

get_market

Macro market facts for a city or national scope (median price, supply, momentum, WC 2030 / TGV catalysts).

listing_derive

AI-derived one-paragraph investment memo for a listing (6 languages).

semantic_search

Conceptual / vector search across the catalogue and the authored guides (Foreign Buyer's Playbook, Morocco-vs-Dubai, AI-scoring methodology, residency, city theses).

gin_ask

Ask T{AI]GIN, the agentic investment analyst, a one-shot question — it plans, searches, scores with the {GIN} pillars and answers with citations.

gin_deal_memo

A structured, honest investor deal memo for one listing (verdict, M-Value, yield, strengths, risks, district read, next steps).

Analyse — rentals (free)

Tool

What it does

search_rentals

Search AI-graded Moroccan long-let rentals (residential / commercial / student) by city, typology, monthly-rent band (MAD or USD) and tier. Rent in MAD/month; never returns landlord/agency contact.

rent_affordability

How much monthly rent a net income comfortably supports — the same rent ≤ 33% of net income rule as /finance. Income in MAD or USD.

rent_vs_buy

Compare the monthly cost of buying vs renting a property — same mortgage annuity engine as /finance (30% down · 20y · 5.2% defaults, all overridable). Principal + interest only.

Enquire & transact

Tool

What it does

request_service

Submit a buyer enquiry / request a viewing — routed on-platform to the listing's verified agent. Returns a reference, never any contact.

list_services

The transactable service catalogue + EUR prices — buyer services (AI staging, viral content, reservation, appraiser, visitation — note the live API product_type id is spelled visaitation — the €199 AI business plan, lawyer / financing / commercialization) and agent services (listing boost, photo relight).

order_service

Order any service. Instant products return a Stripe checkout_url (pay on-platform); request-only products return a tracked order_id. Never returns contact.

Payments: card checkout for instant products may be briefly unavailable while the platform reconnects its payment processor — request-based services and buyer enquiries work regardless. order_service reports this cleanly.

Discover → analyse → enquire

The model is simple and the same for everyone: all the intelligence is free (it's lead-gen), and the only way to make contact is through the platform (that's the moat, and how agents are billed).

  1. Discover & score with search_listings / get_gin_score / semantic_search.

  2. Go deep with get_listing / gin_deal_memo / gin_ask.

  3. Enquire with request_service — it routes the buyer's interest to the listing's verified agent and returns a reference. You never receive the agent's phone, email or WhatsApp; the platform intermediates contact.

Most of the catalogue is still being onboarded by agents. request_service routes to a listing's claimed, verified agent; for a listing without one yet it returns a clear note instead of routing.

Example response shapes

get_gin_score({ id }) → the authored verdict:

{
  "id": "…",
  "title": "…",
  "price_usd": 9630000,
  "gin_verdict": { "key": "prime_value", "label": "Prime asset, priced to buy", "tone": "strong" },
  "gin_quality": 76,
  "gin_deal": 64,
  "m_value_usd": 9100000,
  "trust": { "title_verified": false, "fcr_status": "unknown" }
}

request_service({ listing_id, buyer_name, buyer_email, message }) → an on-platform reference, no contact:

{ "ok": true, "kind": "lead", "lead_id": "…", "status": "requested", "routed": true }

Moat-safe by design

No tool ever returns an agent's, landlord's or seller's contact. On top of the public API hiding the phone, this server redacts the origin-portal deep link (source_url / source_listing_id) and the agent / agency name from listing payloads — so a downstream agent can't route a user off-platform to the seller. Rentals (search_rentals) are read through the site's public, anon-granted rental_browse RPC, which is SECURITY DEFINER, scrubs PII in SQL and whose return signature carries no contact / source fields at all; the result still passes through the same central stripMoat() as every other tool. The single conversion path is request_service, which routes a buyer enquiry through marocain's own lead flow and returns a reference, never any contact. Discover, score and analyse freely; contact is always intermediated by the platform.

Troubleshooting

Symptom

Cause

Fix

request timed out after 30000ms

Upstream slow or unreachable.

Retry. Bump MAROCAIN_TIMEOUT_MS if your network is high-latency.

The Marocain API returned an error (403)

Rare — Vercel platform-level anti-bot on very bursty traffic.

Back off and retry.

valid buyer_email required (from request_service)

A buyer name + valid email are mandatory so the agent can reply.

Supply both.

listing_unclaimed (from request_service)

The listing has no claimed agent yet, so the enquiry can't be routed.

Try a claimed/verified listing; check back as agents onboard.

ignoring disallowed MAROCAIN_API_BASE

You set MAROCAIN_API_BASE to a non-HTTPS or non-allowlisted host.

Leave it unset (the default is correct).

Configuration

Env var

Default

Purpose

MAROCAIN_API_BASE

https://marocain.investments

Override the API origin (testing only; must be HTTPS + allowlisted).

MAROCAIN_TIMEOUT_MS

30000

Per-request upstream timeout.

  • Skills catalog: @hei33enberg/luxury-skills (npm) — the machine-readable capability catalog this server draws from.

  • Live API: https://marocain.investments/api/public/* · AEO manifest: /llms.txt.

Releasing

Publishing to npm is automated by a GitHub Action (publish-mcp) in the platform repo:

# bump the version, commit, push — the Action publishes @marocain/mcp-server
npm version patch        # or minor / major  (edits package.json)
git push --follow-tags

Local npm test runs the unit tests (CI runs them on Node 18/20/22); CI additionally runs the black-box MCP handshake smoke (node test/smoke.mjs) on Node 20.

License

MIT © marocain.investments

Available Tools

14 tools
get_gin_scoreB

The {GIN} coherent verdict for a listing: the Quality pillar (asset, compute_marocain_score), the Deal pillar (price-vs-AVM + momentum) and the one fused buy/hold/pass verdict. The authored number an investor can defend.

Inputs: id (required).

get_listingA

Full detail for one listing by id: price (USD/MAD), AI scores, M-Value AVM, FCR/title trust, source provenance and the {GIN} pillars + verdict. Never returns the agent's phone.

Inputs: id (required).

get_marketA

Macro market facts for a city or national scope — median price, supply, momentum and the catalysts (WC2030, TGV) the {GIN} Deal pillar is benchmarked against.

Inputs: scope (required).

gin_askA

Ask T{AI]GIN — the {GIN} agentic investment analyst — a one-shot natural-language question. It plans, searches the catalogue + authored guides, scores with the {GIN} pillars and answers grounded with citations. Use for open questions ('which Tangier district has the best rental upside?', 'why Morocco over Dubai?'). Never returns agent contact details.

Inputs: q (required).

gin_deal_memoA

Generate a structured investor DEAL MEMO for one listing id: the {GIN} Quality + Deal verdict, M-Value AVM with value-vs-ask, gross yield, strengths, risks, district read and next steps. Honest (won't soften an overpriced verdict). Decision support, not a certified appraisal.

Inputs: listing_id (required).

listing_deriveB

AI-derived investor narrative for a listing — a one-paragraph thesis synthesising the {GIN} pillars, financial vision and location into a single decision memo.

Inputs: listing_id (required), lang.

list_servicesA

List the platform's transactable services + EUR prices — for BUYERS (AI staging, viral content, refundable reservation, bank-honored appraiser, on-site visitation, the €199 AI business-model plan, plus request-only lawyer / financing / bespoke commercialization) and for AGENTS/sellers (listing boost, photo relight). Returns each product_type + its variant ids + price, which order_service needs. NOTE: card checkout for instant products may be temporarily unavailable while the payment processor is being reconnected; request-based services and buyer enquiries work regardless.

Inputs: no named parameters.

order_serviceA

Place an order for any platform service (a product_type + variant from list_services). Instant products return a Stripe checkout_url to complete payment on-platform; request-only products (lawyer, financing, commercialization, contact) return a tracked order_id with no upfront charge. Requires the buyer's email. NEVER returns agent/seller contact. For a plain buyer enquiry to a listing's agent, prefer request_service.

Inputs: variant (required), buyer_email (required), product_type (required), message, +3 more.

rent_affordabilityA

How much monthly rent a given net income comfortably supports. Uses the SAME rule-of-thumb as marocain.investments/finance (rent ≤ 33% of net monthly income) so the answer never disagrees with the website. Give income in MAD (net_monthly_income_mad) or USD (net_monthly_income_usd). Returns the comfortable rent ceiling in MAD and USD.

Inputs: net_monthly_income_mad, net_monthly_income_usd.

rent_vs_buyA

Compare the monthly cost of BUYING a property vs RENTING it. Uses the SAME mortgage engine as marocain.investments/finance (standard annuity payment on the loan after down payment) — principal + interest only, excluding insurance/fees/taxes/maintenance/appreciation. Defaults mirror the site: 30% down, 20-year term, 5.2% rate. Returns the monthly buy payment, the rent, and the monthly difference (buy − rent).

Inputs: price_mad (required), monthly_rent_mad (required), down_pct, term_years, +1 more.

request_serviceA

Submit a buyer ENQUIRY (or request a viewing / valuation / financing / renovation / legal help) for a listing. This is the ONLY conversion path: it routes the enquiry through marocain.investments to the listing's verified agent and returns a confirmation reference — it NEVER returns the agent's contact (the platform intermediates all contact). Works for listings that have a claimed, verified agent; for not-yet-claimed scraped listings it returns a clear note instead of routing. Requires the buyer's name + email so the agent can follow up.

Inputs: buyer_name (required), listing_id (required), buyer_email (required), message, +2 more.

search_listingsA

Search AI-graded Moroccan luxury listings by city, typology, price, rooms and a free-text query. Returns structured listings with prices and {GIN} scores. Never returns agent contact details.

Inputs: q, city, limit, typology, +3 more.

search_rentalsA

Search AI-graded Moroccan long-let RENTAL listings (residential / commercial / student) by city, typology, monthly rent band and tier. Rent is in MAD/month (rent_usd_month provided too). Returns structured rentals with {GIN} scores. Calls the same public, PII-scrubbed rental surface the website uses — NEVER returns landlord/agency contact. Note: unlike sale search there is no server-side rooms or free-text filter on the public rental surface (rooms is returned per listing); filter by city / typology / rent band / tier.

Inputs: city, sort, tier, limit, +6 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 14 tools

    Disambiguation4/5

    Tools are mostly distinct: search vs. get vs. generate vs. service actions are clear. The main potential confusion is among the listing-centric tools (get_listing, get_gin_score, gin_deal_memo, listing_derive) which all operate on a single listing but produce different outputs. Descriptions do clarify the differences, but an agent might still hesitate when choosing between them.

    Naming Consistency4/5

    Names mostly follow verb_noun pattern (search_listings, get_listing, list_services), but a few like listing_derive, gin_ask, gin_deal_memo break the pattern with noun_verb. Still, all names are descriptive and use a consistent snake_case style, so the deviation is minor.

    Tool Count5/5

    14 tools is within the ideal range (3-15). Each tool covers a distinct aspect of the real estate investment workflow: search, detail, score, memo, market data, services, and financial calculators. No tool feels redundant.

    Completeness5/5

    The surface covers the full investor journey: discover (search), evaluate (get_listing, get_gin_score, gin_deal_memo, listing_derive), understand market (get_market), calculate (rent_affordability, rent_vs_buy), and act (request_service, order_service, list_services). Also includes semantic search and an agentic Q&A. No obvious gaps for the stated purpose.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for accessing the Fotocasa1 API to search real estate listings and retrieve detailed property information in Spain. It supports location suggestions, property filtering by type and price, and fetching specific property details.
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for querying Israeli government real estate data, enabling property deal searches, market trend analysis, and address retrieval.
      4
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      MCP server for the Stream.estate French real estate API. Search properties, get market statistics, manage saved searches with webhook notifications.
      13
      43 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for generating PDF reports on real estate properties. Supports location analysis, market reports, and project summaries.
      Mozilla Public 2.0