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-mcpIs 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: Spain Medicines Intelligence MCP
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).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| medicine | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden and does so well: it names the three distinct Infarmed datasets queried, states that latest versions are found automatically, enumerates the possible status values, and warns that a negative result is not proof of availability. It omits operational traits such as authentication, rate limits, or latency, which keeps it from a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with a one-line statement of what it answers, followed by usage triggers, then the enumerated data sources. The trailing Args block largely restates the schema, and the three-bullet source list is dense, but each element carries genuine information for the caller.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-parameter lookup with an output schema present, the description supplies everything needed: data provenance, the meaning of every possible status value, the caveat about false negatives, and input formatting guidance. No behavioural or interpretive gap remains for an agent deciding whether to trust a negative result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, and the description fully compensates: 'medicine' is explained as brand or active substance with optional strength/form, with concrete Portuguese examples ("quetiapina", "Ozempic", "ácido acetilsalicílico") and a narrowing example. 'limit' is clarified as max rows per list with its default, which is more precise than the bare integer schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: answers whether a medicine is in shortage in Portugal, sourced from Infarmed. The opening question form plus the explicit source make it immediately distinguishable from siblings like find_medicine_near and pharmacies, which address where to obtain a medicine rather than whether it is in shortage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete trigger conditions ("Use when someone can't find a medicine, or asks whether X is in shortage") including the Portuguese keywords users actually type. It also sets expectations about coverage ("No issue" does not prove availability; the full shortage search is not queried). It does not explicitly name a sibling as the alternative when this tool is the wrong choice, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| lat | No | ||
| lon | No | ||
| city | No | ||
| limit | No | ||
| medicine | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations supplied, the description carries the burden and does it well: it discloses exactly what is returned (shortage status, on-duty and currently-open pharmacies, help lines Linha 1400/SNS 24/112, next steps) and a critical behavioral caveat — it never asserts a pharmacy has the medicine because stock is not public. It omits any note on auth, rate limits, or failure behavior for unknown cities.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the question it answers, then the internal composition, then the return payload, then a clean Args block — a logical order with no filler sentences. Slightly verbose in the returns enumeration, but every clause conveys usable information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a five-parameter composite tool with an output schema, the description covers inputs, upstream sources, return contents, and the key limitation on what it can claim about stock. An agent has everything needed to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does: all five parameters are explained with examples (medicine as brand name or active substance, e.g. "quetiapina"/"Brufen 400"; city as municipality; lat/lon as optional position that triggers distance sorting; limit as max pharmacies with default 8). The city-vs-lat/lon substitution rule adds meaning the schema cannot express.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific user question it answers and explicitly names the two underlying operations it wraps (availability and pharmacies), so an agent can see it is a composite orchestrator rather than a primitive. The resource (medicine availability + pharmacy locations in Portugal) is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The framing "One-shot answer to 'I need medicine X in city Y — what do I do?'" gives clear usage context, and the Args section explicitly says to supply city OR lat/lon. It stops short of explicitly telling the agent to prefer this over calling availability and pharmacies separately, though that is strongly implied by listing them as internal steps.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| lat | No | ||
| lon | No | ||
| city | No | ||
| limit | No | ||
| radius_km | No | ||
| on_duty_only | No | ||
| open_now_only | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so: it discloses the returned fields, the sort order (on-duty, then open-now, then distance), the duty-day boundary definition (09:00–09:00), that on_duty comes from an official roster, and the lat/lon-without-city fallback behavior. These are non-obvious traits an agent could not infer from the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with purpose, then uses cases, then return shape and caveat, then args — a sensible order with no filler. The Args block is long but justified at 0% schema coverage; minor duplication with the earlier field list is the only waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An optional-everything seven-parameter tool with no annotations and no schema descriptions still leaves no ambiguity: all params, their interactions, the sort order, and the correctness caveat about stock are covered. The output schema means the return-value enumeration is a bonus rather than a necessity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description is the sole documentation and it fully compensates: every one of the seven parameters is explained, city includes disambiguation examples, radius_km is tied to lat/lon availability, and limit states the default 20 / max 100. The dependency rules (radius requires position) are stated explicitly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Opens with a specific verb+resource+scope: pharmacies within a Portuguese municipality, with duty status and open-now status. It is clearly distinguishable from stock-oriented siblings (medicine_availability, find_medicine_near) because it explicitly states stock is not public.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete trigger phrases ("farmácia de serviço em X", "pharmacy open now near me", "list pharmacies to call") and an explicit when-not: never claim a pharmacy stocks a medicine. That exclusion routes the agent away from the wrong use without needing the sibling list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden. It usefully states that the lines are verified and include source-checking details and hours where published, but it does not explicitly describe the operation as static/read-only or clarify freshness guarantees beyond the word 'verified'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded: it first states the resource and covered lines, then the use cases, then the returned detail. Every sentence contributes without filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter informational tool with an output schema, the description provides enough context about purpose, activation scenarios, and record contents. A minor gap is the absence of explicit sibling routing or exclusions, but the core task is clear.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. There are no parameter semantics to explain, and the description does not need to compensate for an input schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the resource as verified medicine help lines in Portugal and names the specific lines covered. It is readily distinguishable from siblings like find_medicine_near and pharmacies, though it uses a noun phrase rather than an explicit verb such as 'list' or 'return'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit usage contexts: when someone cannot find a medicine, needs urgent advice, or asks who to call. It does not name alternatives or state when not to use this tool versus find_medicine_near, availability, or pharmacies.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.1- First observed
availability - First observed
find_medicine_near - First observed
pharmacies - First observed
where_to_get_help
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.
Related MCP Connectors
Which drugs are in shortage right now? FDA shortage status, reasons and availability.
Free health AI: drug interaction checks, medicine facts and health questions in 90+ languages
Report pharmacy stock, and post a pharmacy's verified status, from your AI assistant.
US medication lookup: drug search, forms and strengths, NDC/RxCUI, recalls, shortages.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query the official Spanish AEMPS/CIMA registry for real-time pharmaceutical data, including medications, supply problems, and clinical equivalences.93 PyPI1Apache 2.0
- 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 gradedqualityBmaintenanceEnables 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 gradedqualityAmaintenanceEnables 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