Search and export FDA drug labels by brand name, generic ingredient, or UNII code.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
MedRecPro is a pharmaceutical structured product label (SPL) management platform built with ASP.NET Core. It provides secure access to FDA drug label data through a RESTful API, an AI-powered chat interface, a Model Context Protocol (MCP) server for integration with AI assistants like Claude, and an interactive adverse-event risk dashboard built on a multi-stage table-standardization and risk-statistics pipeline.
sub, name, email)IExceptionHandler with sanitized RFC 7807 ProblemDetails responses and request trace correlationWebApplicationFactory<Program>, kept-open SQLite test databases, reviewed Debug/Release OpenAPI snapshots, and real-host HTTP contractsThe solution's three web projects are deployed to a single Azure App Service using IIS virtual applications (the console, library, React SPA source, prototypes, and test projects are not deployed as separate apps):
| Virtual Path | Project | Purpose |
|---|---|---|
/ | MedRecProStatic | Static site, marketing pages, AI chat UI, OAuth/MCP discovery metadata, adverse-event dashboard host |
/adverse-events | MedRecProReact (hosted by MedRecProStatic) | Adverse-event risk dashboard React island |
/api | MedRecPro | REST API: SPL upload/progress boundary, label CRUD, authentication, AI interpret/synthesize, adverse-event dashboard data |
/mcp | MedRecProMCP | MCP server: OAuth 2.1 gateway for Claude.ai integration |
| (CLI) | MedRecProConsole | Standalone bulk import utility over the shared import library (SPL labels, FDA Orange Book, and table standardization) |
| (library) | MedRecProImportClass | Shared class library: entity models, parsing services, table-standardization pipeline, and EF Core context for SPL and Orange Book import |
| (SPA source) | MedRecProReact | React + Vite source for the adverse-event dashboard; builds into MedRecProStatic's web root |
| (prototypes) | MedRecProPrototypes | Standalone HTML/JS prototypes (e.g. the AE dashboard) that seed production UI work |
| (test) | MedRecProTest | MSTest unit, relational, real-host integration, architecture, and Debug/Release contract coverage |
MedRecPro.sln is the focused API/import/test solution. It intentionally contains MedRecPro, MedRecProImportClass, and MedRecProTest; the test project references MedRecProConsole, so the CLI stays in the regular regression build without making the solution responsible for every deployed app. MedRecProStatic and MedRecProMCP are separately deployed IIS virtual applications and should be built or published explicitly when their code changes:
If a local apphost executable is locked by a running process, keep output inside the workspace and disable apphost generation for the verification pass, for example dotnet build .\MedRecPro.sln --no-restore -p:UseAppHost=false -p:BaseOutputPath=.\MedRecPro\.codex-build\. The API project excludes bin/** and .codex-build/** from default item globbing so copied RazorLight templates from generated output cannot re-enter compilation when BaseOutputPath is redirected.
MedRecProStatic is the user-facing front end. Its AI chat interface (/Home/Chat) communicates with the API using a request-interpret-execute-synthesize pattern: user queries are sent to the API's AI endpoints, which use Claude to map natural language to API calls. The static site also serves OAuth/MCP discovery metadata (/.well-known/*) at the domain root on behalf of the MCP server, because the MCP SDK resolves discovery URLs relative to the domain root rather than the /mcp path.
MedRecPro (API) is the core backend. It handles label data CRUD, user authentication, AI query interpretation via Claude, database views for navigation, SPL document rendering via RazorLight templates, and the HTTP/progress boundary for SPL ZIP uploads. The public Label surface remains one 51-operation /api/Label route family, but its implementation is split across small feature controllers and injected query/operation services. The former DtoLabelAccess implementation is now owned by those services; one forwarding-only static facade remains for external .NET compatibility. The actual SPL ZIP traversal, XML parsing, duplicate checks, and parser orchestration live in MedRecProImportClass; the API keeps thin compatibility adapters and maps import-library result DTOs back into the web import-progress models.
MedRecProMCP is an OAuth 2.1 gateway that exposes MedRecPro API capabilities as MCP tools. When Claude.ai connects, it authenticates users through Google/Microsoft OAuth, resolves upstream identity provider identities to numeric database user IDs (auto-provisioning new users if needed), then forwards authenticated MCP JWTs to the MedRecPro API. It uses JWT tokens, PKCE (S256), Dynamic Client Registration (RFC 7591), and a shared PKSecret for encrypted user ID exchange with the API.
MedRecProReact is the source for the adverse-event risk dashboard β a React + Vite single-page "island". Its Vite build emits a deterministic bundle directly into MedRecProStatic/wwwroot/ae-dashboard, which MedRecProStatic serves at /adverse-events. The dashboard reads only from the API's /api/AdverseEvent surface (AdverseEventController), which in turn queries the materialized AE risk tables produced by the table-standardization pipeline (Stage 5). Current dashboard focuses cover product-level risk, pharmacologic-class SOC correlation, and MedDRA-system-scoped class correlation. See the MedRecProReact README for the dashboard, and the MedRecProImportClass README for the risk-statistics contract.
| Area | Current design |
|---|---|
| Startup | Program.cs is an ordered composition shell. Capability-focused extensions under MedRecPro/Configuration own data access, platform services, authentication, MVC, Swagger, middleware, rendering, import, and background-service registration. |
| Feature routing | ApiControllerBase retains the compile-time Debug/Release prefix split. FeatureControllerNameConvention applies each split controller's FeatureControllerNameAttribute value, so implementation class names never leak into routes. |
| Controller ownership | The original LabelController and LabelSearchController are empty compatibility shells. Search, document, section, markdown, import, comparison, and metadata operations live in feature controllers with no more than eight actions each. |
| Label data access | Scoped feature services own EF Core query and document-graph behavior. DtoLabelAccess.Compatibility.cs preserves the 57 public names/58 overloads as forwarding-only adapters; first-party runtime callers use DI services. |
| Queued work | Import progress crosses an explicit IImportOperationStatusStore boundary. Comparison jobs use a singleton coordinator that snapshots inputs, creates a fresh scope per job, and links cancellation to application shutdown instead of the originating request. |
| Encryption | DatabaseSecurityOptions is bound centrally and IPrimaryKeyCipher is the injected encryption boundary for migrated Label, authentication, AI, authorization-filter, Claude-search, and Orange Book paths. Architecture tests freeze the explicitly deferred legacy-reader inventory. |
| Errors and logs | MedRecProExceptionHandler owns unexpected HTTP failures in every environment, returning sanitized ProblemDetails and logging the same trace ID. Production logging uses structured templates, filtered/redacted in-memory administration records, and safe typed log DTOs; see logging conventions. |
| Verification | A deterministic real host replaces both SQL contexts with SQLite, removes reviewed unsafe workers, and supplies test authentication/configuration. Debug and separately compiled Release suites protect all 51 Label routes, OpenAPI, headers, files, validation, authorization, and error bodies; see verification gates. |
The tree below is intentionally curated around deployable projects and the current architecture/verification boundaries. Every named path was checked against the live repository on 2026-07-14.
All API endpoints are accessed under /api in production (IIS virtual application). API controllers inherit the #if DEBUG route in ApiControllerBase, preserving the local /api/[controller] prefix and the production app-relative route where IIS supplies and strips /api.
/api/Auth)| Method | Route | Description |
|---|---|---|
| GET | login/{provider} | Start OAuth flow (Google or Microsoft) |
| GET | external-logincallback | OAuth callback handler |
| GET | user | Get current authenticated user info |
| POST | logout | Log out current user |
| POST | token-placeholder | Token exchange |
| GET | login | Login page |
| GET | loginfailure | Login failure handler |
| GET | lockout | Account lockout handler |
| GET | accessdenied | Access denied handler |
/api/Users)| Method | Route | Description |
|---|---|---|
| GET | me | Get current user profile |
| GET | {encryptedUserId} | Get user by encrypted ID |
| GET | byemail | Get user by email |
| POST | signup | Create new user account |
| POST | authenticate | Authenticate user |
| PUT | {encryptedUserId}/profile | Update user profile |
| DELETE | {encryptedUserId} | Delete user account |
| PUT | admin-update | Administrative user update |
| POST | rotate-password | Rotate user password |
| GET | user/{encryptedUserId}/activity | Get user activity log |
| GET | user/{encryptedUserId}/activity/daterange | Get activity within date range |
| GET | endpoint-stats | Get endpoint performance statistics |
| POST | resolve-mcp | Resolve email to encrypted user ID (McpBearer auth; auto-provisions new users) |
/api/Label)The compatibility-stable Label route family contains 51 operations covering navigation views, search, CRUD, import, rendering, and AI features. Internally, those actions are distributed across feature controllers; LabelController and LabelSearchController remain empty shells so the public controller name and Swagger/route contracts stay unchanged.
Navigation & Search Views:
| Method | Route | Description |
|---|---|---|
| GET | product/search | Search products |
| GET | product/related | Related products |
| GET | product/latest | Latest product labels |
| GET | product/latest/details | Latest product label details |
| GET | product/indications | Product indications search |
| GET | ingredient/search | Search by ingredient (active/inactive) |
| GET | ingredient/summaries | Ingredient summary list |
| GET | ingredient/active/summaries | Active ingredients only |
| GET | ingredient/inactive/summaries | Inactive ingredients only |
| GET | ingredient/advanced | Advanced ingredient search |
| GET | ingredient/by-application | Ingredients by application number |
| GET | ingredient/related | Related ingredients |
| GET | labeler/search | Search by manufacturer/labeler |
| GET | labeler/summaries | Labeler summary list |
| GET | ndc/search | Search by NDC code |
| GET | ndc/package/search | Search by NDC package code |
| GET | application-number/search | Search by application number (NDA/ANDA) |
| GET | application-number/summaries | Application number summaries |
| GET | pharmacologic-class/search | Search by pharmacologic class |
| GET | pharmacologic-class/hierarchy | Pharmacologic class hierarchy |
| GET | pharmacologic-class/summaries | Pharmacologic class summaries |
| GET | section/search | Search by LOINC section code |
| GET | section/summaries | Section summaries |
| GET | document/navigation | Document navigation tree |
| GET | document/version-history/{setGuidOrDocumentGuid} | Document version history |
Label Content & Rendering:
| Method | Route | Description |
|---|---|---|
| GET | section/content/{documentGuid} | Get section content for a document |
| GET | markdown/sections/{documentGuid} | Get label sections as markdown |
| GET | markdown/export/{documentGuid} | Export full label as markdown |
| GET | markdown/download/{documentGuid} | Download label markdown file |
| GET | markdown/display/{documentGuid} | Render label as HTML from markdown |
| GET | generate/{documentGuid}/{minify} | Generate updated SPL XML |
| GET | original/{documentGuid}/{minify} | Get original SPL XML |
| GET | single/{documentGuid} | Get single label details |
| GET | complete/{pageNumber?}/{pageSize?} | Paginated complete label list |
Drug Safety:
| Method | Route | Description |
|---|---|---|
| GET | drug-safety/dea-schedule | DEA schedule classification |
AI-Powered Endpoints:
| Method | Route | Description |
|---|---|---|
| GET | extract-product | AI-powered product extraction from text |
| GET | indication/search | AI-assisted indication search with label-text validation |
| GET | comparison/analysis/{documentGuid} | Get comparison analysis |
| POST | comparison/analysis/{documentGuid} | Start AI comparison analysis |
| GET | comparison/progress/{operationId} | Check comparison progress |
CRUD & Import:
| Method | Route | Description |
|---|---|---|
| GET | {menuSelection}/{encryptedId} | Get single entity by type |
| GET | section/{menuSelection} | Get records for a label entity type |
| POST | {menuSelection} | Create entity by type |
| PUT | {menuSelection}/{encryptedId} | Update entity by type |
| DELETE | {menuSelection}/{encryptedId} | Delete entity by type |
| POST | import | Bulk SPL ZIP import |
| GET | import/progress/{operationId} | Check import progress |
Reference:
| Method | Route | Description |
|---|---|---|
| GET | guide | API usage guide |
| GET | inventory/summary | Database inventory overview |
| GET | sectionMenu | Available section menu items |
| GET | {menuSelection}/documentation | Documentation for a data type |
/api/Ai)| Method | Route | Description |
|---|---|---|
| GET | context | Get AI context (auth status, demo mode, data counts) |
| POST | interpret | Interpret natural language query into API endpoint specs |
| POST | synthesize | Synthesize API results into human-readable response |
| GET | chat | Convenience endpoint for simple queries |
| POST | conversations | Create new conversation |
| GET | conversations/{conversationId} | Get conversation |
| GET | conversations/{conversationId}/history | Get conversation history |
| DELETE | conversations/{conversationId} | Delete conversation |
| GET | conversations/stats | Get conversation statistics |
| POST | retry | Retry last AI operation |
/api/Settings)| Method | Route | Description |
|---|---|---|
| GET | demomode | Check demo mode status |
| GET | info | Application info |
| GET | features | Feature flags |
| GET | database-limits | Database limits |
| GET | metrics/database-cost | Azure SQL free tier usage and cost projections |
| POST | clearmanagedcache | Clear managed cache |
| GET | logs | Activity logs |
| GET | logs/statistics | Log statistics |
| GET | logs/categories | Log categories |
| GET | logs/by-date | Logs filtered by date |
| GET | logs/by-category | Logs filtered by category |
| GET | logs/by-user | Logs filtered by user |
| GET | logs/users | Users with log entries |
| GET | test/app-credential | Test Azure credentials |
| GET | test/app-metrics-pipeline | Test metrics pipeline |
Administrative log endpoints remain Admin-only and return typed, redacted projections. Invalid log filters use validation ProblemDetails; unexpected failures use the global trace-correlated ProblemDetails contract.
/api/AdverseEvent)Backs the React adverse-event risk dashboard. The whole controller is gated by the FeatureFlags:AeDashboard:Enabled flag (returns 503 when disabled). Reads are anonymous (favorite state is enriched for authenticated users); favorite writes require ApiAccess. Class-picker and MedDRA system-picker responses expose pagination/aggregate totals via the X-Page-Number, X-Page-Size, X-Total-Count, and X-Chartable-Count headers.
| Method | Route | Description |
|---|---|---|
| GET | products | Dashboard product list with KPI/coverage data (paged) |
| GET | products/catalog | Slim cached product catalog for the picker |
| GET | products/count | Distinct product inventory count |
| GET | products/favorites | Authenticated user's favorite products |
| PUT | products/{documentGuid}/favorite | Add a favorite (idempotent, 204) |
| DELETE | products/{documentGuid}/favorite | Remove a favorite (idempotent, 204) |
| GET | products/{documentGuid}/triage | Tiered triage signals for one product |
| GET | products/{documentGuid}/forest | Forest-plot payload for one product |
| GET | products/{documentGuid}/quadrant | Risk-vs-precision quadrant payload |
| GET | reverse-lookup | Products reporting one or more exact AE terms |
| GET | interchange | Comparator-aware two-product therapeutic interchange comparison |
| GET | correlation/classes | Pharmacologic classes with AE data (class picker) |
| GET | correlation | SOC Γ SOC correlation map for one class |
| GET | correlation/heatmap | Sparse SOC Γ drug RR heatmap for one class |
| GET | correlation/cell | Per-drug drill-down for one correlation cell |
| GET | correlation/systems | MedDRA System Organ Classes with AE rows (system picker) |
| GET | correlation/systems/map | Selected-system pharmacologic-class Γ pharmacologic-class correlation map |
| GET | correlation/systems/heatmap | Selected-system pharmacologic-class Γ drug RR heatmap |
| GET | correlation/systems/cell | Per-term drill-down for one selected-system class-pair cell |
/mcp)The MCP server exposes its own endpoints. See the MedRecProMCP README for full details.
| Method | Route | Description |
|---|---|---|
| POST | /mcp | MCP Streamable HTTP transport (JSON-RPC) |
| GET | /mcp/health | Health check |
| GET | /mcp/docs | HTML documentation page |
| GET | /mcp/.well-known/oauth-protected-resource | Protected Resource Metadata (RFC 9728) |
| GET | /mcp/.well-known/oauth-authorization-server | Authorization Server Metadata (RFC 8414) |
| GET | /mcp/oauth/authorize | OAuth authorization endpoint |
| POST | /mcp/oauth/token | Token exchange endpoint |
| POST | /mcp/oauth/register | Dynamic Client Registration (RFC 7591) |
| GET | /mcp/oauth/callback/google | Google OAuth callback |
| GET | /mcp/oauth/callback/microsoft | Microsoft OAuth callback |
MedRecProStatic serves the OAuth/MCP discovery metadata at the domain root because the MCP SDK resolves /.well-known/* relative to the domain, not the MCP endpoint path. When Claude connects to https://www.medrecpro.com/mcp, the SDK looks for discovery at https://www.medrecpro.com/.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server.
These endpoints are registered directly in MedRecProStatic's Program.cs as static JSON responses. Attempts to redirect from the root site to /mcp/.well-known/* failed because 302 redirects cause the MCP SDK to derive the wrong resource URI, and reverse proxying through Cloudflare triggers Bot Fight Mode (403 errors).
MedRecProStatic also has a critical web.config setting (httpErrors existingResponse="PassThrough") placed outside the <location> element so it is inherited by the MCP and API virtual applications. Without this, IIS replaces 401 responses with HTML error pages, breaking the MCP OAuth challenge flow.
Database schema definitions and maintenance scripts are maintained in MedRecPro/SQL/. These are the authoritative source for schema updates, view definitions, and index management.
| Script | Purpose |
|---|---|
MedRecPro.sql | Full database schema (tables, constraints, relationships) |
MedRecPro_Views.sql | View definitions used by navigation and search endpoints |
MedRecPro_Indexes.sql | Index definitions for query performance |
MedRecPro-Deployment.sql | Deployment-time schema updates |
DbTriggerSetup.sql | Database trigger configuration |
MedRecPro-Azure-Data-Refresh.ps1 | Normal single entry point for a manifest-bound local-to-Azure refresh |
MedRecPro-Export-Import.ps1 | Supported lower-level primary-domain BCP export/import tool |
MedRecPro-AzureStatus.sql | Azure SQL status and diagnostics queries |
MedRecPro-AzureRebuildIndex.sql | Index rebuild for Azure SQL |
MedRecPro-AzureDisableIndex.sql | Disable indexes during bulk operations |
MedRecPro-AzureOnlineQueryEditorRebuildIndex.sql | Index rebuild via Azure Query Editor |
MedRecPro-AzureNuke.sql | Full database reset (destructive) |
MedRecPro-TableNames.sql | List all table names |
MedRecPro-TableTruncate.sql | Truncate tables for reimport |
MedRecPro-TableMissingIndexes.sql | Identify missing indexes |
MedRecPro-TableCreate-OrangeBook.sql | Orange Book table definitions (7 tables, indexes, extended properties) |
MedRecPro-AzureOrangeBookNuke.sql | Targeted Orange Book truncation with safety preview mode |
MedRecPro-Table-tmp_FlattenedAdverseEventCoverageTable.sql | Stage 5 AE source-row coverage / non-RR audit table |
MedRecPro-Table-tmp_FlattenedAdverseEventTable.sql | Stage 5 RR-ready AE statistics (RR/DNRR/CI + PERSISTED log columns) |
MedRecPro-Table-tmp_FlattenedAdverseEventRiskTable.sql | Materialization of dbo.vw_AeRisk for the dashboard |
MedRecPro-Table-tmp_AeDashboardProductCatalog.sql | Materialization of dbo.vw_AeDashboardProductCatalog (picker) |
MedRecPro-AdverseEvent-Export-Import.ps1 | BCP full-refresh of the AE tables (local SQL Server β Azure SQL, truncate-then-import) |
For a normal complete local-to-Azure data refresh, start only the unified entry point. It exports and validates the Core, Orange Book, materialized temp, and adverse-event domains before Azure mutation; shows the resolved source/target and inventory; then requires the exact REFRESH server.database.windows.net/MedRecPro confirmation token. It records only non-secret run state under C:\MedRecPro-Migration\Refreshes and attempts index recovery before an incomplete run exits.
A start without an explicit mode first asks for the run mode (validate / export / full refresh; Enter chooses validate-only), and missing Azure connection values are requested interactively with an immediate connection test, so an interactive launch cannot drift into the destructive path by default. Use -ExportOnly to create a validated local snapshot without Azure mutation, -ValidateOnly for source/target preflight, -RefreshExclusionRules only when the normally preserved PharmClassDosageFormExclusion table must be refreshed, and -ResumeRun <run-directory> only for that run's unchanged manifest and data files. -WhatIf previews the stage graph and never acts as destructive authorization. The individual domain workers and nuke/index SQL files remain supported manual/recovery tools; do not combine them with a unified run.
When updating database schemas or views, modify the scripts in MedRecPro/SQL/ and run them against the target database. The MedRecPro_Views.sql file is particularly important as the navigation view queries (ingredient search, labeler search, pharmacologic class hierarchy, etc.) are defined there and power many of the API search endpoints. The adverse-event dashboard is backed by the dbo.vw_AeRisk, dbo.vw_AeDrugSummary, and dbo.vw_AeDashboardProductCatalog views (also in MedRecPro_Views.sql), the last two materialized into tmp_ tables by the Stage 5 pipeline so the dashboard reads without runtime statistics.
The API includes an agentic AI layer that enables natural language interaction with pharmaceutical data. The system follows a request-interpret-execute-synthesize pattern:
POST /api/Ai/interpretPOST /api/Ai/synthesizeAI skills are defined as markdown prompt files in MedRecPro/Skills/. Key skills include:
The platform turns the free-text adverse-event tables buried in SPL labels into comparable risk statistics and exposes them as an interactive dashboard at /adverse-events.
The data flow spans three projects:
tmp_FlattenedAdverseEvent* tables. See the MedRecProImportClass README for the full pipeline and the statistical contract.AdverseEventController (/api/AdverseEvent) serves dashboard-ready, encrypted-ID payloads from the materialized risk views: per-product triage/forest/quadrant, symptom reverse lookup, comparator-aware two-product therapeutic interchange, pharmacologic-class SOC Γ SOC correlation maps/heatmaps/cell drill-downs, and MedDRA-system-scoped class Γ class / class Γ drug correlation views. The feature is gated by FeatureFlags:AeDashboard:Enabled.MedRecProStatic/wwwroot/ae-dashboard and served by MedRecProStatic. See the MedRecProReact README.Because the observation units for correlation views are intentionally narrow β a single drug within a class for SOC Γ SOC maps, or shared selected-system terms for By System class-pair maps β sample sizes can be small. The dashboard is deliberately honesty-first: below-floor cells are suppressed rather than fabricated, non-renderable system matrices return warnings, the By System focus is single-system by design, and comparator-mixed payloads are explicitly flagged. The displayed figures are bounded by what each label discloses and what the parser can extract β absence of a signal is not evidence of its absence in practice.
The platform imports and cross-references data from the FDA's Approved Drug Products with Therapeutic Equivalence Evaluations (Orange Book), linking FDA approval records to existing SPL label data.
Seven normalized tables store Orange Book data, with three junction tables linking to existing SPL entities:
| Table | Purpose |
|---|---|
OrangeBookApplicant | Pharmaceutical companies holding FDA approvals |
OrangeBookProduct | Drug products (natural key: ApplType + ApplNo + ProductNo) |
OrangeBookPatent | Patent records per product with expiration dates |
OrangeBookExclusivity | Marketing exclusivity periods (NCE, ODE, RTO, etc.) |
OrangeBookProductMarketingCategory | Junction: OB Product β SPL MarketingCategory (by application number) |
OrangeBookProductIngredientSubstance | Junction: OB Product β SPL IngredientSubstance |
OrangeBookApplicantOrganization | Junction: OB Applicant β SPL Organization |
No foreign key constraints are enforced; relationships are managed by the import module. The main nuke script (MedRecPro-AzureNuke.sql) excludes Orange Book tables, which have their own dedicated truncation script.
The console application (MedRecProConsole) imports Orange Book data from FDA-published ZIP archives containing tilde-delimited text files. The import pipeline:
products.txt from the ZIP archiveThe import is idempotent (upsert-based), so re-running is safe without crash recovery queues. Real-time multi-phase progress is displayed via Spectre.Console.
Interactive mode:
Unattended mode:
| Argument | Description |
|---|---|
--orange-book <path> | Path to Orange Book ZIP file |
--nuke | Truncate all Orange Book tables before import |
--connection <name> | Database connection name from appsettings.json |
--auto-quit | Exit after completion |
--verbose | Enable debug logging |
Create user secrets for the MedRecPro API project:
Run the schema script from MedRecPro/SQL/MedRecPro.sql against your SQL Server instance, then apply views and indexes:
Or run EF Core migrations:
The MVC-hosted dashboard at http://localhost:5001/adverse-events is served from the committed Vite bundle; the Vite dev server above is only for iterating on the React source. After changing React source, run npm run build and commit the regenerated MedRecProStatic/wwwroot/ae-dashboard assets (the .NET build does not run Vite).
Use the Chat page test commands to exercise the browser-facing endpoint diagnostic. In local Debug, run the API at http://localhost:5093 and the static site at http://localhost:5001; when deployed, the diagnostic uses the same-origin /api path.
| Command | Purpose |
|---|---|
/test api all | Run the non-destructive baseline locally; deployed sites open an explicit online full-diagnostic panel before any request starts. |
/test api all fast | Run the nine-request browser-health check across Settings, sign-in, Labels, the AE product picker, Orange Book, and AI context. |
/test api safe | Run the complete safe anonymous profile; use a private window when the current browser is signed in. |
/test api read-auth | Run authenticated read coverage without writes. |
/test api report | Show the redacted summary for the latest API diagnostic. |
On a deployed site, /test api smoke and /test api all fast are capped at nine monitored /api requests. /test api all fast uses the authenticated-session preflight plus the minimum Label seed and browser-facing Settings, Label, AE picker, Orange Book, and AI-context reads. It excludes the full-table AE correlation picker, status/administration routes, and AI conversation statistics, which are not browser-health checks. An online full baseline does not start from chat: its panel shows the expected duration and requires an explicit start. Online requests use 34-second inter-request pacing (keeping the ten-per-five-minute endpoint monitor below its threshold) and a 60-second timeout safeguard for the 30-second tarpit cap. The current 137-request baseline is therefore expected to take roughly 1 hour 18 minutes when most requests are monitored. Deployed runs suppress in-memory conversation lifecycle requests and skip deliberate 404 probes unless tarpit-disabled status has been independently attested; query parameters, chat commands, and client request metadata do not disable tarpit protection. The baseline never starts paid-AI, import, logout, or mutation profiles; those profiles remain local-only and blocked until their exact confirmations are entered in the endpoint panel. OAuth provider initiation is verified manually through the normal login flow or Swagger rather than through the browser baseline.
The panel's complete count is the number of scheduled diagnostic records, not the number of API routes. Accounted: 120 is the audited inventory of unique HTTP-method-and-route operations. One operation can have several records, for example a successful read, an invalid-input contract check, and an authorization check; a few records are internal manifest or seed checks. Invoked counts records that issued a request, while Positive contracts counts records that verified an expected successful contract. The current Debug acceptance baseline completed with 154 PASS, 0 FAIL, and 15 intentional SKIP across 169 diagnostic records; it retained all 120 operations in the inventory.
Upload SPL ZIP files through the API import endpoint or use the console importer:
SPL ZIP files can be downloaded from the DailyMed SPL Resources page.
Orange Book ZIP files can be downloaded from the FDA Orange Book Data Files page. See the FDA Orange Book Integration section for import details.
The repository-level runner provides the same named gates used by CI:
Fast runs dependency, reflection, public-surface, and route guards for ordinary changes.DebugContract runs the reviewed 27-case Label contract lane in Debug: the original 24 public-contract/startup cases plus three progress-response contract cases, excluding isolated OpenAPI filter units.ReleaseContract separately compiles the same 27-case contract lane in Release under MedRecPro/.codex-build/test-contract-release.Full builds the solution, runs every MSTest test, performs deterministic-test/source inventories, and checks the diff.All executes every gate in order and is the phase/merge-boundary command used by the MedRecPro Verification workflow.See MedRecPro verification gates for gate boundaries and CI behavior.
IIS strips the virtual application prefix from requests before forwarding to ASP.NET Core. A request to /api/Label/search arrives at Kestrel as /Label/search. API controllers inherit the conditional route from ApiControllerBase:
Split controllers do not declare type-level routes. FeatureControllerNameConvention resolves each annotated controller's [controller] token from FeatureControllerNameAttribute; the current Label feature controllers use "Label", preserving the same 51 Debug and Release operations. SwaggerGroupAttribute independently controls documentation grouping without participating in routing. The same virtual-application consideration applies to MCP routes and Swagger paths.
Azure App Service Managed Certificates do not work with Cloudflare proxy enabled. Use Cloudflare Origin Certificates instead:
openssl pkcs12 -export -out origin.pfx -inkey key.pem -in cert.pemProduction redirect URIs must include the /api/ prefix:
https://your-domain.com/api/signin-googlehttps://your-domain.com/signin-googleCloudflare has multiple independent bot-blocking systems that can interfere with MCP and server-to-server calls:
User-Agent header on outbound HttpClients to avoid bot detectionAzure SQL Serverless auto-pauses after inactivity. Resuming takes 30-60 seconds, which can exceed default timeouts. Mitigations:
DatabaseKeepAliveService pings the database with SELECT 1 every 14 minutes during business hours (Mon-Fri, 8 AM - 8 PM Eastern) to prevent auto-pause. Each ping cycle includes 3 retry attempts with escalating delays (10s, 30s, 60s) and a 90-second connect timeout to accommodate cold resume. Configured via the DatabaseKeepAlive section in appsettings.jsonEnableRetryOnFailure() is configured on the EF Core DbContext with 3 retries and a 60-second command timeout to handle transient failures across all application database operationsKey Vault uses -- (double dash) as separator; ASP.NET Core configuration uses : (colon). The framework maps between them automatically:
Authentication--Google--ClientIdAuthentication:Google:ClientIdEnsure no extra characters (trailing commas, quotes) in Key Vault secret values.
Without <httpErrors existingResponse="PassThrough" /> in the root site's web.config, IIS replaces HTTP 401 responses with HTML error pages. This breaks OAuth challenge flows where the WWW-Authenticate header must reach the client. This setting must be in the root site (MedRecProStatic) because child virtual applications inherit it.
When both the API and MCP server issue JWT tokens with different issuer/audience values, the JWT Bearer handler must accept both using ValidIssuers and ValidAudiences arrays instead of the singular properties.
The API includes built-in monitoring for Azure SQL Database's serverless free tier (100,000 vCore seconds/month). The AzureSqlMetricsService queries Azure Monitor Metrics to track consumption, project monthly costs, and recommend throttling levels. See the GET /api/Settings/metrics/database-cost endpoint.
Security settings should be stored in user secrets (development) or Azure Key Vault (production):
Changing Security:DB:PKSecret will break all existing encrypted URLs, favorites, and bookmarks.
See the detailed deployment guides in each project's README:
Invoke-MedRecProVerification.ps1 -Gate All/api/swagger/index.html/mcp/healthSee the LICENSE.txt file for details.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/medrecpro-drug-label-server)<a href="https://allmcps.com/mcp/medrecpro-drug-label-server"><img src="https://allmcps.com/api/badge/medrecpro-drug-label-server?style=directory" alt="MedRecPro Drug Label Server on AllMCPs" /></a>