hcp-engagement
One-line summary: This MCP server gives you read-only access to synthetic pharma HCP engagement data (reps, visits, consent, prescribing trends) so you can query profiles, interactions, and segment-level analytics in natural language.
Find HCPs — list by specialty/tier/region/state, or search by name, NPI, or institution.
Get full HCP profiles — demographics, per-channel consent status (e.g. sample drops), and an engagement summary by NPI.
Review interactions — pull visits, calls, emails, conference booths, and speaker programs filtered by NPI, region, specialty, rep, type, or days back.
Spot engagement gaps — rank HCPs by interaction counts, recency, sentiment, and samples received.
Analyze prescribing — monthly new/total Rx and market share for one HCP, per product if desired.
Compare segments — quarterly prescribing trends by region/specialty (
segment_rollup) with per-HCP drill-down (hcp_quarterly).Pair with visit frequency — quarterly interaction frequency by region/specialty to compare against Rx trends.
Evaluate reps — territory summaries with HCPs engaged, 30/90-day volume, and average sentiment.
Run demo narratives — e.g. "declining Rx despite steady engagement" (South/Oncology/Oncovarin coverage hook).
Provides tools for querying and analyzing synthetic Healthcare Professional (HCP) engagement data stored in Supabase, including HCP profiles, interactions, consent status, prescribing trends, rep activity, and engagement analytics.
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., "@hcp-engagement Which Tier A cardiologists haven't been visited in 90+ days?"
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.
HCP Engagement x Neon x MCP (mock pharma demo)
Model Context Protocol server for simulated Healthcare Professional (HCP) engagement data — reps, visits/calls/emails, consent status, and prescribing trends — from Neon.
All data is synthetic (example-pharma.com reps, fictional drug names like Cardiozin, sequential NPIs). This is not real provider or prescribing data.
Uses the separate Neon project we.Healthcare (young-river-28343758), not the Frescopa MCP database. Its tables are hcps, hcp_reps, hcp_products, hcp_interactions, hcp_interaction_products, hcp_prescribing_trends, and hcp_consents.
Mode | Use case |
stdio ( | Cursor, Claude Desktop on your Mac |
HTTP ( | Adobe AI Assistant, any remote app — public URL |
Repo layout
Path | Purpose |
| Tables, synthetic seed data, views (Supabase RLS only when its roles exist) |
| Idempotent South/Oncology demo adjustment |
| MCP stdio entry |
| MCP HTTP entry ( |
| Shared tools |
| Env template |
Related MCP server: Garmin Health MCP Server
Neon setup
The synthetic dataset is already loaded in the Healthcare project's production branch. Do not run these seed migrations again on a populated database without reviewing their effects. For a new empty branch, use a direct (unpooled) connection:
neon link --project-id young-river-28343758 --branch production -y
neon psql production --project-id young-river-28343758 --database-name neondb -- -v ON_ERROR_STOP=1 < supabase/migrations/20260831000000_hcp_engagement_init.sql
neon psql production --project-id young-river-28343758 --database-name neondb -- -v ON_ERROR_STOP=1 < supabase/migrations/20260831010000_hcp_south_visit_frequency_flat.sqlSet DATABASE_URL to this project's pooled connection string for the MCP runtime. Keep connection strings in ignored local env files and Render environment variables, never in Git.
Local build
cd /Users/zkorczyc/Projects/hcp-mcp
cp .env.example .env # skip if .env already exists
npm install
npm run buildCursor mcp.json snippet
{
"mcpServers": {
"hcp-engagement": {
"command": "node",
"args": ["/Users/zkorczyc/Projects/hcp-mcp/dist/index.js"],
"env": {
"DATABASE_URL": "<Healthcare Neon pooled connection string>"
}
}
}
}MCP tools
Tool | Role |
| List HCPs; filter |
| Search HCPs by name, NPI, or institution |
| Full profile by NPI — demographics, consent status per channel, engagement summary |
| Visits/calls/emails — filter by NPI, region, specialty, rep name, interaction type, days back |
| Analytics: interaction counts, recency, sentiment score, samples per HCP — find engagement gaps |
| Monthly new/total Rx and market share % for one HCP, optionally scoped to one product |
| Analytics: quarterly Rx trend for one product, broken out by region/specialty ( |
| Analytics: quarterly interaction/visit frequency by region/specialty — pairs with |
| Analytics: per-rep territory summary — HCPs engaged, interaction volume (30d/90d), avg sentiment |
Example questions this enables
"Which Tier A cardiologists haven't been visited in 90+ days?" →
hcp_engagement_summary(filtertier: A,specialty: Cardiology), then checklast_interaction_at."Can I drop samples with Dr. Reyes?" →
hcp_get_profile→ checkconsentsforsample_drop."Summarize my last 3 interactions with Dr. Nguyen." →
hcp_list_interactions(filter bynpi)."Which reps have the most positive-sentiment interactions?" →
hcp_rep_activity.
Demo narrative: "declining Rx despite steady engagement" (coverage-problem hook)
A 4-step chain that ties prescribing trend + rep engagement together to surface a "clinical demand exists, something's blocking it" story — useful for framing a payer/access-coverage narrative rather than a pure sales-execution one:
Baseline, side by side — "Show me Oncovarin prescribing trends by region and specialty over the last 2 quarters, alongside HCP visit frequency for each region." →
hcp_prescribing_trend_by_segment(brand_name: Oncovarin) +hcp_visit_frequency_by_segment, both grouped by region/specialty/quarter so they line up.Isolate the signal — "Which regions/specialties show declining Oncovarin prescribing despite stable or increasing visit frequency?" → compare the two
segment_rollupoutputs quarter-over-quarter (reasoning step, no new tool needed).Rule out physician sentiment — "For HCPs in [flagged region] with declining trends, what's the interaction sentiment from recent visits?" →
hcp_prescribing_trend_by_segment'shcp_quarterly(filtered to the flagged region) to find the specific decliners, thenhcp_list_interactions(filter bynpi, or byregion+specialty) to check sentiment.Territory context — "Summarize rep/territory performance in [flagged region] this quarter." →
hcp_rep_activity(filterregion).
The seed data has one segment deliberately built to produce this exact pattern: South region, Oncology, Oncovarin — prescribing drops sharply in the latest quarter while visit frequency stays comparatively steady and sentiment trends more positive, not less. Everything else in the dataset is pseudo-random (deterministic per NPI, but not hand-tuned), so other region/specialty combinations may or may not show a similar pattern.
Remote MCP URL (HTTP)
Deploy this repo as a Render Node service using render.yaml. In Render, set DATABASE_URL to the Healthcare project's pooled URL and MCP_API_KEY to a separate secret if the MCP client can send Authorization: Bearer <MCP_API_KEY>. The HTTP endpoint is POST /mcp; GET /health checks server availability but does not query the database. This server defaults to port 3100 locally (vs. Frescopa's 3000).
Security
Do not commit
.env,.env.local, or database credentials.The Neon database role used by
DATABASE_URLcan write data; use a read-only role for a public read-only MCP deployment.Data is synthetic — do not populate with real patient, prescriber, or PHI/PII data.
HTTP: always set
MCP_API_KEYon public deploy.
Available Tools
9 toolshcp_engagement_summaryA
Analytics: total interactions, recency, sentiment score, and samples per HCP. Sorted by most interactions first. Useful for finding engagement gaps (e.g. Tier A HCPs with no recent contact).
Inputs: tier, limit, region, specialty.
hcp_get_profileA
Full profile for one HCP by NPI: demographics, consent status per channel, and engagement summary.
Inputs: npi (required).
hcp_list_hcpsA
List Healthcare Professionals (HCPs). Filter by specialty, tier (A|B|C), region, or state. Mock data — not real providers.
Inputs: tier, limit, state, region, +1 more.
hcp_list_interactionsA
List rep-HCP interactions (visits, calls, emails). Filter by HCP NPI, region, specialty, rep name, interaction type, or how many days back.
Inputs: npi, limit, region, rep_name, +3 more.
hcp_prescribing_trend_by_segmentA
Quarterly prescribing trend for one product, broken out by region and specialty (segment_rollup), plus per-HCP quarterly rows (hcp_quarterly) for drill-down into which specific HCPs are declining/growing. Use segment_rollup to compare regions/specialties side by side; use hcp_quarterly to find individual decliners within a flagged segment.
Inputs: brand_name (required), region, specialty, quarters_back.
hcp_prescribing_trendsA
Monthly prescribing trend (new Rx, total Rx, market share %) for an HCP, optionally scoped to one product. Requires npi.
Inputs: npi (required), brand_name, months_back.
hcp_rep_activityB
Per-rep territory summary: HCPs engaged, total interactions, interactions in last 30 days, average sentiment.
Inputs: region, rep_name.
hcp_searchA
Search HCPs by name, NPI, or institution (partial match).
Inputs: query (required).
hcp_visit_frequency_by_segmentB
Quarterly rep interaction/visit frequency broken out by region and specialty — meant to be compared side by side with hcp_prescribing_trend_by_segment's segment_rollup for the same quarters.
Inputs: region, specialty, quarters_back, interaction_type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools target distinct resources or views: search/list/get HCPs, raw interactions, rep summaries, engagement analytics, and prescribing trends. The overlaps between hcp_list_hcps and hcp_search, and between the segment rollup tools, are manageable because descriptions specify different filters and metrics.
All tools share a consistent hcp_ prefix and descriptive names. However, the set mixes verb-led names like hcp_list_hcps and hcp_get_profile with noun-phrase names like hcp_rep_activity and hcp_engagement_summary, so the pattern is not perfectly uniform.
Nine tools is well-scoped for an HCP engagement analytics domain. Each tool covers a meaningful capability, from individual HCP lookup and interaction history to rep-level activity and segment-level prescribing trends, without unnecessary redundancy.
The tool set covers the core read-only engagement workflow: finding HCPs, viewing profiles, inspecting interactions, and aggregating engagement and prescribing trends at both individual and segment levels. Minor gaps exist, such as no dedicated rep directory or HCP/consent update capability, but agents can work around these with existing tools.
Maintenance
Related MCP Connectors
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Query, explore, and manage your databases through natural conversation.
Query BigQuery, Snowflake, Redshift & Azure Synapse with natural language
Ask questions in plain language, get answers from your business database. No SQL required.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform CRUD operations on Supabase databases through natural language. Supports advanced filtering, pagination, and safety checks for seamless database interaction.MIT
- AlicenseAqualityCmaintenanceEnables querying Garmin health data stored in Supabase through natural language, providing access to VO2 max trends, activity breakdowns, sleep statistics, race predictions, heart rate zones, and training load metrics.7MIT
- FlicenseNot gradedqualityDmaintenanceConnects to a Gym Tracker Supabase database to provide LLMs with access to personal workout history, routines, and training progress. It enables users to analyze fitness performance, track personal records, and receive personalized coaching advice through natural language.-
- FlicenseNot gradedqualityDmaintenanceTransforms natural language queries into SQL for customer segmentation, enabling democratized access to customer data insights.1-