MedEx MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MedEx API + MCP
An API and Model Context Protocol (MCP) server for Bangladesh medicine information.
Important — data source: This project ships with a synthetic fixture provider by default. It does not serve live MedEx data. No official or licensed MedEx API was available, and no written authorization to scrape or redistribute MedEx's database exists. Every default record is marked
source.kind: "fixture"and must never be used for clinical decisions. See DATA_SOURCES.md for the full authorization status and how to plug in an authorized live provider.
What it does
Exposes medicine, generic, manufacturer, and category information over a versioned REST API (
/api/v1).Exposes the same capabilities as MCP tools so AI agents (including Hermes Agent) can query the data with structured, validated inputs.
Ships with everything wired to a local fixture dataset so it runs offline with zero credentials — ideal for development, testing, and demos.
Related MCP server: Medical MCP Server
Architecture
┌────────────────────┐
REST clients ─▶ │
│ Express API │──┐
AI agents ───▶ (src/api) │ │ Provider interface
(MCP) │ │ │ (src/provider/provider.ts)
└────────────────────┘ │
┌────────────────────┐ │ ▲
MCP client ──▶│ MCP server │──┘ │
(stdio) │ (src/mcp) │ FixtureProvider (default)
└────────────────────┘ (src/provider/fixture-provider.ts)
▲ reads
fixtures/medex-fixtures.jsonTwo entry points share one Provider interface:
REST API (
src/api) — Express app with validation, rate limiting, security headers, and consistent error envelopes.MCP server (
src/mcp) — MCP SDK server exposing the provider as tools over stdio.
Provider-specific data access is kept behind the Provider interface, so the
routes and MCP tools never touch the data source directly. Swapping in an
authorized live provider means adding one implementation and selecting it via
MEDEX_PROVIDER — no route or tool changes.
Implemented API endpoints
Method | Path | Description |
GET |
| Service health + provider info |
GET |
| Readiness probe |
GET |
| Search medicines |
GET |
| Get a medicine by id |
GET |
| Search generics |
GET |
| Get a generic by id |
GET |
| List manufacturers |
GET |
| Get a manufacturer by id |
GET |
| List a manufacturer's medicines |
GET |
| List categories |
GET |
| Get a category by id |
GET |
| List a category's medicines |
Full request/response schemas: openapi.yaml · prose docs: API.md.
Implemented MCP tools
Tool | Description |
| Search brands by name, generic, ingredient, or manufacturer |
| Retrieve one medicine by id |
| Search generic / active-ingredient entries |
| Retrieve one generic by id |
| List manufacturers (optional name filter) |
| Retrieve one manufacturer by id |
| List a manufacturer's brands |
| List therapeutic categories |
| List a category's brands |
Connection details for agents: MCP.md.
Installation
Requires Node.js ≥ 20 (developed and tested on Node 26).
git clone https://github.com/shoaibsanto/medex-api-mcp.git
cd medex-api-mcp
npm install
npm run buildLocal development
# Start the REST API on http://127.0.0.1:3000
npm start
# Or run in watch mode during development
npm run dev
# Start the MCP server on stdio
npm run mcpConfiguration is read from environment variables (see .env.example):
Variable | Default | Purpose |
|
| API port |
|
| Bind address |
|
| Data provider ( |
|
| CORS origin(s), comma-separated |
|
| Requests per window per IP |
|
| Rate-limit window (15 min) |
Running tests
npm run typecheck # TypeScript, no emit
npm test # vitest: unit + API + MCP + validation + rate-limit
npm run build # compile to dist/The suite covers provider unit behaviour, REST integration (including 400/404 validation and error paths), MCP tool registration and structured output, API↔MCP data consistency, rate limiting, CORS, and security headers.
Connecting the MCP server to an AI agent
The MCP server speaks stdio. Add it to your agent's MCP config. For Hermes Agent, the relevant block is:
mcp_servers:
medex:
command: node
args:
- /absolute/path/to/medex-api-mcp/dist/mcp/index.jsThe REST API is the default integration boundary for anything that prefers HTTP. See MCP.md for details and tool schemas.
Data-source authorization and limitations
Default provider = synthetic fixtures. No live MedEx data is served or redistributed by this repository.
MedEx has a privacy policy but no terms-of-service page, no official API, and no published licensing terms for automated collection or redistribution. Its
robots.txtis permissive, but that governs crawling access — it is not a copyright or database license.The fixtures are fictional records (fictional brands, manufacturers, and prices) that exist solely to exercise the API and MCP code paths.
To use real data you must obtain written authorization and an official or licensed feed, then implement a
Providerand select it withMEDEX_PROVIDER=live. Thelivecase currently throws deliberately rather than silently serving fixtures.
See DATA_SOURCES.md for the full write-up.
Security and responsible use
No secrets are committed. Configuration uses
.env(git-ignored) with placeholders in.env.example.The API sets security headers (helmet), enforces input validation, applies rate limiting, and returns consistent error envelopes without stack traces.
This project is intended for informational, developer, and research use. Medicine information is not a substitute for professional medical advice. Never present fixture data as verified clinical information.
See SECURITY.md.
Project status
v0.1.0 — functional MVP.
✅ REST API implemented and tested
✅ MCP server implemented and tested (stdio)
✅ Synthetic fixture provider, extensible
Providerseam✅ OpenAPI spec, docs, CI workflow
⏳ Authorized live provider: not implemented (requires authorization)
See CHANGELOG.md.
License
Source code in this repository is released under the MIT License. This applies to the code only — not to any third-party medicine data. See DATA_SOURCES.md for why no upstream data is redistributed.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
A registry of AI agent tools — MCP servers, APIs, CLIs, SDKs — kept current by automated ingestion.
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Machine-readable utilities and datasets for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to query authoritative medical sources such as FDA, WHO, PubMed, RxNorm, and ClinicalTrials.gov for drug information, safety data, health statistics, clinical guidelines, pediatric resources, and evidence-graded literature. Runs locally with no API keys or data leaving the machine.83 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to query authoritative medical sources such as FDA, WHO, PubMed, RxNorm, and ClinicalTrials.gov for drug information, safety data, health statistics, medical literature, clinical guidelines, and pediatric resources. Runs fully locally with no API keys or data leaving the machine, and includes resilience features like rate limiting, circuit breakers, caching, and health checks.83 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI clients to query authoritative medical sources such as FDA, WHO, PubMed, RxNorm, and ClinicalTrials.gov for drug information, medical literature, health statistics, clinical guidelines, and pediatric resources through local MCP tools.83 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants and MCP clients to query authoritative medical APIs for drug information, health statistics, medical literature, clinical guidelines, clinical trials, and pediatric resources. Runs locally without API keys, providing private access to sources such as FDA, WHO, PubMed, RxNorm, and Google Scholar.83 npmISC