Skip to main content
Glama
README.md
# Metaverse Rang Official MCP Server (`Metaverse-Rang-MCP`)

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![Node.js](https://img.shields.io/badge/Node.js-22%20LTS-green.svg)](https://nodejs.org/)
[![Protocol](https://img.shields.io/badge/MCP-Streamable%20HTTP-purple.svg)](https://modelcontextprotocol.io/)
[![Access](https://img.shields.io/badge/Mode-Read--Only-orange.svg)](#security--rate-limiting)

---

## 🇬🇧 English Documentation

### Overview
**Metaverse-Rang-MCP** is the official remote **Model Context Protocol (MCP)** server for the **Metaverse Rang (MetaRang)** ecosystem, deployed at `https://mcp.metarang.com/mcp`.

It enables external developers, AI agents, and general users (via **Cursor**, **Claude**, **Gemini CLI**, **VS Code**, and any MCP-compatible client) to natively discover, query, and interact with MetaRang’s knowledge base, core APIs, spatial map, 3D assets, open-source repositories, news/educational videos, and verified tokenomics in a strictly **Read-Only** mode.

### Key Architecture & Standards
- **Transport:** Streamable HTTP (`POST/GET/DELETE /mcp`)
- **Language & SDK:** TypeScript (Node.js 22 LTS) + `@modelcontextprotocol/sdk`
- **Access Mode:** Strictly **Read-Only** (`GET`-only upstream requests)
- **Authentication:** Time Tunnel SSO (`accounts.irpsc.com`) for full authenticated interaction
- **Rate Limiting:** `60 requests / minute` per IP / authenticated subject
- **MCP Primitives:** Tools, Resources (`metarang://docs/...`), and Prebuilt Prompts

### Integrated Data Sources
| Source | Domain / Endpoint | Purpose |
| :--- | :--- | :--- |
| **Main Portal & Media** | `metarang.com` / `metarang.com/fa` | Ecosystem overview, news, articles, and educational videos |
| **Knowledge Base** | `faqhub.ir` | Structured FAQs and user guides |
| **Core API** | `api.metarang.com` | Public ecosystem stats, status, and read-only endpoints |
| **Spatial Map** | `map.metarang.com` | Regions, parcels, and GIS metadata |
| **3D Assets** | `model3d.ir` | 3D models catalog and metadata |
| **Open Source** | `github.com/iranpsc` | All MetaRang open-source repositories and releases |
| **Tokenomics** | `src/data/tokenomics.json` | Audited PSC (20M), PSD (2B), and 13-level citizenship specs |

### Directory Structure
```text
Metaverse-Rang-MCP/
├── .github/
│   ├── ISSUE_TEMPLATE/         # Standardized Epic, Sub-Issue, and Bug forms
│   ├── workflows/              # Automated CI/CD (Lint, Typecheck, Test, Docker)
│   └── pull_request_template.md
├── scripts/                    # Helper scripts (e.g., GitHub labels setup)
├── src/
│   ├── core/                   # Express server, Streamable HTTP transport, config
│   ├── data/                   # Audited static schemas (tokenomics.json)
│   ├── middleware/             # Time Tunnel SSO auth, 60 req/min rate limiter
│   ├── prompts/                # Prebuilt MCP Prompts
│   ├── resources/              # Static & dynamic MCP Resources (metarang://)
│   ├── tools/                  # Modular Read-Only MCP Tools
│   └── index.ts                # Application entry point
├── tests/                      # Vitest unit & integration tests
├── Dockerfile                  # Multi-stage production container
├── docker-compose.yml          # Self-hosted deployment config
└── package.json
```

### Quick Start (Local Development)
```bash
npm install
cp .env.example .env
npm run dev
```

Test locally with the official MCP Inspector:
```bash
npx @modelcontextprotocol/inspector
```
Set transport to **Streamable HTTP** and URL to `http://localhost:3000/mcp`.

### Client Connection Examples (Production)
**Gemini CLI:**
```bash
gemini mcp add --transport http --scope user metarang https://mcp.metarang.com/mcp
```

**Cursor (`~/.cursor/mcp.json`):**
```json
{
  "mcpServers": {
    "metarang": {
      "url": "https://mcp.metarang.com/mcp"
    }
  }
}
```

---

## 🇮🇷 مستندات فارسی

### معرفی پروژه
مخزن **Metaverse-Rang-MCP** سرور رسمی **Model Context Protocol (MCP)** اکوسیستم **متاورس رنگ (متارنگ)** است که روی آدرس `https://mcp.metarang.com/mcp` میزبانی می‌شود.

این سرویس به عموم کاربران، توسعه‌دهندگان بیرونی و ابزارهای هوش مصنوعی (مانند Cursor، Claude، Gemini CLI و VS Code) اجازه می‌دهد به صورت کاملاً **فقط‌خواندنی (Read-Only)** به پایگاه دانش (`faqhub.ir`)، اخبار و ویدیوهای آموزشی (`metarang.com/fa`)، هسته `api.metarang.com`، نقشه (`map.metarang.com`)، مدل‌های سه‌بعدی (`model3d.ir`)، مخازن متن‌باز `github.com/iranpsc` و اطلاعات دقیق توکنومیکس دسترسی داشته باشند.

### استانداردهای فنی و امنیتی
- **پروتکل ارتباطی:** Streamable HTTP روی مسیر `/mcp`
- **احراز هویت:** متصل به سامانه تونل زمان (`accounts.irpsc.com`)
- **محدودیت نرخ درخواست (Rate Limit):** حداکثر **۶۰ درخواست در دقیقه** به ازای هر IP/کاربر
- **لایسنس:** `GNU AGPL-3.0`
- **ساختار مشارکت:** تمامی وظایف از طریق قالب‌های استاندارد Issue (Epic و Sub-Issue) ثبت، پیاده‌سازی و به صورت مستقل تست می‌شوند.

برای جزئیات مشارکت، فایل [CONTRIBUTING.md](./CONTRIBUTING.md) و برای سیاست‌های امنیتی، فایل [SECURITY.md](./SECURITY.md) را مطالعه کنید.