loading…
Search for a command to run...
loading…
Provides unified access to Moroccan government data, financial markets, geographic information, and more via natural language queries.
Provides unified access to Moroccan government data, financial markets, geographic information, and more via natural language queries.
A comprehensive Model Context Protocol (MCP) server providing unified access to Moroccan government data sources, financial markets, geographic information, and more.
Bank Al-Maghrib (Central Bank)
Casablanca Stock Exchange (BVC)
cd "MoroccoOpenData MCP"
npm install
npm run build
cp .env.example .env
# Edit .env and add your API keys
npm test
# Development mode (with hot reload)
npm run dev
# Production mode
npm start
npm install -g morocco-open-data-mcp
git clone https://github.com/kcbdev/morocco-open-data-mcp.git
cd morocco-open-data-mcp
npm install
npm run build
# Build the image
docker build -t morocco-open-data-mcp .
# Run the container
docker run -d \
--name morocco-mcp \
-e MCP_TRANSPORT=http \
-e MCP_PORT=3000 \
-e BAM_KEY_CHANGES=your_key \
morocco-open-data-mcp
# Create .env file with your API keys
cp .env.example .env
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT |
Transport mode: stdio or http |
auto |
MCP_PORT |
HTTP server port (when using HTTP transport) | 3000 |
MCP_HOST |
HTTP server host | 0.0.0.0 |
BAM_KEY_CHANGES |
Bank Al-Maghrib API key for exchange rates | Required for BAM data |
BAM_KEY_OBLIGATIONS |
BAM API key for government obligations | Required for obligations |
BAM_KEY_TBILLS |
BAM API key for treasury bills | Required for T-bills |
WORLD_BANK_API_KEY |
World Bank API key | Optional (some endpoints) |
ACLED_API_KEY |
ACLED API key for crisis data | Optional |
OPENWEATHER_API_KEY |
OpenWeatherMap API key | Optional |
CACHE_TTL_DEFAULT |
Default cache TTL (seconds) | 3600 |
CACHE_TTL_SHORT |
Short-term cache TTL (seconds) | 300 |
CACHE_TTL_LONG |
Long-term cache TTL (seconds) | 86400 |
RATE_LIMIT_DEFAULT |
Default rate limit (req/min) | 60 |
RATE_LIMIT_STRICT |
Strict rate limit (req/min) | 10 |
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"morocco-open-data": {
"command": "node",
"args": ["/home/kcb/Work/LABS/MOPD/MoroccoOpenData MCP/dist/index.js"],
"env": {
"BAM_KEY_CHANGES": "your_key_here",
"BAM_KEY_OBLIGATIONS": "your_key_here",
"BAM_KEY_TBILLS": "your_key_here"
}
}
}
}
{
"mcpServers": {
"morocco-open-data": {
"url": "https://morocco-opendata-mcp.kcb.ma",
"transportType": "sse"
}
}
}
{
"mcpServers": {
"morocco-open-data": {
"command": "npx",
"args": ["-y", "mcp-remote@latest"],
"env": {
"MCP_SERVER_URL": "https://morocco-opendata-mcp.kcb.ma/sse"
}
}
}
}
| Tool | Description |
|---|---|
search_datasets |
Search for datasets on Morocco's open data portal |
get_dataset |
Get detailed information about a specific dataset |
list_organizations |
List all data-publishing organizations |
search_by_tag |
Search datasets by tag |
| Tool | Description |
|---|---|
get_exchange_rates |
Get current exchange rates from Bank Al-Maghrib |
get_interest_rates |
Get key interest rates and monetary policy rates |
get_inflation_data |
Get inflation and CPI data |
get_money_supply |
Get money supply aggregates (M1, M2, M3) |
get_treasury_bills |
Get treasury bills auction results |
get_world_bank_indicators |
Get World Bank development indicators |
get_morocco_economic_summary |
Get comprehensive economic summary |
| Tool | Description |
|---|---|
get_stock_quotes |
Get stock quotes from Casablanca Stock Exchange |
get_market_summary |
Get today's market summary |
get_market_indices |
Get market indices (MASI, MASIX, etc.) |
get_bond_quotes |
Get government and corporate bond quotes |
get_company_info |
Get detailed company information |
| Tool | Description |
|---|---|
get_morocco_regions |
Get all administrative regions of Morocco |
get_city_coordinates |
Get coordinates for Moroccan cities |
search_cities |
Search for cities by name or region |
| Tool | Description |
|---|---|
get_prayer_times |
Get prayer times for a specific date |
get_weekly_prayer_times |
Get prayer times for the next 7 days |
get_next_prayer |
Get the next upcoming prayer time |
list_prayer_cities |
List all available Moroccan cities |
| Tool | Description |
|---|---|
get_humanitarian_datasets |
Search humanitarian datasets from HDX |
| Tool | Description |
|---|---|
get_climate_data |
Get climate and weather data |
get_environmental_indicators |
Get environmental indicators (CO2, renewable energy, etc.) |
| Tool | Description |
|---|---|
search_knowledge_graph |
Search the Morocco knowledge graph |
get_data_sources |
Get list of all available data sources |
Search for datasets about Morocco's economy on data.gov.ma
What's the current exchange rate for EUR to MAD?
Show me all exchange rates from Bank Al-Maghrib
Get me the current stock price for Attijariwafa Bank
Show me today's market summary from Casablanca Stock Exchange
What are the top gainers today?
What are the prayer times for today in Marrakech?
When is the next prayer in Rabat?
Show me the weekly prayer schedule for Casablanca
Get Morocco's GDP growth rate for the last 5 years
Show me the current inflation rate
What's the unemployment rate in Morocco?
List all regions of Morocco with their capitals
What are the coordinates of Fes?
Search for cities in the Souss-Massa region
| Source | Type | Status |
|---|---|---|
| data.gov.ma | CKAN API | ✅ Active |
| Bank Al-Maghrib | REST API | ✅ Active |
| Casablanca Stock Exchange | REST API | ✅ Active |
| World Bank | REST API | ✅ Active |
| Aladhan (Prayer Times) | REST API | ✅ Active |
| Source | Type | Status |
|---|---|---|
| HCP (High Commission for Planning) | Portal | 🔄 Pending |
| Ministry of Economy & Finance | Portal | 🔄 Pending |
| Ministry of Health | Portal | 🔄 Pending |
| Source | Type | Status |
|---|---|---|
| Humanitarian Data Exchange | API | 🔄 Pending |
| ACLED (Crisis Data) | API | 🔄 Pending |
| OpenWeatherMap | API | 🔄 Pending |
docker build -t morocco-open-data-mcp:latest --target production .
docker run -d \
--name morocco-mcp \
--restart unless-stopped \
-e NODE_ENV=production \
-e MCP_TRANSPORT=http \
-e MCP_PORT=3000 \
-e BAM_KEY_CHANGES=your_key \
-e BAM_KEY_OBLIGATIONS=your_key \
-e BAM_KEY_TBILLS=your_key \
-e CACHE_TTL_DEFAULT=3600 \
-e RATE_LIMIT_DEFAULT=60 \
morocco-open-data-mcp:latest
docker logs -f morocco-mcp
docker stats morocco-mcp
For deployment on Coolify (https://coolify.kcb.ma):
MCP_TRANSPORT=http
MCP_PORT=3000
MCP_HOST=0.0.0.0
NODE_ENV=production
BAM_KEY_CHANGES=your_key
BAM_KEY_OBLIGATIONS=your_key
BAM_KEY_TBILLS=your_key
apiVersion: apps/v1
kind: Deployment
metadata:
name: morocco-mcp
spec:
replicas: 3
selector:
matchLabels:
app: morocco-mcp
template:
metadata:
labels:
app: morocco-mcp
spec:
containers:
- name: mcp-server
image: ghcr.io/kcbdev/morocco-open-data-mcp:latest
env:
- name: NODE_ENV
value: "production"
- name: MCP_TRANSPORT
value: "http"
- name: BAM_KEY_CHANGES
valueFrom:
secretKeyRef:
name: mcp-secrets
key: bam-key-changes
resources:
limits:
cpu: "1"
memory: "512Mi"
requests:
cpu: "250m"
memory: "128Mi"
morocco-open-data-mcp/
├── src/
│ ├── clients/ # API clients for each data source
│ │ ├── ckan.ts # data.gov.ma client
│ │ ├── bam.ts # Bank Al-Maghrib client
│ │ ├── worldbank.ts # World Bank client
│ │ ├── bvc.ts # Casablanca Stock Exchange client
│ │ ├── prayer.ts # Prayer times client
│ │ ├── geo.ts # Geography/GIS client
│ │ ├── hdx.ts # Humanitarian Data Exchange client
│ │ └── weather.ts # Weather API client
│ ├── lib/ # Core utilities
│ │ ├── cache.ts # Caching layer
│ │ ├── rateLimiter.ts # Rate limiting
│ │ ├── arabic.ts # Arabic text processing
│ │ └── errors.ts # Error handling
│ ├── sync/ # Data synchronization jobs
│ ├── index.ts # Main server entry point
│ └── test.ts # Test suite
├── package.json
├── tsconfig.json
├── Dockerfile
├── docker-compose.yml
├── claude_desktop_config.json
└── README.md
# Install dependencies
npm install
# Run in development mode with hot reload
npm run dev
# Build for production
npm run build
# Run tests
npm test
# Run sync jobs manually
npm run sync
# Start production server
npm start
# Run all tests
npm test
# Run tests with external APIs disabled
SKIP_EXTERNAL_APIS=true npm test
# Run specific test file
npx tsx src/test.ts
| Service | Purpose | Registration |
|---|---|---|
| ACLED | Crisis/conflict data | ACLED |
| OpenWeatherMap | Weather data | OpenWeatherMap |
| HDX | Humanitarian data | HDX |
# Rebuild the project
rm -rf dist/
npm run build
RATE_LIMIT_DEFAULT in .envdist/index.js is correctMCP_TRANSPORT=http is set in environment variablesEnable verbose logging:
NODE_ENV=development DEBUG=* npm run dev
# Check if server is running (HTTP mode)
curl https://morocco-opendata-mcp.kcb.ma/health
# Check if server is running (local stdio mode)
node -e "console.log('MCP server healthy')"
# The server will log status of all data sources on startup
We welcome contributions! Please follow these guidelines:
git checkout -b feature/your-featurenpm testgit commit -am 'Add new feature'git push origin feature/your-featureThis project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
See the LICENSE file for details.
For commercial licensing inquiries, contact: [email protected]
Built with ❤️ for Morocco's open data community
Morocco Open Data MCP Server v1.0.0
Live Deployment: https://morocco-opendata-mcp.kcb.ma
Source Code: https://github.com/kcbdev/morocco-open-data-mcp
Выполни в терминале:
claude mcp add morocco-open-data-mcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.