Skip to main content
Glama
README.md
# listingdata

listingdata is a small local bridge to the hosted HasData
Redfin MCP server, which returns Redfin real-estate data
as JSON. It can look up for-sale, for-rent, or sold
listings for a place, and it can pull one property in
full from its Redfin URL: the address, list and sold
prices and their history, the Redfin Estimate, beds and
baths, size and lot, year built, tax and school data,
and the listing agent's name as published on the page.

The bridge holds no listings of its own. It answers the
tool list locally, exactly as captured from the live
endpoint, and forwards each tool call upstream,
returning whatever comes back untouched. The captured
surface is two read-only fetches over public listing
data: there is no booking, offer, contact-extraction,
or payment tool in it.

## Tools

- `hasdata_redfin_listing_getRealEstateListings` —
  search Redfin listings. Required: `keyword` (a
  zipcode, city, neighborhood, school, school district,
  apartment-building name, or full street address) and
  `type` (`forSale`, `forRent`, or `sold`). Optional
  filters cover price and monthly-payment ranges,
  sorting, home types, beds and baths, square footage,
  lot size, year built, listing category and status,
  time on Redfin, home features, rental amenities and
  pet terms, school ratings, walk / transit / bike
  scores, and a `page` number for paging. An address or
  building returns a single property card instead of a
  list. Returns listings with address, Redfin URL, list
  price, beds/baths, square footage, year built, days
  on market, status, coordinates, photos, and MLS
  number.
- `hasdata_redfin_property_getPropertyDetails` —
  fetch one property in full. Required: `url` (the
  Redfin property URL). Returns address, list/sold
  price, price history, Redfin Estimate, beds/baths,
  square footage, lot size, year built, property type,
  HOA, days on market, school ratings, tax history,
  listing agent, full description, photos, and nearby
  comparables.

## Configuration

- `HASDATA_REDFIN_MCP_URL` (optional) — override the
  upstream endpoint. Defaults to
  `https://mcp.hasdata.com/mcp?apis=redfin`. (The
  override hook is this rebuild's own labelled
  reconstruction.)
- `HASDATA_API_KEY` (optional) — when set, every
  upstream request carries an `x-api-key: <key>`
  header, for the caller's own HasData API key. When
  it is not set, no key header is sent. (The header
  name and the env name are pinned by the original's
  registry record; forwarding the key from this env
  var is a labelled reconstruction — the original
  surface was captured keyless.)

### Forwarding mechanics

On the first tool call the client opens a streamable
HTTP session upstream: a JSON-RPC `initialize` request
(protocolVersion `2025-03-26`, clientInfo name
`listingdata`), then a `notifications/initialized`
notification, then the `tools/call` request carrying
the caller's arguments unchanged. When the upstream
answers `initialize` with an `Mcp-Session-Id` header,
that value rides on every later request of the
session, which is reused for the life of the process.
Replies may arrive as plain JSON or as server-sent
events; both are read.

Successful upstream results pass through verbatim,
including any `isError` flag the upstream sets.
Failures — a JSON-RPC error, a non-2xx status, an
unreadable response, or a request that cannot be
completed — come back as an `isError` result whose
text starts with `listingdata error:` (this rendering
is this rebuild's own labelled reconstruction).

## CLI

Each tool is also a subcommand taking one JSON
argument string:

```bash
npx @reneturcios/listingdata hasdata_redfin_listing_getRealEstateListings '{"keyword":"Austin, TX","type":"forSale"}'
npx @reneturcios/listingdata hasdata_redfin_property_getPropertyDetails '{"url":"https://www.redfin.com/example"}'
npx @reneturcios/listingdata --version
```

Exit codes: `0` on success, `1` on an `isError`
result, `2` on a usage error.

## MCP server

```bash
npx -y @reneturcios/listingdata mcp
```

MCP client config:

```json
{
  "mcpServers": {
    "listingdata": {
      "command": "npx",
      "args": ["-y", "@reneturcios/listingdata", "mcp"]
    }
  }
}
```

## Docker

```bash
docker run -i ghcr.io/cloudcorprecords/listingdata
docker run --rm ghcr.io/cloudcorprecords/listingdata --version
```

The container's default command is `mcp`, so the first
form is a stdio MCP server; any other arguments reach
the CLI normally.

## Development

```bash
npm install
npm run build
npm test
npm run dev
```

The test suite runs entirely against a stubbed
JSON-RPC upstream — no live network calls.

## License

MIT — see `LICENSE`.