openroles-india-mcp
# openroles-india-mcp
An MCP server for **jobs located in India, read straight from employers' own careers boards**.
Every job links to the employer's real application form, carries the date the employer first
published it, and, for most boards, the questions its application form will ask.
Sources are the applicant tracking systems that publish their job boards through public APIs:
**Greenhouse, Lever (US and EU), Ashby, SmartRecruiters, Workable and Recruitee.** Job boards
whose terms forbid automated reading (Naukri, LinkedIn, Indeed, Apna, Instahyre, foundit, Cutshort)
are deliberately not sources, so a job posted only there is not here.
## Coverage (company list round 1, 2026-12-02)
| | |
|---|---|
| Employers with jobs in India | **958** (boards named in the Common Crawl web archive, each checked for an India job) |
| Open jobs in India | **15,196**; the index keeps those posted in the last 90 days (9,503 then) |
| Posted in the last 7 / 30 days | 1,709 / 4,836 |
| Top cities | Bengaluru 5,186 · Pune 1,255 · Mumbai 1,115 · Hyderabad 898 · Gurugram 896 · Delhi 796 · Chennai 626 |
Many large Indian employers (Razorpay, Zomato, Flipkart) use systems not covered yet. The first
full load took 30 minutes, mostly SmartRecruiters descriptions fetched one by one; later refreshes
fetch descriptions only for new jobs. The plan, decisions and open questions are in `docs/PLAN.md`.
## Tools
| Tool | What it returns |
|---|---|
| `search_jobs` | India jobs by role, skills, level, years of experience, employment type, city (old names work: Bangalore, Gurgaon), remote, company, ATS, days since posting (30 by default), and words weighted by where they appear (title > skills > requirements > rest; company boilerplate is not searched). Each result is a **strong** or **partial** match with why; repeats of one opening come back once with all their cities; a thin city search says where else the same search matches. |
| `get_job` | One job in full, by id or by any supported careers link (also jobs not yet indexed): the job's own text apart from the company's boilerplate, with its level, experience, roles and required / nice-to-have skills. `check_live` re-reads the board to confirm it is still open. |
| `get_application_form` | The form's questions (label, required, type, options), with flags for the ones that can rule a candidate out: residency, work authorization, language, CTC, notice period, declarations, background checks, recorded interviews. Greenhouse, Lever, Ashby, Recruitee. |
| `new_jobs_since` | Jobs first seen, and jobs closed, since a date: for alerts and digests. |
| `find_company` | Which ATS an employer uses, its board name and India job count. Looks in the index, then tries the name live on every ATS. |
| `list_companies` | Employers in the index with their open India jobs. |
| `index_status` | Coverage and freshness: companies, open jobs, per ATS and city, last refresh. |
## Quick start
Needs Node 22.13 or later. The index is Postgres: set `DATABASE_URL` to a Postgres server (a local
PostgreSQL, or Supabase), or leave it unset to use PGlite, the same Postgres running inside Node,
with its data in `data/pgdata` (or `PGLITE_DIR`). Set it in the environment, or in a git-ignored
`.env` in the repo (copy `.env.example`); the environment wins, and the tests never read `.env`.
```bash
npm install
npm run refresh # reads every board in data/companies.json into the index (30 minutes the first time)
npm run coverage # what the index holds
npm test # unit tests, no network, no database server (PGlite in memory)
npm run eval # the search test set: 30 searches, scored against judged results
npm run smoke # one live board per ATS
```
**The search test set.** `npm run eval` loads a frozen set of jobs (the 9,503 of round 1, made once
with `npm run eval -- --freeze <round-1 index.db>` into `data/eval/`, not committed) through the
same code a refresh uses, runs the 30 searches in `eval/tests.json` and scores the top 10 of each
against the verdicts in `eval/verdicts/`. Keep a change to the rules or the search only if the
score holds or rises.
### Use it from Claude Code, Claude Desktop or Cursor (stdio)
Launch it through tsx's CLI by absolute path, so it works from any working directory and nothing
but the protocol reaches stdout (`npm start` prints a banner there):
```bash
claude mcp add openroles-india -- node "/path/to/openroles-india-mcp/node_modules/tsx/dist/cli.mjs" "/path/to/openroles-india-mcp/src/main.ts"
```
Claude Desktop (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"openroles-india": {
"command": "node",
"args": ["/path/to/openroles-india-mcp/node_modules/tsx/dist/cli.mjs", "/path/to/openroles-india-mcp/src/main.ts"]
}
}
}
```
### Host it (Streamable HTTP)
```bash
DATABASE_URL=postgres://… API_KEY=<a long random key> npm run start:http -- --port 8080 --refresh-every 6
```
The hosted mode needs `DATABASE_URL`, a Postgres server (Supabase in production), and refuses to
start without it; PGlite is for tests and local runs. The endpoint is `POST /mcp`, stateless, with
`Authorization: Bearer <key>` when `API_KEY` is set; `GET /health` returns the index status. It
binds to 127.0.0.1 unless `HOST` says otherwise. `--refresh-every <hours>` keeps the index fresh in
the same process. Or with Docker:
```bash
docker build -t openroles-india-mcp .
docker run -p 8080:8080 -e DATABASE_URL=postgres://… -e API_KEY=<key> openroles-india-mcp
```
### The public site and public MCP endpoint (Vercel)
The Next.js app at the repo root (`app/`, `components/`, `lib/`) is the public website and the
public MCP endpoint, deployed on Vercel (region `bom1`). Design and decisions: [docs/PUBLIC-SITE.md](docs/PUBLIC-SITE.md).
- `POST /mcp`: stateless Streamable HTTP with the index-only tools (`search_jobs`, `get_job`,
`new_jobs_since`, `find_company`, `list_companies`, `index_status`). Nothing reads an employer's
site live, applies or writes; `get_application_form` and live lookups stay on the maintainer's
own server.
- `/`: one search in three views (departure board, gazette, map); landing pages per city, city and
role, role and employer; `/connect`, `/how-it-works`, `/status`, `sitemap.xml`, `llms.txt`.
- Limits per caller (a salted hash of the IP address; IPv6 by its /64): 10 tool calls a minute and
400 a day, counted in Upstash Redis; answers are cached there until the next refresh.
- The index is refreshed every 2 hours by the GitHub Actions workflow `refresh`.
- The site reads through a read-only database login (`db/web-login.sql`).
- The maintainer controls it from their own PC: `npm run admin -- status`, `maintenance on|off`,
`limits set mcp.perMinute 10`, `block <caller>`, `refresh-now`, `cache clear`.
Vercel environment variables:
| Variable | Value |
|---|---|
| `DATABASE_URL` | the `openroles_web` login's transaction-pooler string (port 6543) |
| `CALLER_SALT` | a long random string |
| `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` | the Upstash database's REST address and token |
| `SITE_URL` | only when the site is not at `https://openroles-india.vercel.app` |
## The data
| File | What | Committed |
|---|---|---|
| `data/companies.json` | **The company list**: which ATS and board name each employer uses, with its India job count when last checked. This is the asset; review and edit names freely. | yes |
| `data/seed.json` | Inputs to discovery: employer names to try, and known board names. | yes |
| The index | Postgres (`DATABASE_URL`, else PGlite in `data/pgdata`): every India job posted in the last 90 days, open or recently closed, with the fields the rules read from it, built by `npm run refresh`. | no |
| `eval/` | The search test set: searches, the filters a caller would pass, independent judges' and the maintainer's verdicts, reference runs. | yes |
**Growing the list.** Add names to `data/seed.json` (or to a git-ignored `data/seed.local.json`, merged in when present) and run `npm run discover`: each name is tried
on every ATS under a few spellings, and each board with a job in India **published in the last
year** joins `companies.json`. `npm run discover -- --name "Razorpay"` tries one name and prints what
it finds, writing nothing.
**Keeping it clean.** A guessed name can land on the wrong board, so three rules keep the list honest:
- **Fresh jobs only.** Abandoned SmartRecruiters accounts keep years-old postings live, so a board
whose India jobs are all over a year old stays out.
- **No test postings.** Titles like "test", "Deauth Test" or "do not apply" are dropped everywhere.
- **Employers only.** `exclude` in `data/seed.json` names boards kept out, with the reason:
aggregators that repost other employers' jobs (Jobgether), job boards posting their clients' jobs
(Apna's Workable), test accounts.
`npm run discover -- --recheck` reads every listed board again and drops those that no longer
qualify (a board that cannot be read is kept until a read says otherwise). Names come from each
board where the ATS gives one, tidied ("Careers at KKR" → "KKR"); Lever and Ashby give none, so
check those names by eye. The refresh always uses the name in `companies.json`.
## How it reads other companies' servers
These are employers' public job boards, so the refresh is built not to look like an attack:
- at most 3 requests in flight to one host, their starts spaced 150 ms apart;
- 429 and 5xx answers are retried, honouring `Retry-After` (up to 60 s);
- each board is read once per refresh, and SmartRecruiters descriptions only once per job;
customers' calls are answered from the index, never by re-reading the boards (except `check_live`,
`get_application_form` and `find_company`'s live probe, one board each);
- a board that fails keeps its jobs as they were: only a successful read can close a job.
`USER_AGENT` sets the user agent the refresh sends. The default, `openroles-india-mcp/<version>
(+<repo URL>)`, tells employers' systems who is reading and where to write; a fork run at scale
should name its own address.
## Notes on each source
| ATS | List | Description | Form questions | Notes |
|---|---|---|---|---|
| Greenhouse | public board API | in the list | public API (`?questions=true`) | dated by `first_published`, never `updated_at` |
| Lever | public postings API (US, EU) | in the list | read from the apply page (labelled inputs, and the employer's own questions as JSON) | names no employer: the board's name is used |
| Ashby | public posting API | in the list | the GraphQL endpoint Ashby's own job pages use | names no employer |
| SmartRecruiters | public postings API, filtered to India on its side | one call per job, fetched once | not published | any company id answers 200, so discovery requires at least one job |
| Workable | account widget (one call, with descriptions) | in the list | not published | |
| Recruitee | public offers API | in the list | in the list (standard fields and open questions) | each board is its own subdomain |
**Before charging anyone:** read each ATS's API terms. These endpoints are public and widely used
by aggregators, but "public" is not the same as "licensed for resale", and Ashby's form endpoint is
an internal one its pages use.
## Not done yet
- **Indian ATSs.** Keka, Zoho Recruit and Darwinbox are widely used in India, but their careers
pages are JavaScript shells with no public job API found so far (checked 2026-11-23).
- **Personio and Teamtailor** answer publicly (XML and RSS) and would be the next two adapters.
- **Packaging and billing**: an Apify listing (or another marketplace), pricing, and per-customer keys.
- **The company list is only as wide as the seed.** Sources for more names: funding databases,
startup lists, and every careers link customers pass to `get_job`.
## Layout
```
src/ats/ one adapter per ATS: list a board, get a job, read its form
src/india.ts is a location in India, and which cities (canonical names)
src/text.ts HTML to text, dates, experience years, salary formatting
src/extract.ts the rules: own text vs boilerplate, requirements, experience, level, roles, skills, workplace
src/db.ts one Postgres connection: node-postgres for a server, PGlite otherwise
src/store.ts the index in Postgres: writing boards, jobs, companies, runs
src/search.ts search: filters, weighted words, strong / partial with why, repeats folded
src/refresh.ts reads every board into the index (90 days kept), under a Redis lock
src/discover.ts finds which ATS and board an employer uses
src/server.ts the MCP tools: every tool for the maintainer's server, the index-only ones for the public
src/main.ts stdio or Streamable HTTP entry point
src/public.ts the public MCP endpoint and the website's search: gate, cache, usage counts
src/gate.ts maintenance, blocked callers, rate limits per caller
src/kv.ts the small Redis surface (Upstash, or memory in tests)
src/settings.ts the public site's settings, from the settings table
src/site.ts what the website's pages read: counts, landing pages, sitemap, llms.txt
src/cli/ discover, refresh, coverage, smoke, eval, admin
app/ the website and the /mcp and /api/search routes (Next.js)
components/ the website's components: the three search views, landing pages
lib/ the website's data layer, formatting, structured data
db/ web-login.sql: the website's read-only database login
test/ unit tests on recorded answers, plus the MCP tools end to end
```
TDQS
Scored across 7 tools
Each tool targets a distinct object: search_jobs for ranked discovery, get_job for a full posting, get_application_form for live form questions, index_status for coverage stats. The closest pairs are find_company vs list_companies and search_jobs vs new_jobs_since, but the descriptions make the boundaries workable (single-employer ATS lookup vs. listing employers; ranked search vs. date-delta feed).
Most names follow a clear verb_noun pattern: search_jobs, get_job, get_application_form, find_company, list_companies. The deviations (new_jobs_since, index_status) are noun phrases but remain readable and self-explanatory.
Seven tools is a tight, well-scoped surface for a job-search index; each tool maps to a distinct user intent (discover, inspect, apply, monitor, identify employer). No redundant or filler tools are present.
The read-only lifecycle is covered end to end: index health, ranked search, full job detail with liveness check, application form inspection, company/ATS lookup, employer listing, and a delta feed for alerts. Minor gaps exist around explicit alert/subscription management and comparison of related postings, but agents can work around them with search_jobs and new_jobs_since.