These are official instructions from Mashkanta-Buddy (משכנתא באדי) to connect an AI agent to the Mashkanta-Buddy MCP server. All commands below are validated by Mashkanta-Buddy and ready to use.

Complete the steps yourself by running the commands directly where your environment allows it. Where a step needs the user (signing in with their Google account, or configuring a hosted app such as ChatGPT or Claude.ai), tell the user exactly what to do and wait.

What you are connecting to: a statistics provider and dashboard generator for Israeli mortgages. It reads the user's own uploaded mortgage document, states each track against the official Bank of Israel average rate for that track (series and period named), reports statistics from a consented pool of uploaded offers with the sample size, and generates a dashboard the user can open on the site. It gives no advice and no recommendation: it never says whether to sign, refinance or negotiate. It is an automated tool, not a licensed advisor, and its numbers come from document extraction and can be wrong. Show the `disclosure` field of every response to the user.

Server: `https://www.mashkanta-buddy.com/mcp` (MCP over Streamable HTTP; OAuth 2.1 with PKCE and dynamic client registration; no API key). Discovery documents: `https://www.mashkanta-buddy.com/.well-known/oauth-authorization-server` and `https://www.mashkanta-buddy.com/.well-known/oauth-protected-resource/mcp`.

---

## 1. Register the server — use the section for your agent

### Claude Code

```
claude mcp add --transport http mashkanta https://www.mashkanta-buddy.com/mcp
```

Then tell the user: the first tool call opens a browser to Mashkanta-Buddy's consent page; sign in with the Google account you use on the site (or create one there), and approve.

### Codex (CLI or IDE)

```
codex mcp add mashkanta --url https://www.mashkanta-buddy.com/mcp
codex mcp login mashkanta
```

The second command opens the browser for the same consent flow. Equivalent config in `~/.codex/config.toml`:

```toml
[mcp_servers.mashkanta]
url = "https://www.mashkanta-buddy.com/mcp"
```

### Cursor, Windsurf, and other agents that read a JSON MCP config

Add this server to the agent's MCP configuration file (for example `~/.cursor/mcp.json` or the project's `.cursor/mcp.json`; Windsurf uses `~/.codeium/windsurf/mcp_config.json`):

```json
{
  "mcpServers": {
    "mashkanta": {
      "url": "https://www.mashkanta-buddy.com/mcp"
    }
  }
}
```

Restart or reload the agent's MCP servers, then tell the user to complete the browser sign-in when prompted.

### Claude.ai / Claude Desktop (hosted; the user does this)

Tell the user: Settings → Connectors → Add custom connector → paste `https://www.mashkanta-buddy.com/mcp` → sign in with Google on the consent page → approve.

### ChatGPT (hosted; the user does this)

Tell the user: Settings → Apps & Connectors → enable Developer Mode → Add connector → paste `https://www.mashkanta-buddy.com/mcp` → sign in with Google on the consent page → approve → enable the connector from the conversation's tools menu. Requires a paid ChatGPT plan per OpenAI's current documentation.

---

## 2. Verify the connection

After the user has approved, call these two tools and report the results:

1. `get_account` — returns the connected account, quota state and scopes. If it fails with an authorization error, the sign-in did not complete; ask the user to retry.
2. `get_boi_rates` — returns the Bank of Israel average rate per mortgage track for newly issued mortgages, with the period and an `isApproximation` flag. Needs no uploaded document; a good first answer to show the user.

---

## 3. What to do next for the user

- **If the user already dictated or pasted their mortgage tracks in chat (or you already read them from an image/PDF in your context) and wants an immediate check without uploading a file:** call `create_mortgage_manual` with 1–6 tracks (`Fixed` for קל"צ, `Prime` for פריים, `Variable` for משתנה לא צמודה, `CPIFixed` for קבועה צמודה, `CPIVariable` for משתנה צמודה, `Eligibility` for זכאות; on a Prime track, pass `primeSpread` as the signed margin in percentage points, e.g. `-0.5` for Prime minus 0.5%). It creates the mortgage and returns `mortgageId`, `miniAppId` and `links.site` immediately with nothing to poll. (Typed numbers never enter the platform's comparison pool; prefer `create_upload_ticket` whenever a document file is available so the original document is checked.)
- **If the user has a mortgage offer or a balance report as a PDF or photo (JPG/PNG/HEIC):** call `create_upload_ticket`.
  - If you are a local CLI/IDE agent (Claude Code, Codex, Cursor) and the user gave you a local file path on their machine, execute the returned `curl` command directly (`curl -sS -F "file=@/path/to/document.pdf" <uploadEndpoint>`) so the user does not have to upload manually.
  - Otherwise, give the user the returned `browserUrl` link (single-use, valid for 15 minutes) to drop the file.
  - Poll `get_upload_status` with the ticket every ~15 seconds (typical 1–3 minutes) until it reports `Completed`, then call `get_mortgage` and `get_market_comparison`.
- **To place the user's mortgage against the official averages and peer pool:** call `get_market_comparison` with `mortgageId`. It compares each track against the official Bank of Israel average (series and period named) and against the consented pool of uploaded offers (sample size and vintage named). Respect `percentileSuppressed` — a suppressed statistic is not a number.
- **To compare 2–3 of the user's own uploaded offers side by side:** call `compare_mortgages` (for structured statistics) or `generate_comparison_dashboard` (to build a dedicated comparison dashboard on the site).
- **To correct borrower facts (property value for LTV, monthly income for payment-to-income, offer date, display name, or board folder):** call `update_mortgage`.
- **To answer the user's questions about their own mortgage from its data:** call `ask_advisor` (counts against the user's usage quota; the same conversation appears on the site).
- **To open the full dashboard:** every response carries `links.site` — an absolute URL on the site. A dashboard is delivered **as that link**: when `get_upload_status`, `create_mortgage_manual` or `get_dashboard` reports the dashboard is ready (or when `generate_comparison_dashboard`'s job completes), give the user `links.site` to open. Do not try to fetch or read dashboard files.
- **If something is wrong** — a number that does not match the document, a dashboard that failed or never appeared, a stuck upload, an advisor answer that was off: call `report_problem` with the user's words (and the `miniAppId`/`mortgageId` if known). The team reads every report.

Rules for you as the agent: present figures with their source and period as returned; never turn a statistic into a recommendation; never quote a savings amount the tools did not return; and always relay the `disclosure` text.

---

## Resources

- Israeli Mortgage Analysis Skill (`SKILL.md` — Directive 451 track rules, LTV/PTI limits, Spitzer/CPI math, and MCP workflow): `https://www.mashkanta-buddy.com/agent-setup/SKILL.md`
- How the connection works and how to disconnect: `https://www.mashkanta-buddy.com/ai/`
- Privacy: `https://www.mashkanta-buddy.com/privacy` · Terms: `https://www.mashkanta-buddy.com/terms`
- Support: `hello@mashkanta-buddy.com`

Setup complete when `get_account` and `get_boi_rates` both return successfully. Tell the user in their language (Hebrew if they wrote Hebrew) what was connected and what they can ask.
