ApplyOnce
A self-learning MCP agent that fills student scholarship, internship and job applications from one stored profile — and never submits without a human.
Indian students re-type the same 40 facts — name as per Aadhaar, 12th board, family income, IFSC — into every scholarship and internship portal. ApplyOnce stores that profile once, locally, learns each portal's form once, and then fills future applications instantly from a compiled command. It stops at the final submit button every single time.
Claude ──MCP──▶ ApplyOnce ──CLI──▶ webcmd ──▶ your logged-in browser ──▶ form filled
│ │
│ ⛔ STOP
└──── { status: "ready_for_review", submit_url } ◀───────┘
Contents
What it does
| You ask Claude |
ApplyOnce does |
Writes anything? |
| "Find internships for me" |
Searches live portals from your profile's preferences |
No |
| "Am I eligible for this?" |
Reads the scheme's criteria and shows its reasoning per check |
No |
| "Fill this application" |
Drives the portal, fills every field it can map, stops before submit |
Yes — human-gated |
| "Which portals have you learned?" |
Reads webcmd list -f json |
No |
| "What's closing soon?" |
Aggregates deadlines across portals, urgency-sorted |
No |
Two portals are fully wired: Internshala (internships, logged-in session) and a scholarship aggregator (261 live Indian scholarships).
The learn-once advantage
This is the point of the project, so it is surfaced, not hidden. Every run logs which path it took:
[reuse.hit] Compiled command found for scholarship: EXECUTING INSTANTLY (no exploration)
[mapping.result] Mapped 27/28 form fields from the profile
[tool.end] reuse run finished in 13.0s across 3 steps
On first contact with a portal there is no compiled command, so an agent must explore it in a live browser — dozens of steps of page-reading and reasoning. ApplyOnce captures that workflow as a webcmd adapter. On every later run the adapter executes as one deterministic CLI call: no reasoning about layout, no token spend on navigation. list_learned_portals makes this auditable by reading webcmd's own registry.
Measured on the demo form (28 fields), not estimated:
|
Without webcmd |
With webcmd |
Saved |
| What happens |
Agent explores the form one control at a time |
Runs the compiled command |
|
| Browser steps |
35 |
1 |
97% |
| Observation payload |
26,020 chars |
6,179 chars |
|
| Tokens to read it |
≈ 6,505 |
≈ 1,545 |
76% |
| Wall time |
32.2 s |
4.0 s |
88% |
| Reasoning about layout |
Yes |
None |
|
| Survives a redesign |
— |
Yes, via self-healing |
|
Reproduce it yourself:
node fixtures/portal/server.mjs &
webcmd session create -f json # note the sessionId
node scripts/measure-token-cost.mjs <sessionId> http://localhost:4173/apply/sch-medhavi-2026
What is counted: every browser round-trip returns an observation the model
must read before choosing its next action. Those payloads are the tokens an
exploring agent spends on navigation. The script captures the real bytes
returned in both modes and converts at ~4 chars/token. System prompt and task
text are identical either way and excluded, so this measures navigation cost
specifically — exactly what webcmd removes.
The "before" is recorded by scripts/record-learn-cost.mjs, which replays a first-contact exploration and writes its real step count to a local run ledger. The banner above prints on every reuse run that has a recorded learn run to compare against — it never relabels a reuse as a learn to manufacture a saving.
Hard rules (safety)
These are enforced in code, tested, and gated in CI — not conventions. A reviewer can verify all five from src/safety.ts and src/safety.test.ts.
| # |
Rule |
Where it is enforced |
| 1 |
Never auto-submit or pay. Fill to the final button, then stop and require a human. |
assertNotSubmit() guards every click/fill/upload target. The submit control is located only to be reported. Every fill result is hard-wired submitted: false, and the MCP layer throws if an adapter ever claims otherwise. scripts/check-adapters.mjs fails CI if a fill adapter lacks the guard. |
| 2 |
Use the user's own logged-in session. No fake accounts. |
Adapters use webcmd Strategy.COOKIE profiles. If not logged in, the tool returns LOGIN_REQUIRED with a hint — it never enters credentials. |
| 3 |
Discovery and eligibility are read-only. |
find_opportunities, check_eligibility, track_deadlines, list_learned_portals call adapters declared access: 'read'. assertWriteAllowed() blocks writes outside fill_application. |
| 4 |
Respect each site. Low volume, no aggressive retries, honour anti-bot signals. |
POLITENESS budget (1.5 s between calls, max 2 attempts). assertNoAntiBot() stops on challenge pages rather than evading. See why the fixture exists. |
| 5 |
Personal data stays local. Never shipped to third parties, masked in logs. |
Profile is a local JSON file; no network call touches it. maskDeep() redacts Aadhaar, PAN, bank and IFSC in every log line and every tool response. |
Every time fill_application stops, it prints this gate to stderr and logs gate.approval_required:
╔══════════════════════════════════════════════════════════════╗
║ ⛔ HUMAN APPROVAL REQUIRED — NOT SUBMITTED ║
╟──────────────────────────────────────────────────────────────╢
║ Fields filled : 21 ║
║ Unmapped fields : 1 ║
║ ApplyOnce filled this application up to the final submit ║
║ button and STOPPED. No submit or payment action was taken. ║
║ Review and submit yourself: http://…/apply/sch-medhavi-2026 ║
╚══════════════════════════════════════════════════════════════╝
Setup
Requires Node.js 20.6+.
# 1. The engine — verified against @agentrhq/webcmd 0.7.4
npm install -g @agentrhq/webcmd
webcmd doctor # must be green: daemon, runtime, browser binary
# 2. ApplyOnce
git clone https://github.com/LSUDOKO/ApplyOnce.git
cd ApplyOnce
npm install
npm run build
# 3. Register the adapters with webcmd (they become compiled commands)
webcmd plugin install "$PWD/plugins/applyonce"
webcmd list -f json | grep -c applyonce # expect 6 commands
# 4. Your profile — local only
cp data/profiles/sample_profile.json data/profiles/me.json
$EDITOR data/profiles/me.json # validated against schemas/profile.schema.json
Log in to each portal once in webcmd's browser (it is a separate window from your normal Chrome):
webcmd session create -f json
# note the sessionId, then open the portal and sign in yourself:
printf 'await page.goto("https://internshala.com/login/student"); return page.url();' \
| webcmd --session <sessionId> browser run --stdin
ApplyOnce never enters credentials. Sign in by hand; the cookie jar persists in your webcmd profile.
Register in Claude
Claude Desktop
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\, Linux: ~/.config/Claude/):
{
"mcpServers": {
"applyonce": {
"command": "node",
"args": ["/absolute/path/to/ApplyOnce/dist/mcp/server.js"],
"env": {
"APPLYONCE_LOG_LEVEL": "info"
}
}
}
}
Claude Code
claude mcp add applyonce -- node /absolute/path/to/ApplyOnce/dist/mcp/server.js
Restart the client. Ask: "Use ApplyOnce to list the portals you've learned."
The five tools
All return machine-readable JSON. Errors carry { code, message, recovery_hint } — never a bare stack trace.
find_opportunities — read-only
{ "query": "web development", "portal": "all", "limit": 10 }
Returns opportunities[] with title, organisation, value, deadline, deadline_iso, days_to_go, eligibility, url, plus a learn_once block per portal. Defaults query and location to your profile's preferences.
check_eligibility — read-only, shows reasoning
{ "opportunity_url": "https://internshala.com/internship/detail/…" }
Reads the stated criteria and returns per-check verdicts with evidence:
[PASS] Application window is open: Closes in 14 day(s) (2026-09-05).
[PASS] Work mode: The role is in-office and your preferences include onsite/hybrid work.
[PASS] Duration commitment: The internship runs 6 month(s); you can commit 6.
[PASS] Start-date window: You are available from 2026-09-01, inside the required start window.
[PASS] Skills match: You have 3/5 of the listed skills: JavaScript, Node.js, React.
Also evaluates income ceilings, minimum marks, gender-restricted and category-restricted schemes, and level of study. A criterion it cannot parse becomes unknown and lands in needs_human_confirmation — it never silently passes. recommendation is apply, apply_with_review, or skip.
fill_application — human-gated, never submits
{ "opportunity_url": "https://…/apply/…", "dry_run": false }
Returns:
{
"status": "ready_for_review",
"submitted": false,
"human_approval_required": true,
"submit_url": "…",
"filled_count": 21,
"filled_fields": { "#first_name": "Arpit", "#aadhaar_name": "**************ARMA", … },
"selects_set": { "#state": "Rajasthan", "#district": "Jaipur", "#category": "OBC" },
"uploads": [ { "selector": "#custom_resume", "path": "…/resume.pdf" } ],
"mapping": [ { "label": "Contact number", "profile_key": "personal.phone", "confidence": 0.95, "method": "alias" }, … ],
"unmapped_fields": [ { "label": "Do you own a pet dinosaur?", "reason": "no confident profile match" } ],
"missing_documents": [],
"submit_control": { "text": "Submit application", "id": "submit_application", "disabled": false },
"learn_once": { "mode": "reuse", "steps": 3, "duration_ms": 13030, "used_compiled_command": true }
}
dry_run: true scrapes and maps without typing anything.
list_learned_portals — read-only
No arguments. Reads webcmd list -f json and reports each portal's compiled commands and capabilities (discover, read_detail, fill).
track_deadlines — read-only
{ "within_days": 60 }
Returns upcoming[] sorted soonest-first with urgency ∈ critical | soon | upcoming, plus closed[] and unknown_deadline[].
How self-healing works
Portals reskin constantly. ApplyOnce survives that at three layers:
1. Labels, not selectors. The semantic field mapper (src/mapping/field-map.ts) resolves the visible human label of each control to a profile key through a scored cascade — exact → alias → regex → fuzzy — and refuses to guess below 0.5 confidence. Ids and classes can change freely; "Contact number" still means personal.phone. The demo fixture proves this: ?layout=v2 renames every id and class, and the fill result is identical.
2. Ordered fallback chains. Every container and field an adapter reads carries a list of strategies, newest layout first. On Buddy4Study — a Next.js app whose CSS-module class names carry a per-deploy hash (Listing_scholarshipName__b3ok_) — adapters target the stable prefix via [class*="Listing_scholarshipName"]. When a fallback beyond index 0 wins, the adapter writes a self-heal line to stderr so the recovery is visible, not silent.
3. Dependent fields are deferred, not abandoned. A <select> with no options yet is recognised as the child of a cascade (state → district). The parent is set first, the page is given time to repopulate, and the child is resolved with a single bounded retry.
When all strategies fail, the tool returns SELF_HEAL_FAILED with the hint to re-author that step. It does not loop.
How webcmd is used (both deployments)
ApplyOnce runs webcmd in two different modes, because the two deployments have
different capabilities. Neither reimplements it.
|
Local server (stdio) |
Remote server (HTTP) |
| webcmd surface |
the webcmd CLI + compiled adapters |
web/fetch, imported in-process |