Skip to main content
Glama
Portugal Data API

Portugal Data API

by y0shkill
README.md
# Portugal Data API

[![Portugal Data API MCP server](https://glama.ai/mcp/servers/y0shkill/portugal-data-mcp/badges/score.svg)](https://glama.ai/mcp/servers/y0shkill/portugal-data-mcp)

**One MCP server for Portuguese open datasets: real-estate listings, public procurement tenders and verified Porto estate-agency leads.**

The Portugal Data API is a **remote MCP server**. It runs at
`https://hermesportugal.duckdns.org/mcp-ptdata/` and speaks **MCP Streamable
HTTP** — point any MCP client at the URL and the five tools are available.
There is nothing to install, no API key and no account: the MCP responses are
returned in full, without per-call payment setup.

> Marketplace listing: <https://mcp-marketplace.io/server/portugal-data-api> (security score 8.0 — Low Risk)
>
> Health check: `GET https://hermesportugal.duckdns.org/x402/health` → `HTTP 200`

---

## Tools

| Tool | What it returns |
|---|---|
| `get_real_estate_listings` | Latest daily Portuguese real-estate listings scraped from Imovirtual-style portals. |
| `get_procurement_tenders` | Portuguese public procurement tenders published on `base.gov.pt`. |
| `get_porto_agency_leads` | Verified Porto estate-agency leads (agency name, city, source URL) with pagination metadata. |
| `get_porto_agency_phones` | The same Porto agency dataset with the `phone` field populated for direct outreach. |
| `get_api_status` | Health and pricing configuration: status, payment wallet, network, facilitator URL, per-endpoint prices. |

### Tool schemas

```jsonc
// get_real_estate_listings / get_procurement_tenders
{ "page": 1 }              // 1-based result page, up to 100 rows per page

// get_porto_agency_leads / get_porto_agency_phones / get_api_status
{}
```

---

## Configuration

### Claude Desktop (remote, Streamable HTTP)

```json
{
  "mcpServers": {
    "portugal-data-api": {
      "type": "http",
      "url": "https://hermesportugal.duckdns.org/mcp-ptdata/"
    }
  }
}
```

### Cursor / Windsurf / VS Code (remote, Streamable HTTP)

```json
{
  "mcpServers": {
    "portugal-data-api": {
      "url": "https://hermesportugal.duckdns.org/mcp-ptdata/"
    }
  }
}
```

### Claude Desktop (local stdio, via this repo)

Runs the same five tools locally by forwarding to the hosted endpoint:

```json
{
  "mcpServers": {
    "portugal-data-api": {
      "command": "python3",
      "args": ["/absolute/path/to/portugal-data-mcp/server.py"]
    }
  }
}
```

### Docker (local stdio)

```bash
docker build -t portugal-data-mcp .
docker run -i --rm portugal-data-mcp
```

---

## Example session

```jsonc
// → initialize
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"demo","version":"1.0"}}}

// ← serverInfo
{"serverInfo":{"name":"portugal-data-api","version":"4.1.8"}}

// → tools/call
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_api_status","arguments":{}}}

// ← result
{"status":"ok","payTo":"0xEd7872b633F78673cbc9d5294acc5a833346dc3f","network":"eip155:8453","facilitator":"https://facilitator.payai.network","price_realestate":"$0.02","price_tenders":"$0.02","price_leads":"$0.05"}
```

---

## Pricing

The backing Portugal Data API is pay-per-call over **x402** on Base
(`eip155:8453`). Current per-call prices, as reported by `get_api_status`:

| Endpoint | Price |
|---|---|
| Real-estate listings | $0.02 |
| Procurement tenders | $0.02 |
| Agency leads / phones | $0.05 |

MCP clients connected to the MCP endpoint receive responses in full — no
per-call payment setup is required from the client side.

---

## Repository layout

```
portugal-data-mcp/
├── server.py     # MCP stdio transport: advertises the 5 tools, forwards calls upstream
├── Dockerfile    # Minimal image running the stdio server
└── README.md
```

`server.py` is a thin transport only. The datasets, the scraping and the
payment rail live behind the hosted Streamable HTTP endpoint, so no scraped
data and no API keys are stored in this repository. Python 3.8+ standard
library only — no dependencies.

---

## License

MIT — see [LICENSE](LICENSE).