npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@masuratech/redcap-mcp-server

v1.0.0

Published

MCP server for REDCap — manage projects, records, instruments, surveys, users, and run data quality audits through AI assistants

Readme


REDCap has 5,900+ partner institutions, 2.1 million users, and zero MCP servers. I fixed that. Now my AI assistant exports records, audits data quality, and generates codebooks while I drink coffee. — Allan Mugarura, creator


Why This Exists

REDCap is the backbone of clinical and translational research worldwide. But every interaction — exporting records, checking completeness, generating codebooks, managing surveys — requires clicking through the web UI. This MCP server lets AI assistants do it programmatically.

What makes this different from a REST wrapper:

  • Data quality audit — completeness per field, blank required fields, statistical outliers (z-score), duplicate detection, all in one call
  • Auto-generated codebook — human-readable data dictionary with choices, branching logic, validation rules
  • Enrollment dashboard — breakdown by arm, event, DAG, completion status, with timeline
  • Descriptive statistics — mean/median/SD/IQR for numeric fields, frequency tables for categorical
  • Cross-tabulation — contingency tables between any two fields
  • Event comparison — compare a field across longitudinal timepoints
  • Smart search — REDCap filter logic through natural language

Tools (38)

| Category | Tools | |----------|-------| | Project | get_project_info, create_project | | Data Dictionary | get_metadata, import_metadata | | Records | export_records, import_records, delete_records, next_record_id, search_records, record_count | | Instruments | list_instruments, get_instrument_event_mappings, get_field_names | | Events | list_events, import_events | | Arms | list_arms, import_arms | | Users | list_users, import_users, list_user_roles, list_user_role_assignments | | DAGs | list_dags, import_dags | | Reports | get_report | | Surveys | get_survey_link, get_survey_queue_link, get_survey_return_code, list_survey_participants | | Files | export_file, delete_file | | Repeating | list_repeating_instruments | | Audit | get_audit_log | | Analytics | data_quality_audit, enrollment_stats, generate_codebook, describe_field, compare_events, cross_tabulate |

Quick Start

1. Get Your REDCap API Token

In your REDCap project: APIRequest API Token (or ask your REDCap admin).

You also need your institution's REDCap API URL, which looks like:

https://redcap.youruni.edu/api/

2. Install

npm install -g @masuratech/redcap-mcp-server

3. Register with Claude Code

claude mcp add redcap \
  --env REDCAP_API_URL=https://redcap.youruni.edu/api/ \
  --env REDCAP_API_TOKEN=YOUR_API_TOKEN_HERE \
  -- npx @masuratech/redcap-mcp-server

4. Use

Start a Claude Code session and ask things like:

  • "Show me the data dictionary for my REDCap project"
  • "Export all records where age > 18"
  • "Run a data quality audit on the demographics form"
  • "Generate a codebook for the project"
  • "How many participants have completed the baseline survey?"
  • "Cross-tabulate sex by treatment arm"
  • "Compare depression scores across timepoints"
  • "Get the audit log for record 101"
  • "Generate a survey link for record 205"

Configuration

| Environment Variable | Required | Default | Description | |---------------------|----------|---------|-------------| | REDCAP_API_URL | Yes | — | Your REDCap instance API endpoint | | REDCAP_API_TOKEN | Yes | — | Project-level API token |

Alternative variable names REDCAP_URL and REDCAP_TOKEN are also accepted.

Multiple Projects

Register multiple MCP servers with different tokens:

claude mcp add redcap-study1 \
  --env REDCAP_API_URL=https://redcap.youruni.edu/api/ \
  --env REDCAP_API_TOKEN=TOKEN_FOR_STUDY_1 \
  -- npx @masuratech/redcap-mcp-server

claude mcp add redcap-study2 \
  --env REDCAP_API_URL=https://redcap.youruni.edu/api/ \
  --env REDCAP_API_TOKEN=TOKEN_FOR_STUDY_2 \
  -- npx @masuratech/redcap-mcp-server

Analytics Tools

Data Quality Audit

The data_quality_audit tool runs a comprehensive check in one call:

  • Completeness: % filled per field, worst fields highlighted
  • Required fields: identifies blank required-field entries
  • Outliers: z-score based detection on numeric fields (configurable threshold)
  • Duplicates: detects records with matching name/email/DOB/phone fields

Codebook Generation

The generate_codebook tool produces a structured, human-readable data dictionary:

  • All forms with their labels
  • Every field: name, label (HTML stripped), type, validation, choices, branching logic, notes
  • Required field markers
  • Choice code-label pairs for dropdowns/radios/checkboxes

Cross-Tabulation

The cross_tabulate tool generates contingency tables between any two categorical fields with row totals, column totals, and grand total.

Development

git clone https://github.com/masuratech/redcap-mcp-server.git
cd redcap-mcp-server
npm install
npm run dev    # watch mode
npm run build  # one-shot compile
npm start      # run the server

Security

  • API tokens are passed via environment variables, never hardcoded
  • All communication uses your institution's existing REDCap HTTPS endpoint
  • No data is sent to third-party services — everything stays between you and your REDCap instance
  • The server runs locally on your machine

License

MIT — Masura Tech Ltd

Built with mass-produced coffee in Kampala by Masura Tech.