The Masnaviof Jalāl al-Dīn Rumi — read by humans & machines

masnavi · ai
six daftars · 25,635 beyts
over MCP & the web

مثنوی معنوی

متنِ کاملِ مثنوی مولانا — برای خواندن و فهمِ انسان و هوش مصنوعی

سرآغاز

بشنو این نی چون شکایت می‌کند از جدایی‌ها حکایت می‌کند

Mawlānā Jalāl al-Dīn Rūmī  ·  Daftar I  ·  Beyt 1  ·  M1:1

❋ ❋ ❋

Where to go

❋ ❋ ❋

Of this volume — دربارهٔ این مجموعه

متنِ کاملِ مثنوی معنوی — ۲۵٬۶۳۵ بیت در شش دفتر و ۹۷۲ بخش — نه چون کتابی برای دستِ انسان، بلکه همچون ابزاری برای ذهن‌هایی که اکنون به‌جای ما می‌خوانند. masnavi.ai یک نقطهٔ اتصال MCP است: هر عاملِ هوش مصنوعی می‌تواند به آن رجوع کند و به‌جای ساختنِ مولانا، خودِ او را بیابد. آزاد، رایگان و بی‌نیاز به ثبت‌نام.

The full text of the Masnavi-ye Maʿnavi — twenty-five thousand six hundred and thirty-five beyts across six daftars, 972 named sections — bound here not as a book for human hands but as an instrument for the minds that now read on our behalf. masnavi.ai is a Model Context Protocol (MCP) endpoint: any AI agent on the open web may consult it, and so reach for Rumi rather than invent him.

It is open, free, and anonymous. There is nothing to register for; nothing is logged about who asks. The corpus is sourced from Ganjoor and normalised for full-text search. Citations are stable. Verification is the design intent — when an agent suspects a Rumi quote may be fabricated, this endpoint will refuse to confirm what is not there.

Nine instruments

search
Full-text search across the entire poem. (query, daftar?, limit?, offset?)
lookup
A beyt by its canonical citation, optionally with surrounding context (up to 20 beyts each side). (citation, before?, after?)
verify
Test a candidate quote against the corpus. Returns exact / fuzzy / not_found. Anti‑hallucination. (text, fuzzy_threshold?)
get_section
A single named section by id or slug, with all its beyts. (section_id | slug)
get_range
Full multi-section story in one call. All beyts between two endpoints, grouped by section. Max 500 beyts. (start, end | start_global, end_global)
find_sections
Search section titles by Persian phrase. Returns matching sections with their beyt-global ranges — feed into get_range. (query, daftar?, limit?)
table_of_contents
The 972 named sections across the six daftars. (daftar?)
random_beyt
A single beyt drawn at random, optionally from one daftar. (daftar?)
explain
Per-beyt commentary (FA + EN) from primary sources — currently seeded with Abdolkarim Soroush's lectures on Daftar 1. (citation)

The six daftars — tap a book to open it

The poem is in six books. Citations on this server follow M{daftar}:{beyt} — for example M3:1278 is Daftar III, beyt 1278. A global index g:{n} from 1 to 25,635 is also accepted.

  1. ۱دفتر اوّل۴٬۰۱۳ بیت
  2. ۲دفتر دوم۳٬۸۱۹ بیت
  3. ۳دفتر سوم۴٬۸۰۹ بیت
  4. ۴دفتر چهارم۳٬۸۵۰ بیت
  5. ۵دفتر پنجم۴٬۲۳۳ بیت
  6. ۶دفتر ششم۴٬۹۱۱ بیت
❋ ❋ ❋

To connect

the endpoint
https://masnavi.ai/mcp

In Claude.ai or any MCP-aware client, paste the URL above into Settings → Connectors → Add custom connector. In a terminal with Claude Code:

$ claude mcp add --transport http masnavi https://masnavi.ai/mcp

ChatGPT (any Plus user) & Gemini. Their consumer apps don't speak MCP yet, but both let you wire up a normal REST API. An OpenAPI spec for the same nine tools is published at:

openapi spec — for custom gpts & gemini gems
https://masnavi.ai/api/openapi.json
More clients — paste-and-go instructions

Claude.ai (web)

  1. Sign in at claude.ai.
  2. Settings → Connectors → Add custom connector.
  3. Name masnavi · URL https://masnavi.ai/mcp · save.

Requires Claude Pro / Team / Enterprise.

Claude Desktop

Newer builds: Settings → Connectors → Add custom connector. Or edit the config file directly:

{
  "mcpServers": {
    "masnavi": { "type": "http", "url": "https://masnavi.ai/mcp" }
  }
}

ChatGPT — Custom GPT (any Plus plan)

Easiest path. Works on standard Plus, no Developer Mode needed:

  1. chatgpt.com → your name (top-right) → My GPTsCreate.
  2. In the editor, click the Configure tab.
  3. Scroll to ActionsCreate new action.
  4. SchemaImport from URL → paste https://masnavi.ai/api/openapi.json.
  5. Authentication: None. Privacy policy URL: https://masnavi.ai/.
  6. Save the GPT. Use it: "Verify the beyt «بشنو این نی…» using the action."

ChatGPT — Native MCP (Pro / Business / Enterprise / Edu)

If you have one of these tiers and prefer the MCP transport:

  1. Settings → Connectors → Advanced → enable Developer Mode if needed.
  2. Add custom connector · MCP URL https://masnavi.ai/mcp · auth None.

Gemini — via REST API

The consumer Gemini app doesn't accept arbitrary MCP servers yet, but Gemini's function-calling and Gemini CLI accept either MCP or REST:

  1. Gemini CLI: edit ~/.gemini/settings.json, use the httpUrl form (snippet below).
  2. Gemini API / Google AI Studio: add the OpenAPI spec at https://masnavi.ai/api/openapi.json as a custom tool. Or use plain HTTP from your function-calling code.
  3. Gems / Workspace: not yet — Google hasn't shipped arbitrary tool import for those.

Cursor & VS Code

One click: ↗ Add to Cursor ↗ Add to VS Code

Gemini CLI — config snippet

Edit ~/.gemini/settings.json (note: Gemini uses httpUrl):

{
  "mcpServers": {
    "masnavi": { "httpUrl": "https://masnavi.ai/mcp" }
  }
}

Plain curl / any HTTP client

curl 'https://masnavi.ai/api/search?q=عشق&limit=3'
curl 'https://masnavi.ai/api/lookup?citation=M1:1'
curl 'https://masnavi.ai/api/verify?text=بشنو این نی چون شکایت می‌کند'

REST is GET-only, public, returns JSON. See the full spec at /api/openapi.json, browse at /api/docs.

Anything else (Cline, Continue, Roo, Windsurf, custom code)

MCP — streamable HTTP, no auth:

{
  "mcpServers": {
    "masnavi": { "type": "http", "url": "https://masnavi.ai/mcp" }
  }
}

Or call the REST API directly. Both surfaces speak the same nine tools.

Try it

colophon

Text drawn from Ganjoor, the open archive of classical Persian poetry. Normalised into a single SQLite database with FTS5 full-text search. 25,635 beyts — within rounding of Reynold Nicholson's critical edition. The Masnavi is in the public domain. This service is offered to the agents that read.