portugal-medicines-mcp
Uses OpenStreetMap Nominatim for reverse geocoding coordinates into a Portuguese municipality when a city is not provided, enabling pharmacy and medicine lookup by latitude/longitude.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@portugal-medicines-mcp Is Ozempic in shortage in Porto, and which pharmacies are on duty today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
portugal-medicines-mcp
Deprecated — use portugal-mcp instead. This server now lives on as the medicamentos feature of portugal-mcp, together with IPMA weather, INE, Banco de Portugal, Parliament, public contracts and more. Install with uvx portugal-mcp (add PORTUGAL_MCP_FEATURES=medicamentos to load only this part). Tool names: availability → medicine_availability, where_to_get_help → medicine_help; pharmacies and find_medicine_near keep their names. This repository gets no further updates.
MCP server that helps answer "I need medicine X in city Y. What do I do?" in Portugal, so Claude (or any MCP client) can say whether a medicine has a reported shortage, which pharmacies are on duty or open now, and who to call.
Read-only, no key, no account. It uses only public sources. Not affiliated with Infarmed, the SNS, SPMS, the Associação Nacional das Farmácias or farmaciasdeservico.net.
Pharmacy stock is not public in Portugal. Only pharmacies and distributors can see it. This server never says a pharmacy has a medicine: call the pharmacy, or call Linha 1400, to confirm.
Not medical advice. It is informational only. Never switch, stop or substitute a medicine without a pharmacist or doctor. In an emergency call 112. For health advice call SNS 24 on 808 24 24 24.
Tools
find_medicine_near
The one-shot answer. Checks the medicine's availability, lists the pharmacies on duty today and the ones open now in the city (nearest first if you give a position), and returns the help lines and next steps.
Parameters: medicine, city (or lat / lon), limit.
availability
Is a medicine in shortage? Searches by brand or active substance (Portuguese names work best: "quetiapina", "Ozempic", "ácido acetilsalicílico"; add a strength or form to narrow it). It checks three things Infarmed publishes on www.infarmed.pt:
shortages under monitoring: the situations Infarmed is actively following, with its advice and circulars;
export temporarily suspended: the monthly list of medicines whose export or distribution to other EU countries is suspended because of shortage or supply risk in Portugal;
prior-notification list (LNP): the quarterly list of medicines with availability concerns or critical medicines.
The latest lists are found automatically on Infarmed's availability page. status is one or more of monitored_shortage, export_suspended, prior_notification, no_issue_in_published_lists. "No issue" does not prove the medicine is available: see What this server does not do.
Parameters: medicine, limit.
pharmacies
Pharmacies in a municipality (concelho), with address, phone, coordinates, today's hours, whether each one is open now and whether it is on duty today (official roster, duty day 09:00 to 09:00), with the duty type (for example "Permanente - Aberta 24h"). Sorted: on duty first, then open now, then distance.
Parameters: city (municipality, town or parish: "Lisboa", "Porto", "Alvalade, Lisboa"), lat / lon (adds distance_km; with no city, the municipality is found from the coordinate), radius_km, on_duty_only, open_now_only, limit. Only one municipality is covered per call.
where_to_get_help
The help lines below, each with the page it was checked on.
Related MCP server: stillshort
Help lines
Line | Number | What for | Checked on |
Emergency (INEM) | 112 | Risk to life or a serious situation | |
SNS 24 | 808 24 24 24 | Health advice when it is not an emergency | |
Linha 1400 | 1400 | Run by the pharmacies (ANF). Finds a pharmacy that can supply a medicine with reduced availability; also tells you the pharmacies on duty. 24 hours a day. Free from 19:00 to 09:00 and on weekends and national holidays; EUR 0.10/min from 09:00 to 19:00. Online form at 1400safe.pt. | 1400safe.pt (the line's own site; not found on an SNS, Infarmed or gov.pt page) |
Infarmed, Linha do Medicamento | 800 222 444 | Infarmed's medicines information centre (CIMI) | Contact block of Infarmed circulars (hours not stated) |
Install
Quickest (needs uv): no clone needed, it runs straight from PyPI.
claude mcp add portugal-medicines -- uvx portugal-medicines-mcpFor Claude Desktop, use "command": "uvx", "args": ["portugal-medicines-mcp"].
From source:
Requires Python 3.10+.
git clone https://github.com/ThiagoJacobLannes/portugal-medicines-mcp
cd portugal-medicines-mcp
python -m pip install -e .On Windows, if you keep code in a cloud-synced folder (Google Drive, OneDrive), create the virtual environment outside it. Sync clients drop desktop.ini files into folders, which can crash packages on startup.
Add to Claude Code
claude mcp add portugal-medicines -- python -m portugal_medicines_mcp.serverAdd to Claude Desktop
Merge claude_desktop_config.snippet.json into your Claude Desktop claude_desktop_config.json, then restart Claude Desktop:
{
"mcpServers": {
"portugal-medicines": {
"command": "python",
"args": ["-m", "portugal_medicines_mcp.server"]
}
}
}Data sources
Source | What it gives | Access | Terms |
Shortages under monitoring; links to the lists in force | Public page; www.infarmed.pt's robots.txt allows crawling | No open-data licence stated on the page. Public-sector information; cite Infarmed as the source. | |
Infarmed export lists (.xlsx, linked from the page above) | Medicines with export temporarily suspended (monthly); prior-notification list (quarterly) | Public download | Same as above. |
Every pharmacy per municipality, with address, phone, map position, today's hours and the duty roster | Public pages; robots.txt allows all | Owned by 1000 Empresas, Lda. Its terms allow reproducing content with the source cited, and say the information may be incomplete or out of date. It also sells a paid webservice for commercial use; this server reads the public pages on demand for personal use. | |
Turns a coordinate into a municipality (only when you give lat/lon without a city) | Public API, at most 1 request/second, identifying User-Agent | Data © OpenStreetMap contributors, ODbL. Usage policy. |
Data from these sources keeps the source's terms. The code in this repository is MIT-licensed.
What this server does not do
No pharmacy stock. It is not public, and this server does not try to get it.
No Infomed and no full shortage search. Infarmed's medicine database (Infomed) and its per-medicine shortage and discontinuation search are on
extranet.infarmed.pt, and that host'srobots.txtsaysDisallow: /for all automated clients. The online Prontuário Terapêutico (app10.infarmed.pt/prontuario/) is disallowed too. So this server does not search medicines, list presentations, prices, reimbursement or generics, or look up the full shortage database. Use those sites in a browser. If Infarmed publishes an open dataset or allows automated access, these features can be added.No keys taken from other people's apps or web pages, and no bypassing of bot protection.
How it works
The server uses httpx with one session, a User-Agent naming this project, and at most one request per second per site. It reads Infarmed's availability page and the two spreadsheets it links (re-read every 6 hours, so the new monthly list is picked up automatically), and the farmaciasdeservico.net pages for one municipality (two pages, cached for 15 minutes). Medicine names are matched without regard to accents or case. If a page or spreadsheet changes shape, the tool returns a clear {"error": ...} instead of guessing.
License
MIT
Available Tools
4 toolsavailabilityA
Is a medicine in shortage in Portugal? Checks Infarmed's published availability information.
Use when someone can't find a medicine, or asks whether X is in shortage ("rutura", "esgotado", "falta"). Searches by brand or active substance (Portuguese names work best, e.g. "quetiapina", "Ozempic", "ácido acetilsalicílico"; dose and form narrow it, e.g. "quetiapina 300 mg libertação prolongada").
Checks, all from www.infarmed.pt (latest versions are found automatically):
shortages Infarmed is actively monitoring (with its circulars and advice);
the monthly list of medicines whose export is temporarily suspended because of shortage / supply risk in Portugal;
the quarterly prior-notification list (LNP) of medicines with availability concerns.
status is one or more of: monitored_shortage, export_suspended, prior_notification, no_issue_in_published_lists. "No issue" does not prove the medicine is available: Infarmed's full shortage search is not queried (see not_checked).
Args: medicine: Brand name or active substance, optionally with strength/form. limit: Max rows returned per list (default 15).
Inputs: medicine (required), limit. Returns: object
find_medicine_nearA
One-shot answer to "I need medicine X in city Y — what do I do?" in Portugal.
Runs availability(medicine) and pharmacies(city or lat/lon), and returns: the shortage status (compact), the pharmacies on duty today and the ones open now (nearest first when lat/lon are given), the help lines (Linha 1400, SNS 24, 112) and next steps. It never says a pharmacy has the medicine: stock is not public.
Args: medicine: Brand name or active substance, e.g. "quetiapina", "Brufen 400". city: Municipality or town, e.g. "Lisboa". Or give lat/lon instead. lat, lon: Optional user position (sorts pharmacies by distance). limit: Max pharmacies returned (default 8).
Inputs: medicine (required), lat, lon, city, +1 more. Returns: object
pharmaciesA
Pharmacies in a Portuguese municipality, with which ones are on duty today and open now.
Use for "farmácia de serviço em X", "pharmacy open now near me", or to list pharmacies to call. Each pharmacy has name, address, phone, coordinates, today's hours, open_now, on_duty (official duty roster for the duty day 09:00-09:00) and the duty type (e.g. "Permanente - Aberta 24h"). Results are sorted: on duty first, then open now, then distance (when lat/lon are given). Stock is not public: never say a pharmacy has a medicine.
Args: city: Municipality or town/parish, e.g. "Lisboa", "Porto", "Cascais", "Alvalade, Lisboa" (add ", " to disambiguate a town). lat, lon: Optional user position: adds distance_km and allows radius_km. With no city, the municipality is found from the coordinate. radius_km: Keep only pharmacies within this distance of lat/lon. on_duty_only: Only pharmacies on the duty roster today. open_now_only: Only pharmacies open right now. limit: Max pharmacies returned (default 20, max 100).
Inputs: lat, lon, city, limit, +3 more. Returns: object
where_to_get_helpA
Verified help lines in Portugal for medicine problems: 112, SNS 24, Linha 1400, Infarmed.
Use when someone can't find a medicine, needs urgent advice, or asks who to call. Each line has its number, what it is for, hours where published, and the page it was checked on.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
find_medicine_near overlaps with availability, pharmacies, and where_to_get_help by composing them, but its one-shot role is clearly described and the atomic tools have distinct scopes. An agent could occasionally choose the composite versus combining atomics, but the boundaries are mostly clear.
All names use snake_case, but the conventions are mixed: find_medicine_near and where_to_get_help are verb-like, while availability and pharmacies are bare nouns. They remain readable but are not fully predictable as a set.
Four tools are well-scoped and each earns its place: shortage status, pharmacy lookup, help lines, and a one-shot workflow tool. The count fits the narrow domain without feeling thin or bloated.
The surface covers the core journey: check shortage status, locate pharmacies on duty/open now, get verified help lines, and answer the combined user question. Minor gaps remain, such as no direct Infarmed full shortage search or detailed medicine record, but the tools explicitly note those limits.
Maintenance
Related MCP Connectors
Which drugs are in shortage right now? FDA shortage status, reasons and availability.
Medicine names, label text, safety reports, recalls, shortages and approvals from regulators
Free health AI: drug interaction checks, medicine facts and health questions in 90+ languages
Official Brazilian medicine prices (CMED/ANVISA) by name, active ingredient or barcode.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceQuery the official Spanish medicines database (AEMPS CIMA) for authorized medicines, their details, and real-time supply shortage alerts without requiring an API key.-
- AlicenseNot gradedqualityCmaintenanceEnables voice-assistant users to follow FDA drug shortage registrations, manage a watchlist of substances, and ask what has changed since their last check.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to look up French medicine shortages and supply tensions from ANSM and public BDPM data — searching a medicine's shortage status, history and expected return, listing current shortages with filters, tracking recent changes, and checking major-therapeutic-interest (MITM) status. Every result carries its sources, update dates, coverage caveats and a disclaimer.MIT
- AlicenseAqualityFmaintenanceEnables querying Portugal's official SNS open-data statistics — hospital and health-unit locations, emergency visits by triage colour, surgical and consultation waiting lists, and all 149 Transparency portal datasets — from any MCP client. Read-only and keyless, it returns monthly national, regional or per-institution figures and can run custom ODSQL queries for anything the curated tools miss.624 PyPIMIT