
Ganjoor MCP Server — the Model Context Protocol server for the Ganjoor Persian poetry API.
It lets an agent browse poets and collections, read poems with their verses, run prosody and rhyme
analysis, trace reply-poems across poets, look up recitations and commentary, and explore the
related-people and family-tree graphs.
44 tools, read-only access. No API key required.
Contents
Install
Requires Node.js 18.17 or newer.
npm install ganjoor-mcp-server # for locally installed stdio transport. no need if using VS Code or Claude Desktop / Cursor.
VS Code
No need install npm package — the MCP server runs in-process and is launched by VS Code when needed.
Just click the badge below to install the Ganjoor MCP server in your VS Code workspace. It will
automatically add the server to your .vscode/mcp.json config.

Or add to .vscode/mcp.json:
{
"servers": {
"io.github.ehsanghaffar/ganjoor-mcp-server": {
"command": "npx",
"args": [
"-y",
"ganjoor-mcp-server"
],
"env": {}
}
}
}
VS Code CLI:
code --add-mcp '{\"name\":\"io.github.ehsanghaffar/ganjoor-mcp-server\",\"command\":\"npx\",\"args\":[\"-y\",\"ganjoor-mcp-server\"],\"env\":{}}'
Claude Desktop / Cursor
Just click the badge below to install the Ganjoor MCP server in your Claude Desktop or Cursor app. It will automatically add the server to your MCP config.

Or add to your MCP config file:
{
"mcpServers": {
"io.github.ehsanghaffar/ganjoor-mcp-server": {
"command": "npx",
"args": [
"-y",
"ganjoor-mcp-server"
],
"env": {},
"type": "local",
"tools": [
"*"
]
}
}
}
Other clients
Claude Code
Use the Claude Code CLI to add the io.github.ehsanghaffar/ganjoor-mcp-server MCP server:
claude mcp add io.github.ehsanghaffar/ganjoor-mcp-server npx -y ganjoor-mcp-server
Claude Desktop
Follow the MCP install guide, use the standard config above.
Codex
Create or edit the configuration file ~/.codex/config.toml and add:
[mcp_servers.ganjoor-mcp-server]
command = "npx"
args = ["-y", "ganjoor-mcp-server"]
For more information, see the Codex MCP documentation.
Gemini CLI
Follow the MCP install guide, use the standard config above.
OpenCode
Follow the MCP Servers documentation. For example in ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"io.github.ehsanghaffar/ganjoor-mcp-server": {
"type": "local",
"command": [
"npx",
"-y",
"ganjoor-mcp-server"
],
"enabled": true
}
}
}
GitHub Copilot CLI
GitHub Copilot CLI supports adding MCP servers interactively and through a config file.
Option 1: Interactive setup with /mcp add
- Open GitHub Copilot CLI in interactive mode.
- Run
/mcp add.
- Enter Server Name:
io.github.ehsanghaffar/ganjoor-mcp-server.
- Choose Server Type:
STDIO for command-based servers
HTTP for remote servers
- Fill in command/url settings from the standard config above and set Tools to
*.
- Press
Ctrl+S to save.
Option 2: Edit ~/.copilot/mcp-config.json
{
"mcpServers": {
"io.github.ehsanghaffar/ganjoor-mcp-server": {
"command": "npx",
"args": [
"-y",
"ganjoor-mcp-server"
],
"env": {},
"type": "local",
"tools": [
"*"
]
}
}
}
For more information, see the GitHub Copilot CLI MCP documentation.
GitHub Copilot Coding Agent
GitHub Copilot Coding Agent can use MCP servers to extend its capabilities. Use the configuration below specifically formatted for the Coding Agent:
{
"mcpServers": {
"ganjoor-mcp-server": {
"command": "npx",
"args": [
"-y",
"ganjoor-mcp-server"
],
"env": {},
"type": "local",
"tools": [
"*"
]
}
}
}
Add this configuration to your repository settings under Copilot > Coding agent. The "tools": ["*"] setting enables all available tools from the MCP server.
For more information, see the GitHub Copilot Coding Agent MCP documentation.
Install from this source
npm install
npm run build
npm start # stdio transport (default)
VS Code
Add to .vscode/mcp.json:
{
"servers": {
"ganjoor": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/index.js"]
}
}
}
Claude Desktop / Cursor
Add to your MCP config file:
{
"mcpServers": {
"ganjoor": {
"command": "node",
"args": ["/absolute/path/to/ganjoor-mcp/dist/index.js"]
}
}
}
Streamable HTTP (remote / shared deployment)
HTTP=true PORT=3000 npm start
The MCP endpoint is POST /mcp, and GET /health reports server and upstream status. The HTTP
transport runs statelessly (a fresh server instance per request), so it scales horizontally. It binds
127.0.0.1 by default and validates the Origin header to block DNS-rebinding attacks; set
ALLOWED_ORIGINS (comma-separated) if you need non-loopback origins.
MCP Inspector
Docker
A multi-stage Dockerfile and a docker-compose.yml are included. The image is built on
node:22-alpine and contains only the compiled output and production dependencies.
docker compose up --build
The compose file starts the server in streamable HTTP mode on http://localhost:3000/mcp, with
GET /health reporting server and upstream status. HOST is set to 0.0.0.0 so the published port
is reachable from the host; every configuration variable from the table below works as an ordinary
environment variable. To run a single container without compose:
docker build -t ganjoor-mcp .
docker run --rm -p 3000:3000 -e HTTP=true -e HOST=0.0.0.0 ganjoor-mcp
stdio transport over Docker
Clients that launch the server themselves (rather than connecting over HTTP) can use the stdio
profile, which opens stdin for the protocol stream and starts no HTTP listener:
docker compose --profile stdio run --rm ganjoor-mcp-stdio
With Claude Desktop
To run the server through Docker instead of a local Node install:
{
"mcpServers": {
"ganjoor": {
"command": "docker",
"args": ["run", "--rm", "-i", "ganjoor-mcp"]
}
}
}
Configuration
All settings are environment variables; none are required.
| Variable | Default | Purpose |
|---|
HTTP | (unset) | Set to true to serve streamable HTTP instead of stdio. |
PORT | 3000 | HTTP port. |
HOST | 127.0.0.1 | HTTP bind address. |
ALLOWED_ORIGINS | (empty) | Extra allowed Origin values, comma-separated. |
GANJOOR_API_BASE_URL | https://api.ganjoor.net | Upstream API base URL — point at a local RMuseum instance for development. |
GANJOOR_SITE_BASE_URL | https://ganjoor.net | Front-end base used to build clickable links. |
Concepts
Ganjoor's data model has three nested levels. Getting these straight is the difference between a
productive and a fruitless agent session.