{
  "markdown": "# 🇮🇳 IndiaMART MCP Server\n\n<!-- mcp-name: io.github.Techmatic-sys/indiamart-mcp-server -->\n\n![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)\n![License MIT](https://img.shields.io/badge/license-MIT-green.svg)\n![MCP Compatible](https://img.shields.io/badge/MCP-compatible-purple.svg)\n![CI](https://github.com/Techmatic-sys/indiamart-mcp-server/actions/workflows/ci.yml/badge.svg)\n![Coverage](https://codecov.io/gh/Techmatic-sys/indiamart-mcp-server/branch/main/graph/badge.svg)\n\nA fully functional **Model Context Protocol (MCP) server** that connects **Claude AI** to **IndiaMART's Lead Management API**. Fetch, search, analyze, and manage your IndiaMART buyer leads using natural language.\n\n## ⚡ Quick Install (60 seconds)\n\n```bash\ngit clone https://github.com/Techmatic-sys/indiamart-mcp-server.git\ncd indiamart-mcp-server\npip install -r requirements.txt\n```\n\nThen add to your Claude Desktop config and you're done. Full setup below.\n\n---\n\n## ✨ Features\n\n- **10 MCP Tools** — 8 read tools + 2 write tools for complete CRM\n- **Pull Leads** — Fetch leads from IndiaMART for any date range\n- **Pipeline Management** — Track leads through sales stages (new → won)\n- **Notes** — Attach private notes to leads for context\n- **Real-time Webhook** — Receive leads instantly via IndiaMART's Push API\n- **Local Database** — All leads stored in SQLite for fast offline access\n- **Analytics** — Get stats by city, product, and date\n- **Search** — Find leads by keyword in product or message\n- **Export CSV** — Export leads for spreadsheets and reporting\n- **Draft Replies** — Generate professional buyer replies instantly\n- **Input Validation** — Pydantic schemas prevent malformed queries\n- **Retry Logic** — Exponential backoff on API failures\n- **Claude Desktop Ready** — Plug-and-play config included\n\n---\n\n## 📋 Prerequisites\n\n- **Python 3.10+** ([Download](https://www.python.org/downloads/))\n- **IndiaMART Seller Account** with Lead Manager access\n- **IndiaMART CRM API Key** (see below)\n- **Claude Desktop** (optional, for AI-powered lead management)\n\n---\n\n## 🚀 Installation\n\n### 1. Clone or Download\n\n```bash\ngit clone https://github.com/Techmatic-sys/indiamart-mcp-server.git\ncd indiamart-mcp-server\n```\n\n### 2. Create Virtual Environment (recommended)\n\n```bash\npython -m venv venv\n\n# Windows\nvenv\\Scripts\\activate\n\n# macOS/Linux\nsource venv/bin/activate\n```\n\n### 3. Install Dependencies\n\n```bash\n# MCP server only (lightweight, 4 packages)\npip install -r requirements.txt\n\n# Full SaaS web app (includes FastAPI, uvicorn, etc.)\npip install -r requirements-saas.txt\n```\n\n### 4. Configure Environment\n\n```bash\n# Copy the example env file\ncp .env.example .env    # Linux/macOS\ncopy .env.example .env  # Windows\n\n# Edit .env with your credentials\n```\n\n---\n\n## 🔑 How to Get Your IndiaMART API Key\n\n1. Log in to [IndiaMART Seller Dashboard](https://seller.indiamart.com)\n2. Go to **Lead Manager** → **Settings** (⚙️ icon)\n3. Navigate to **CRM Integration** or **API Settings**\n4. Generate or copy your **CRM API Key** (`glusr_crm_key`)\n5. Note your **GLID** (Global Login ID) from your account profile\n6. Paste both values into your `.env` file\n\n> **Note:** The API key gives access to your leads. Keep it secret!\n\n---\n\n## ▶️ Running the MCP Server\n\n```bash\n# Standard run (Claude Desktop starts this automatically)\npython mcp_server.py\n\n# Check version\npython mcp_server.py --version\n\n# Health check (verify DB connectivity)\npython mcp_server.py --health\n```\n\n---\n\n## 🖥️ Connecting to Claude Desktop\n\n### 1. Locate Claude Desktop Config\n\n| OS | Path |\n|----|------|\n| **Windows** | `%APPDATA%\\Claude\\claude_desktop_config.json` |\n| **macOS** | `~/Library/Application Support/Claude/claude_desktop_config.json` |\n| **Linux** | `~/.config/Claude/claude_desktop_config.json` |\n\n### 2. Add the MCP Server\n\n```json\n{\n  \"mcpServers\": {\n    \"indiamart\": {\n      \"command\": \"python\",\n      \"args\": [\"mcp_server.py\"],\n      \"cwd\": \"/ABSOLUTE/PATH/TO/indiamart-mcp-server\",\n      \"env\": {\n        \"INDIAMART_API_KEY\": \"your_crm_api_key_here\",\n        \"INDIAMART_GLID\": \"your_glid_here\"\n      }\n    }\n  }\n}\n```\n\n**Replace `cwd` with your actual path:**\n- **Windows:** `\"C:\\\\Users\\\\YourName\\\\indiamart-mcp-server\"`\n- **macOS:** `\"/Users/yourname/indiamart-mcp-server\"`\n- **Linux:** `\"/home/yourname/indiamart-mcp-server\"`\n\n### 3. Restart Claude Desktop\n\nClose and reopen Claude Desktop. You should see the IndiaMART tools available in the tools menu.\n\n---\n\n## 🤖 Connecting to Claude Code\n\n### Option 1: CLI (Recommended)\n\n```bash\nclaude mcp add indiamart -- python /ABSOLUTE/PATH/TO/indiamart-mcp-server/mcp_server.py\n```\n\nThen set your environment variables:\n\n```bash\n# In your shell profile or before launching Claude Code\nexport INDIAMART_API_KEY=\"your_crm_api_key_here\"\nexport INDIAMART_GLID=\"your_glid_here\"\n```\n\n### Option 2: Manual Config\n\nAdd to your `.claude/settings.json` (project-level) or `~/.claude/settings.json` (global):\n\n```json\n{\n  \"mcpServers\": {\n    \"indiamart\": {\n      \"command\": \"python\",\n      \"args\": [\"/ABSOLUTE/PATH/TO/indiamart-mcp-server/mcp_server.py\"],\n      \"env\": {\n        \"INDIAMART_API_KEY\": \"your_crm_api_key_here\",\n        \"INDIAMART_GLID\": \"your_glid_here\"\n      }\n    }\n  }\n}\n```\n\nReplace the path with your actual absolute path to `mcp_server.py`.\n\n### Verify Connection\n\nOnce connected, ask Claude Code:\n- \"Sync my latest IndiaMART leads\"\n- \"Show me leads from the last 24 hours\"\n- \"What are my lead statistics?\"\n\n---\n\n## 🦞 Connecting to OpenClaw\n\n[OpenClaw](https://openclaw.ai) is a self-hosted AI agent platform. Your IndiaMART leads\nbecome a native skill in OpenClaw, accessible from any interface OpenClaw supports.\n\n### 1. Find your OpenClaw config file\n\n| OS | Path |\n|----|------|\n| **Linux/macOS** | `~/.openclaw/openclaw.json` |\n| **Windows** | `C:\\Users\\YourName\\.openclaw\\openclaw.json` |\n\n### 2. Add the IndiaMART skill\n\nOpen the config and add under `skills.mcpServers`:\n\n```json5\n{\n  skills: {\n    mcpServers: {\n      indiamart: {\n        command: \"python\",\n        args: [\"mcp_server.py\"],\n        cwd: \"/absolute/path/to/indiamart-mcp-server\",\n        env: {\n          INDIAMART_API_KEY: \"your_crm_api_key_here\",\n          INDIAMART_GLID: \"your_glid_here\"\n        }\n      }\n    }\n  }\n}\n```\n\n> See `openclaw-config-example.json5` at the repo root for a ready-to-copy template.\n\n### 3. Restart the OpenClaw gateway\n\n```bash\nopenclaw gateway restart\n```\n\n### 4. Verify it loaded\n\n```bash\nopenclaw status --all\n# You should see \"indiamart\" listed with 10 tools\n```\n\n### Remote OpenClaw (VPS / EC2)\n\nRun the MCP server in SSE mode on your server:\n\n```bash\npython mcp_server.py --transport sse --host 0.0.0.0 --port 8000\n```\n\nThen point your OpenClaw config to `http://your-server-ip:8000`.\n\n---\n\n## 💬 Example Prompts\n\n| Prompt | What It Does |\n|--------|-------------|\n| \"Show me all leads from the last 24 hours\" | Syncs and displays recent leads |\n| \"How many leads did I get this week and from which cities?\" | Shows lead statistics |\n| \"Search for leads asking about steel pipes\" | Keyword search in product/message |\n| \"Draft a reply for lead ID IML123456789\" | Generates professional buyer reply |\n| \"Move lead IML123 to qualified stage\" | Updates pipeline stage |\n| \"Add a note to lead IML123: Very interested in bulk order\" | Attaches a note |\n| \"Export all leads from January 2026 as CSV\" | Exports leads in CSV format |\n| \"Sync my latest IndiaMART leads\" | Pulls latest leads into local DB |\n\n---\n\n## 🛠️ Available MCP Tools (10 Total)\n\n### Read Tools (8)\n\n| Tool | Description |\n|------|-------------|\n| `tool_get_leads_by_date` | Fetch leads from IndiaMART for a date range |\n| `tool_get_recent_leads` | Get leads from the last N hours |\n| `tool_get_lead_stats` | Analytics: totals, by city, product, and date |\n| `tool_search_leads` | Search leads by keyword |\n| `tool_get_lead_by_id` | Full details of a specific lead |\n| `tool_draft_reply` | Draft a professional reply for a buyer |\n| `tool_export_leads_csv` | Export leads as CSV |\n| `tool_sync_latest_leads` | Sync latest from IndiaMART to local DB |\n\n### Write Tools (2 — NEW)\n\n| Tool | Description |\n|------|-------------|\n| `tool_update_lead_stage` | Move leads through pipeline (new → contacted → qualified → won/lost) |\n| `tool_add_note` | Attach private notes to leads for follow-up tracking |\n\n---\n\n## 📁 Project Structure\n\n```\nindiamart-mcp-server/\n├── 📄 mcp_server.py           ← SINGLE entry point\n├── 📄 smithery.yaml            ← Smithery.ai marketplace manifest\n├── 📄 pyproject.toml           ← Python package config\n├── 📄 requirements.txt         ← MCP only (5 packages)\n├── 📄 requirements-saas.txt    ← Web app deps\n├── 📄 README.md                ← This file\n├── 📄 CHANGELOG.md             ← Version history\n├── 📄 LICENSE                  ← MIT License\n├── 📄 .env.example             ← Annotated credential guide\n├── 📄 .gitignore               ← Git ignore rules\n├── 📄 docker-compose.yml       ← Full stack Docker setup\n│\n├── 📁 mcp_tools/               ← Core MCP Package\n│   ├── __init__.py\n│   ├── 🔧 tools.py            ← 10 MCP tools with rich docstrings\n│   ├── 📋 schemas.py          ← Pydantic validation + response types\n│   ├── 🌐 http_client.py      ← Resilient API client with retry\n│   ├── 💾 database.py         ← SQLite operations\n│   ├── 🔑 auth.py             ← API key helpers\n│   └── 🐳 Dockerfile          ← MCP server Docker image\n│\n├── 📁 saas/                    ← SaaS Web App (FastAPI)\n│   └── ...\n│\n├── 📁 tests/                   ← Test suite\n│   ├── conftest.py             ← pytest fixtures\n│   └── test_tools.py           ← Validation + integration tests\n│\n├── 📁 .github/                 ← CI/CD\n│   └── workflows/ci.yml\n│\n└── 📁 docs/                    ← Documentation\n    ├── tools.md\n    └── examples.md\n```\n\n---\n\n## 🔧 Troubleshooting\n\n### \"INDIAMART_API_KEY is not set\"\n- Make sure you've created a `.env` file (not just `.env.example`)\n- Check that the key is correct and not expired\n- Verify the `.env` file is in the project root directory\n\n### Claude Desktop doesn't show IndiaMART tools\n- Restart Claude Desktop completely (quit + reopen)\n- Check `claude_desktop_config.json` for syntax errors (valid JSON?)\n- Verify the `cwd` path is correct and `mcp_server.py` exists there\n- Check Claude Desktop logs for MCP connection errors\n\n### Date format errors\n- Supported formats: `YYYY-MM-DD`, `DD-MM-YYYY`, `DD/MM/YYYY`, `DD-Mon-YYYY`\n- Example: `2026-01-15`, `15-01-2026`, `15-Jan-2026`\n\n---\n\n## 📄 License\n\nMIT License. Use freely for your business.\n\n---\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/my-feature`\n3. Commit changes: `git commit -m \"Add my feature\"`\n4. Push: `git push origin feature/my-feature`\n5. Open a Pull Request\n\n---\n\n**Built with ❤️ for Indian sellers on IndiaMART**\n",
  "bytes": 10837,
  "sha": "d77522e89ad75851065b40edeea75e5862582f7e5e8093e5b86535cbb98ac167",
  "repo_slug": "techmatic-sys/indiamart-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_techmatic_sys_indiamart_mcp_se_ee94a70f/readme"
}