tayr.ma

MCP server documentation

tayr.ma — Model Context Protocol (MCP)

POST/GET/DELETE https://tayr.ma/mcp

← Developers · Open Data

What is MCP?

The Model Context Protocol (MCP) is an open standard that lets AI tools like Claude connect directly to real data sources through clearly described tools, instead of manual copy/paste. The tayr.ma MCP server exposes the platform's public environmental and municipal-issue report data as tools any MCP client can call.

How to connect

Claude Code (CLI):

claude mcp add --transport http tayr https://tayr.ma/mcp

Registers the server for your user, available across all your projects.

Custom connector on claude.ai:

  1. Settings → Connectors → Add custom connector
  2. Enter: https://tayr.ma/mcp
  3. Save — public read-only tools work immediately, no API key required

Public tools (read-only)

No authentication needed. All responses are UTF-8 JSON.

list_reportspublic

Lists public reports, optionally filtered by status, category, city, and date range.

ParamTypeRequiredDescription
statusstringnot_yet | pending | in_progress | resolved | rejected | approved
categorystringenvironment | water_electricity | infrastructure | waste | lighting | graffiti | roads | other
citystringPartial match on normalized city or location field
from_date / to_datestringYYYY-MM-DD or ISO
limitnumberMax results (default 20, max 50)
{
  "total": 131,
  "count": 1,
  "reports": [{
    "id": 26, "title": "...", "category": "other", "status": "pending",
    "location": "Smara", "latitude": "26.7384", "longitude": "-11.6874",
    "severity": 1, "upvotes": 0,
    "createdAt": "2026-05-30 01:30:07.764", "resolvedAt": null
  }]
}

get_reportpublic

Full details of a single report by id — reporter phone/email/name are never included.

ParamTypeRequiredDescription
idstring | numberyesReport id
{
  "id": 47, "title": "...", "category": "water_electricity", "status": "pending",
  "location": "Agadir", "description": "...", "address": null,
  "problemType": "maintenance", "mood": "😐", "imageUrl": "/uploads/reports/....webp",
  "timeline": [], "lastUpdate": null, "assignedAuthority": null, "year": 2025
}

get_statspublic

Aggregate stats: totals, by status/category/city, avg resolution time, this week/month.

No parameters.

{
  "total": 131,
  "byStatus": { "pending": 33, "resolved": 22, "rejected": 6, "in_progress": 11, "approved": 17 },
  "byCategory": { "roads": 27, "waste": 23, "lighting": 21, "water_electricity": 20 },
  "byCity": { "Inezgane": 21, "Smara": 19, "Dakhla": 16 },
  "avgResolutionHours": 24, "thisWeek": 0, "thisMonth": 0
}

search_reports_by_locationpublic

Finds reports within a given radius (km) of a lat/lng point, sorted by distance.

ParamTypeRequiredDescription
latnumberyesLatitude
lngnumberyesLongitude
radius_kmnumberDefault 5, max 100
{
  "count": 2,
  "reports": [
    { "id": 67, "title": "...", "location": "Laayoune", "distanceKm": 0 },
    { "id": 86, "title": "...", "location": "Laayoune", "distanceKm": 1.49 }
  ]
}

get_municipality_performancepublic

Per-municipality performance: totals, status breakdown, resolution rate, avg resolution/first-response hours, most common category.

ParamTypeRequiredDescription
citystringPartial match for one city; omit to return all cities
{
  "count": 1,
  "municipalities": [{
    "city": "Smara", "total": 19,
    "byStatus": { "pending": 8, "resolved": 6, "in_progress": 1 },
    "resolutionRatePercent": 31.6,
    "avgResolutionHours": 24, "avgFirstResponseHours": 3.2,
    "mostCommonCategory": "water_electricity"
  }]
}

search_reportspublic

Full-text search across report title and description — case-insensitive, tolerant of common Arabic spelling variants (diacritics, alef/hamza forms, alef maksura, taa marbuta).

ParamTypeRequiredDescription
querystringyesSearch text, at least 2 characters
statusstringFilter by status
categorystringFilter by category
limitnumberDefault 20, max 50
{
  "total": 3,
  "count": 3,
  "reports": [
    { "id": 12, "title": "...", "category": "roads", "status": "pending" }
  ]
}

Write tools

Two protected tools exist for updating a report's status (update_report_status) and adding an official response (add_official_response). They are restricted to authorized partners (municipalities, competent authorities) via a private access key. Contact us for write access.