MCP AEMPS — CIMA
io.github.romanpertPublished by GitHub account romanpertv0.5.0Updated Oct 24, 2026
MCP server for the Spanish AEMPS CIMA pharmaceutical registry (20,000+ authorised medicines).
Overview
Read-only MCP server for the Spanish AEMPS CIMA medicines registry, letting an assistant look up authorised medicines, leaflets and supply problems.
- What you can do
- Look up and search medicines, presentations and master data (ATC codes, active ingredients, forms, laboratories) with filters and pagination, plus change history and clinical equivalents (VMP/VMPP). Retrieve official documents: technical sheet and leaflet sections or full HTML, informative materials and safety notes. Check current supply problems by code, DCP or DCPF. Expose curated cima:// resources for master data and document sections, and invoke ready-made prompts for pharmacy, hospital, industry and patient-counselling workflows.
- When to use it
- Useful when an assistant must answer questions from the official Spanish medicines registry: technical-sheet sections, adverse effects, supply shortages, pharmacovigilance notes, generic substitution or regulatory change tracking. It is aimed at pharmacy, hospital, industry and regulatory-affairs work rather than general web lookup.
- Requirements
- Runs locally as a Python package (mcp-aemps) via uvx, pip or pipx, or as a Docker container; stdio is the default transport, with an optional HTTP mode on port 8765. No credentials are required and it starts with sensible defaults. Optional settings include REDIS_URL for shared cache and rate limiting, and OAuth variables for multi-tenant HTTP deployments. Network access to the public AEMPS CIMA API is needed.
Installation
In SourceWeft
- Open MCP AEMPS — CIMA in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-aemps
Datos farmacéuticos oficiales, listos para tu agente.
El primer servidor MCP open-source para la industria farmacéutica. 20.000+ medicamentos AEMPS, en tiempo real, regulator-grade.
🇪🇸 Español · 🇬🇧 English
[PyPI]
[npm]
[GHCR]
[Python versions]
[PyPI downloads]
[License]
[CI]
[MCP Registry]
[CIMA API v1.23]
Lo que tu agente puede hacer
Conecta tu asistente — Claude, ChatGPT, Gemini, Cursor, Continue, Zed, Junie — al registro oficial AEMPS / CIMA. Sin scrapers. Sin hardcoded snapshots. Sin patient data. Cada respuesta cita endpoint REST oficial y fecha de consulta.
Tú: «¿Qué efectos adversos graves aparecen en la ficha técnica de HUMIRA 40 mg?» Tu agente consulta
obtener_medicamento→doc_contenido(sección 4.8 de la FT) → devuelve estructurado, con timestamp y fuente AEMPS.
Tú: «Lista los problemas de suministro vigentes para omeprazol 20 mg cápsulas.» Tu agente llama
problemas_suministro_dcpf→ devuelve los lotes afectados, fechas previstas de retorno y alternativas terapéuticas equivalentes.
Tú: «¿Qué notas de farmacovigilancia ha publicado AEMPS sobre inhibidores SGLT2 en los últimos 6 meses?» Tu agente filtra
listar_notas+ recuperaobtener_notas→ resumen accionable con enlaces oficiales.
Tú: «Dame un equivalente clínico (mismo VMP) para simvastatina 20 mg comprimidos sin lactosa.» Tu agente cruza
buscar_vmpp+buscar_en_ficha_tecnica("lactosa")→ propone alternativas con autorización AEMPS vigente y excipientes confirmados.
Tú: «¿Qué cambia entre la FT actual de Eliquis y la versión publicada hace 90 días?» Tu agente invoca el prompt curado
monitorizar_cambios_cartera→ diff por sección sobre la documentación oficial.
10 prompts curados más, cubriendo farmacia comunitaria, hospitalaria, industria y counseling al paciente — listos para invocar como slash-commands en tu cliente MCP.
Instalación en 30 segundos
¿Sin Python en la máquina? Hay tres alternativas equivalentes:
Reinicia tu cliente MCP. El servidor aparece como mcp-aemps. Listo.
💡 Sin servidor que mantener. Por defecto los instaladores configuran el cliente para lanzar
uvx mcp-aemps@latest stdiobajo demanda — el agente arranca el servidor cuando lo necesita y lo apaga cuando termina. Para despliegues compartidos / multi-tenant ver Despliegue.
Compatibilidad — un comando, 11 clientes
Los instaladores son idempotentes (re-ejecuta sin miedo), atómicos (la escritura se completa entera o no se aplica), additive (preservan tus otras entradas), port-aware (leen el puerto real bound por mcp-aemps up), y purgan automáticamente aliases legacy (aemps-cima, etc.) para limpiar instalaciones de versiones antiguas. mcp-aemps install (sin subcomando) configura todos los detectados a la vez.
Por qué mcp-aemps
🏛️ Regulator-grade. Cada respuesta cita endpoint CIMA REST oficialmente documentado + timestamp. Audit trail por petición vía logs JSON estructurados (alineado con EU GMP Annex 11). Sin alucinación, sin datos derivados — solo el registro AEMPS publicado, expuesto tal cual.
🔒 Read-only por construcción. Proxy fino sobre la API pública AEMPS. Cero escrituras. Cero PII procesada. Cero clinical decision support — esto NO es un dispositivo médico (MDR 2017/745 no aplica). Detalles del threat model en SECURITY.md.
🌐 Estándar abierto. Apache-2.0. Listado en registry.modelcontextprotocol.io. Implementación de referencia para servidores MCP en sectores regulados — quien quiera mirror oficial de su propio NCA (EMA, AIFA, Swissmedic, …) tiene aquí el blueprint.
Catálogo
21 herramientas MCP — todas mapean 1:1 a endpoints CIMA REST oficiales
Todas las tools llevan anotaciones MCP — readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true — para que clientes spec-compliant no pidan confirmación por consulta.
11 recursos curados bajo el esquema URI cima:// — cacheables, sin coste de tokens
Recursos estáticos:
Templates:
10 prompts MCP curados — workflows profesionales y de paciente listos para invocar
Los prompts dirigidos a pacientes cierran siempre con un disclaimer "no es consejo médico" — cubierto por test (tests/test_prompts.py); su eliminación rompe CI.
Configuración
Cero variables requeridas — el servidor arranca con defaults sensatos. Las opciones más usadas:
OAuth 2.1: cinco env vars (OAUTH_ISSUER, OAUTH_JWKS_URL, OAUTH_AUDIENCE, OAUTH_REQUIRED_SCOPES). RFC 9728 Protected Resource Metadata expuesto en /.well-known/oauth-protected-resource. Sin Authorization Server embebido — bring your own (Auth0 / Keycloak / Hydra / Stytch / Cloudflare). Detalles en SECURITY.md.
Despliegue
stdio (default). Cada cliente MCP arranca uvx mcp-aemps@latest stdio bajo demanda. Sin servidor que mantener. Sin gestión de puertos. Es el patrón Anthropic-canonical — usa esto si solo quieres que tu agente local consulte CIMA.
HTTP compartido (multi-usuario). mcp-aemps up --bind-all + reverse-proxy (nginx / Caddy / Traefik) + MCP_AEMPS_DNS_REBINDING_PROTECTION=true + MCP_AEMPS_ALLOWED_HOSTS=tu-dominio.com. Con OAuth 2.1 activado para gating. Una sola instancia sirve a equipos enteros.
Docker / Compose.
MCP Registry. Listado como io.github.romanpert/mcp-aemps. Los clientes MCP-aware lo descubren automáticamente.
Observabilidad. /health/live, /health/ready (Kubernetes-friendly), /internal/metrics (gated por METRICS_KEY). Logs JSON estructurados con correlation IDs. Para Prometheus / OpenTelemetry, plug-in vía extra_middleware / startup_hooks del factory — ver app/factory.py.
Hooks de auditoría (Claude Code)
El sistema de hooks de Claude Code ejecuta comandos shell client-side alrededor de cada llamada a tool. El matcher mcp__mcp-aemps__* captura cada herramienta de este servidor — útil para audit trails GMP Annex 11 / EMA GVP.
Equivalente server-side disponible vía pre_tool_hooks / post_tool_hooks en create_app(...) — útil cuando no puedes confiar en que cada usuario tenga el ~/.claude/settings.json correcto. Detalles en app/tool_hooks.py.
Compliance y seguridad
mcp-aemps está construido para entornos regulados — sin sustituir el juicio profesional:
- Datos públicos AEMPS — sin PII, sin patient data, sin clinical decision support.
- Audit trail — logs JSON estructurados con correlation IDs, retención configurable (
LOG_RETENTION_DAYS). - Sin GPL en el paquete — Apache-2.0 limpio, distribuible en stack farmacéutico privado.
- Threat model auditado — STRIDE pass end-to-end por release. Política completa en SECURITY.md.
- Disclosure coordinada —
[email protected], triage en 48h.
Posture detallada (GDPR Art.5, LOPD-GDD, EU GMP Annex 11, EMA GVP Module VI): CLAUDE.md.
Roadmap & versioning
mcp-aemps mirrorea el surface CIMA REST 1:1 — ni más, ni menos. Las mejoras hasta v1.0 son calidad (eficiencia, seguridad, escalabilidad, modularidad), no nuevas features.
Add-ons que NO encajan en esta scope rule (extracción de PDF de IPT, descarga de imágenes de medicamentos, agregación multi-NCA, push notifications) viven en un repo separado, premium-tier, que importa este mcp-aemps>=0.4.x desde PyPI como dependencia.
CHANGELOG completo: CHANGELOG.md. Política de versionado en CLAUDE.md.
Contribuir
Issues y PRs en inglés. Conventional commits. Setup, estándares de código, y las hard scope rules en CONTRIBUTING.md.
Si construyes algo serio sobre mcp-aemps en producción farmacéutica / hospitalaria, escríbeme — me interesa el use case, y los road-map items se priorizan en parte por demanda concreta.
Licencia & autor
Apache-2.0 · Author: Román Pérez Dumpert · [email protected]
MCP Registry identifier: mcp-name: io.github.romanpert/mcp-aemps
Source: README.md at commit 3eb4985
Tools
0Version history
1- v0.5.0LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.