MedgeClaw
Open-source AI research assistant for biomedicine — chat to run RNA-seq, drug discovery, clinical analysis, and more. Built on Claude Code with 140 K-Dense scientific skills, real-time dashboard, and RStudio/JupyterLab integration. | 开源生物医学 AI 研究助手,对话即可驱动转录组、药物发现、临床分析等工作流,集成 140 个科学技能与实时研究看板。
Install / Use
/learn @xjtulyc/MedgeClawQuality Score
Category
Education & ResearchSupported Platforms
README
🧬 MedgeClaw
An AI-Powered Biomedical Research Assistant
<p align="center"> <img src="./logo.png" alt="MedgeClaw Logo" width="300"> </p>English | 中文
An open-source biomedical AI research assistant built on OpenClaw and Claude Code, integrating 140 K-Dense Scientific Skills for bioinformatics, drug discovery, clinical research, and more.
Talk to your research assistant via WhatsApp, Slack, or Discord → it runs the analysis → you view results in RStudio or JupyterLab.
Architecture
User (voice / text via WhatsApp · Slack · Feishu · Discord)
↓
OpenClaw Gateway (conversation layer)
↓ biomed-dispatch skill
Claude Code (execution layer)
↓ K-Dense Scientific Skills (140 skills)
R + Python Analysis Environment (Docker)
↓ ↓ ↓
Research Dashboard :77xx RStudio :8787 Feishu Rich Cards
(real-time progress, / JupyterLab :8888 (SVG panels → PNG
code & output preview) (interactive) → interactive cards)
What's Included
| Component | Description |
| ----------------------------- | ---------------------------------------------------------------------------------- |
| OpenClaw | Conversational AI gateway — connects to your messaging apps |
| Claude Code | Executes complex analysis workflows autonomously |
| K-Dense Scientific Skills | 140 ready-to-use skills: genomics, drug discovery, clinical research, ML, and more |
| Research Dashboard | Real-time web dashboard showing progress, code, outputs, and file previews |
| R Environment | DESeq2, Seurat, edgeR, clusterProfiler, survival, ggplot2, and more |
| Python Environment | Scanpy, BioPython, PyDESeq2, lifelines, scikit-learn, and more |
| RStudio Server | Browser-based R IDE at localhost:8787 |
| JupyterLab | Browser-based Python/R notebooks at localhost:8888 |
| biomed-dispatch | The bridge skill that routes your requests to Claude Code |
| CJK Visualization | Auto-detects CJK fonts for matplotlib, no more tofu blocks in Chinese plots |
| SVG UI Templates | Professional SVG panels for lists, checklists, pipeline status, and rich reports |
| Feishu Rich Card | Send image-rich interactive cards in Feishu group chats for progress reports |
Prerequisites
- Node.js 22+ — nodejs.org
- Docker + docker-compose — docs.docker.com
- Git
- An API key from one of the supported model providers (see below)
Quick Start
# 1. Clone with submodules (includes K-Dense Scientific Skills)
git clone --recurse-submodules https://github.com/xjtulyc/MedgeClaw
cd MedgeClaw
# 2. Configure environment
cp .env.example .env
nano .env # Fill in your API key and provider settings
# 3. Run setup
bash setup.sh
# 4. Sync MedgeClaw configuration to OpenClaw
python3 sync.py
openclaw gateway restart
# 5. Start the analysis environment
docker compose up -d
# 6. Start OpenClaw
openclaw onboard
Then open your messaging app and start talking to your assistant.
Environment Configuration
The .env file controls:
- API settings: Provider, base URL, model, API key
- Third-party proxy fix:
ANTHROPIC_SMALL_FAST_MODEL(required for non-Anthropic endpoints) - Path overrides (optional):
MEDGECLAW_ROOT,OPENCLAW_DIR - Docker settings: Container name, RStudio/Jupyter passwords
See .env.example for all available options.
Model Providers
Edit .env to choose your provider. All providers are drop-in replacements — no other changes needed.
| Provider | Base URL | Notes |
| ------------------------------ | ------------------------------------ | ---------------- |
| Anthropic Claude (default) | https://api.anthropic.com | Best quality |
| MiniMax 2.1 | https://api.minimax.chat/anthropic | Available in CN |
| GLM-4.7 (Z.ai) | https://api.z.ai/api/anthropic | Available in CN |
| DeepSeek | https://api.deepseek.com/anthropic | Low cost |
| Ollama (local) | http://localhost:11434/v1 | Fully offline |
⚠️ Using Third-Party API Proxies
If you use a third-party API proxy (MiniMax, GLM, DeepSeek, or any non-Anthropic endpoint), you must configure ANTHROPIC_SMALL_FAST_MODEL in your .env file. Without this, Claude Code will fail silently.
Why
Claude Code runs a pre-flight safety check before every bash command, using a lightweight "small fast model" (defaults to claude-3-5-haiku). Most third-party proxies don't support Haiku, causing the pre-flight to return 503 errors and hang indefinitely with:
⚠️ [BashTool] Pre-flight check is taking longer than expected.
Fix
Add this line to your .env:
# Required for third-party API proxies:
ANTHROPIC_SMALL_FAST_MODEL=claude-sonnet-4-20250514 # or any model your proxy supports
Then re-run bash setup.sh to apply.
How to verify
# Should complete in < 30 seconds. If it hangs, your SMALL_FAST_MODEL is wrong.
claude --dangerously-skip-permissions -p 'run: echo hello'
Usage Examples
Once OpenClaw is running, send messages like:
Analyze RNA-seq data at data/counts.csv vs data/meta.csv, treatment vs control
Search PubMed for recent papers on CRISPR base editing, summarize top 10
Run survival analysis on data/clinical.csv, time=OS_months, event=OS_status
Perform single-cell RNA-seq analysis on the 10X data in data/10x/
Virtual screen EGFR inhibitors from ChEMBL (IC50 < 50nM), generate SAR report
Results are saved to ./outputs/ and viewable in RStudio (localhost:8787) or JupyterLab (localhost:8888).
📊 Research Dashboard
Every analysis task automatically spawns a live web dashboard — no need to wait for completion or check logs.
Features:
- Real-time progress bar — sticky header, always visible
- Analysis plan overview — all steps listed with completion status (✅/⏳)
- Step-by-step breakdown — each step shows: description → code (collapsible) → outputs
- Inline previews — images render directly, tables load from CSV files, text results highlighted
- Full script access — click to load the complete
.pyfile, not just snippets - Copy & download everywhere — 📋 copy code/tables/text, ⬇ download images/CSVs
- Color-blind friendly — IBM accessible palette + GitHub Dark theme
- File browser — browse all output artifacts with one-click preview
How it works:
AI completes a step → updates state.json → dashboard auto-refreshes (2s polling)
Three files, zero dependencies: dashboard.html + state.json + dashboard_serve.py.
See docs/dashboard.md for the full specification.
Directory Structure
MedgeClaw/
├── docker/
│ ├── Dockerfile # R + Python + RStudio + Jupyter
│ └── entrypoint.sh
├── skills/
│ ├── biomed-dispatch/ # Core bridge skill: routes tasks to Claude Code
│ │ └── SKILL.md
│ ├── dashboard/ # Research Dashboard: real-time task visualization
│ │ ├── SKILL.md # Dashboard specification & state.json schema
│ │ ├── dashboard.html # Single-file frontend (dark theme, IBM palette)
│ │ └── dashboard_serve.py # Threaded HTTP server
│ ├── cjk-viz/ # CJK font detection for matplotlib
│ │ └── SKILL.md
│ ├── svg-ui-templates/ # Professional SVG panels (list, checklist, pipeline, report)
│ │ ├── SKILL.md
│ │ ├── assets/ # 4 template SVGs
│ │ └── references/ # Template guide
│ └── feishu-rich-card/ # Send image-rich interactive cards in Feishu
│ ├── SKILL.md
│ └── references/ # send_card.py helper
├── scientific-skills/ # git submodule → K-Dense (140 skills)
├── data/ # Per-task data & analysis directories
│ └── <task_name>/
│ ├── dashboard/ # state.json + dashboard.html (auto-created)
│ └── output/ # Analysis outputs (CSV, PNG, etc.)
├── docs/ # Project documentation
├── docker-compose.yml
├── setup.sh
├── CLAUDE.md # Project instructions for Claude Code
├── .env.example
└── .gitmodules
🔄 Project Synchronization
MedgeClaw integrates with OpenClaw via a configuration-driven sync mechanism.
How it works
- Configuration:
.medgeclaw-sync.ymldefines what to sync - Sync script:
sync.pyreads the config and performs the sync - Environment:
.envdefines paths (optional, auto-detected by default)
When to sync
Run python3 sync.py after:
- Initial setup
- Modifying project documentation (MEDGECLAW.md, IDENTITY.md)
- Adding/updating custom skills in
skills/ - Changing sync configuration in
.medgeclaw-sync.yml
What gets synced
- Project docs → OpenClaw workspace
- Custom skills → OpenClaw workspace/skills/
- Identity/context → SOUL.md, AGENTS.md (appended)
- Skill paths → openclaw.json
See SYNC_README.md for details.
Updating K-Dense Scientific Skills
git submodule update --remote scientific-skills
Contributing
Contributions welcome. The most valuable contributions are:
- Impr
