Skip to main content
Glama
README.md
# Doar Israel MCP

Look up Israel Post parcels from an agent that supports local MCP servers.
One read-only tool, `lookup_parcel`, returns the original Israel Post JSON.
The guest API key and TLS client certificate are bundled, so no Israel Post
account, credential setup, app extraction, or hosted service is required.

Requires **Node.js 22 or newer** and network access to Israel Post.
This is an unofficial community project, independent of Israel Post.

## Install

```sh
git clone https://github.com/abjurato/doar-israel-mcp.git
cd doar-israel-mcp
npm ci --ignore-scripts
node bin/doar-israel-mcp.js --version
```

Configure your agent to launch `node` with the **absolute path** to
`bin/doar-israel-mcp.js`. The working directory does not matter. If the agent
cannot find Node, use the full path printed by `command -v node` on macOS/Linux
or `(Get-Command node).Source` in PowerShell.

Running `npm start` starts a stdio server that waits for MCP messages; it does
not open a web page or provide an interactive prompt. In harness configuration,
launch `node` directly so npm's command banner cannot enter the protocol stream.

## Connect an agent

Replace `/absolute/path/to/doar-israel-mcp` with your clone's location. On
Windows, use a path such as `C:/code/doar-israel-mcp` in JSON and TOML.

### Codex

```sh
codex mcp add doar-israel -- node /absolute/path/to/doar-israel-mcp/bin/doar-israel-mcp.js
```

Or add this to `~/.codex/config.toml`:

```toml
[mcp_servers.doar_israel]
command = "node"
args = ["/absolute/path/to/doar-israel-mcp/bin/doar-israel-mcp.js"]
tool_timeout_sec = 60
```

See the [official Codex MCP documentation](https://developers.openai.com/codex/mcp).

### Claude Code

```sh
claude mcp add --transport stdio --scope user doar-israel -- node /absolute/path/to/doar-israel-mcp/bin/doar-israel-mcp.js
```

See the [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp).

### Clients using `mcpServers` JSON

Merge this entry into the client's MCP configuration:

```json
{
  "mcpServers": {
    "doar-israel": {
      "command": "node",
      "args": ["/absolute/path/to/doar-israel-mcp/bin/doar-israel-mcp.js"]
    }
  }
}
```

For VS Code, use **MCP: Add Server → Command (stdio)** with the same Node command.
An editor-managed `.vscode/mcp.json` example is in
[`examples/vscode.mcp.json`](examples/vscode.mcp.json); follow the
[VS Code guide](https://code.visualstudio.com/docs/agent-customization/mcp-servers)
for the configuration appropriate to your selected harness.

All examples are also in [`examples/`](examples/). This release uses **stdio**.
Clients that accept only remote HTTP MCP servers need a separate adapter or
tunnel; this package does not listen on a network port.

## Tool

```text
lookup_parcel({"tracking_number":"YOUR_TRACKING_NUMBER"})
```

Replace the placeholder with 1–64 ASCII letters or digits. Input is passed
unchanged; spaces and punctuation are rejected. Ask your agent, for example,
“Track my Israel Post parcel” and supply your tracking number.

The tool sends one HTTPS GET to
`https://apimftprd.israelpost.co.il/itemtracecert/items//{tracking_number}`
using the mobile app's guest API. The double slash is intentional.

- Original UTF-8 JSON is returned in `content[0].text` without reserialization,
  field renaming, enrichment, or a `structuredContent` duplicate.
- HTTP error JSON is returned with `isError: true`.
- Invalid input, transport failures, non-JSON responses, cancellation, and
  exceeded limits produce short MCP errors.
- TLS server verification is enabled. There are no redirects or retries.
  Each request has a 45-second total deadline and a 2 MiB response limit.
- The server keeps no parcel history, cookies, cache, account session, or logs
  of parcel contents. Your agent harness may retain its conversation/tool results.
- Parcel fields are external data and must not be treated as instructions.

## Bundled credentials

[`credentials/guest.json`](credentials/guest.json) contains the app's shared
guest subscription key, certificate password, and relative `pfxPath`.
[`credentials/client.pfx`](credentials/client.pfx) is the TLS client identity
recovered from the Israel Post iOS app, version 5.1.87, build 2. Both files are
intentionally included in Git and in the installable package.
See [`credentials/README.md`](credentials/README.md) for provenance.

To use a replacement credential set, copy
[`examples/credentials.example.json`](examples/credentials.example.json), fill
in its values, and set **`DOAR_CREDENTIALS_FILE`** to that JSON file's absolute
path in your harness environment. `pfxPath` is resolved relative to that JSON
file, or may itself be absolute. The override replaces the bundled configuration
and never silently falls back to it if invalid. No `.env` loader is required.

## Troubleshooting

| Symptom | Check |
| --- | --- |
| Server cannot start | Node 22+, `npm ci`, and absolute executable paths in the harness. |
| “Guest credentials unavailable” | Reinstall the package, or check the override JSON and certificate path. |
| HTTPS request fails | Network access to `apimftprd.israelpost.co.il:443` and a usable client certificate. |
| HTTP 401/403 | The upstream app key or certificate may have changed; update the package or configure replacement credentials. |
| Timeout | The server deadline is 45 seconds; allow at least 60 seconds in the harness. |
| Terminal appears idle | A stdio server waits for a client; use the harness or the smoke test below. |

## Develop and verify

```sh
npm test
npm run verify:package
```

Tests use synthetic parcel data and make no live Israel Post requests. The
package check creates a real tarball, checks its exact file list, installs it in
a temporary directory, checks the executable, and performs an MCP handshake.
It may download npm dependencies. CI runs both checks on Node 22 and 24 across
Linux, macOS, and Windows.

An opt-in live lookup uses a tracking number you supply:

```sh
npm run smoke -- YOUR_TRACKING_NUMBER
```

The smoke test prints only success and response-shape information, without
printing or saving parcel contents. A live lookup contacts Israel Post.

You can also install a locally built package:

```sh
npm pack
npm install --global --ignore-scripts ./doar-israel-mcp-1.0.0.tgz
doar-israel-mcp --version
```

The package is prepared for npm publication; the supported initial distribution
is this Git repository. See [CONTRIBUTING.md](CONTRIBUTING.md) for release steps.

## License

The MCP implementation is [MIT licensed](LICENSE). The bundled app credentials
originate from Israel Post; the project does not claim ownership of them or of
the upstream API and its responses.