med-paper-assistant
Health Warn
- License Γ’β¬β License: Apache-2.0
- Description Γ’β¬β Repository has a description
- Active repo Γ’β¬β Last push 0 days ago
- Low visibility Γ’β¬β Only 6 GitHub stars
Code Warn
- fs module Γ’β¬β File system access in .github/workflows/evolution-health.yml
Permissions Pass
- Permissions Γ’β¬β No dangerous permissions requested
No AI report is available for this listing yet.
π¬ AI-powered medical paper writing toolkit β from PubMed search to Word export, all inside VS Code
Medical Paper Assistant
π¬ An Integrated AI Toolkit for Medical Paper Writing
3 MCP Servers Β· ~138 Tools Β· 26 Skills Β· 15 Prompt Workflows β All in VS Code
π ηΉι«δΈζη
π€ Auto-Paper: Fully Autonomous Paper Writing Guide β 11-Phase Pipeline, 78 Quality Hooks, Structured Review Loop
π¦ What's in the Box
This is a monorepo toolkit that bundles everything a medical researcher needs β from literature search to Word/LaTeX export β into one integrated VS Code environment.
| Component | Type | Tools | Description |
|---|---|---|---|
| mdpaper | Core MCP Server | 88 | Paper writing: 88 tools, plus 3 MCP prompts and 3 MCP resources |
| pubmed-search | MCP Server (submodule) | 37 | PubMed/Europe PMC/CORE search, PICO, citation metrics, session mgmt |
| CGU | MCP Server (submodule) | 13 | Creative generation: brainstorm, deep think, spark collision |
| VS Code Extension | Extension | 5 cmds + 10 chat | MCP auto-registration, workspace setup, @mdpaper chat participant |
| Dashboard | Next.js Web App | β | Project management UI, diagram editor |
| Foam | VS Code Extension | β | [[wikilink]] citation linking, hover preview, graph view |
| Skills | Agent Workflows | 26 | Guided multi-tool workflows (literature review, draft writing...) |
| Prompts | Prompt Files | 15 | /mdpaper.search, /mdpaper.draft, etc. |
External MCP Servers (optional, installed via uvx):
- drawio β CONSORT/PRISMA flowchart generation
- zotero-keeper β Import references from Zotero library
VSX note: The MedPaper VS Code extension installs Python MCP tools persistently per machine via uv tool install, attempts uv tool upgrade on later activations, and skips duplicate PubMed Search / Zotero Keeper registration when another installed VS Code extension already provides those MCP servers. CI smoke now covers ubuntu-latest, windows-latest, macos-13, and macos-14, including official MCP client checks plus VSX validation smoke.
How the Pieces Fit Together
flowchart LR
subgraph IDE["VS Code"]
Agent["Copilot Agent<br/>26 Skills Β· 15 Prompts"]
Foam[Foam Plugin]
Ext[MedPaper Extension]
Dash[Dashboard]
end
subgraph MCP["MCP Servers (~138 tools)"]
mdpaper["mdpaper<br/>88 tools + 3 prompts + 3 resources<br/>Draft Β· Export Β· Validate Β· Review"]
pubmed["pubmed-search<br/>37 tools<br/>Search Β· Metrics"]
cgu["CGU<br/>13 tools<br/>Deep Think Β· Ideas"]
end
subgraph Data["Project Data"]
proj[("projects/{slug}/<br/>Β· .memory/<br/>Β· references/<br/>Β· drafts/")]
end
Agent <-->|MCP| mdpaper
Agent <-->|MCP| pubmed
Agent <-->|MCP| cgu
mdpaper -->|HTTP API| pubmed
Foam <-->|Wikilinks| proj
mdpaper <--> proj
Ext --> mdpaper
Dash --> proj
π― Why This Tool?
Traditional paper writing tools require you to know exactly what you want before you start. But research is rarely that linear.
Medical Paper Assistant is different:
- π Explore First, Decide Later β Browse literature freely, save interesting papers, then decide your research direction
- π¬ Conversational Workflow β Chat naturally with AI to refine your ideas, not fight with forms
- π§ Guided Process β Step-by-step prompts guide you from concept to publication-ready manuscript
- π All-in-One β Search, write, cite, analyze, export β all integrated inside VS Code
| Traditional Tools | Medical Paper Assistant |
|---|---|
| Fixed templates, rigid workflow | Flexible, exploratory approach |
| Separate apps for search/write/cite | All-in-one: ~138 tools in VS Code |
| Manual reference management | Auto-save with verified PubMed data |
| Export then format | Direct Word export with journal styles |
| Learn complex UI | Natural language conversation |
π Quick Start
Prerequisites
| Requirement | Version | Check |
|---|---|---|
| Python | 3.12+ | python3 --version |
| Git | Any recent | git --version |
| VS Code | Latest | Help β About |
| GitHub Copilot | Extension | Extensions panel |
Install
# Clone with submodules
git clone --recursive https://github.com/u9401066/med-paper-assistant.git
cd med-paper-assistant
# Run setup script
./scripts/setup.sh # Linux/macOS
.\scripts\setup.ps1 # Windows PowerShell
The script will:
- β
Create Python virtual environment (
.venv/) - β Initialize pinned Git submodules from this repository
- β
Install all dependencies (via
uv) - β
Create
.vscode/mcp.jsonconfiguration formdpaper,pubmed-search,cgu,zotero-keeper,asset-aware, anddrawio - β Verify MedPaper and CGU startup paths
Important installation notes:
- The setup script uses pinned submodule commits for reproducible installs. It does not auto-track the latest upstream submodule HEAD.
- If you intentionally want newer submodule code, run
git submodule update --remote --mergeyourself and test before committing. drawiousesnpx -y @drawio/mcp, so Node.js/npm must be available on the machine.zotero-keeperandpubmed-searchare launched viauvxin the repo workflow. In the VSX workflow they may be provided either by MedPaper itself or by separate installed VS Code extensions.
Verify: In Copilot Chat, type /mcp β you should see mdpaper listed π
Optional Integrations
# Foam for reference linking (highly recommended)
code --install-extension foam.foam-vscode
# Draw.io for diagram generation
./scripts/setup-integrations.sh && ./scripts/start-drawio.sh
Windows PowerShell:
.\scripts\setup-integrations.ps1
.\scripts\start-drawio.ps1
π¬ MCP Prompts β Just Type and Go
In Copilot Chat, type these prompts to trigger guided workflows:
| Prompt | Description |
|---|---|
/mdpaper.search |
π Start here! Explore literature, save papers |
/mdpaper.concept |
π Develop research concept with novelty validation |
/mdpaper.draft |
βοΈ Write manuscript with auto-citations |
/mdpaper.analysis |
π Analyze CSV data, generate figures & Table 1 |
/mdpaper.format |
π Export to Word with journal formatting |
/mdpaper.clarify |
π Refine specific sections through conversation |
/mdpaper.project |
π Create or switch research projects |
/mdpaper.strategy |
βοΈ Configure search strategy (dates, filters) |
/mdpaper.help |
β Show all available commands |
π‘ Recommended Workflow:
/mdpaper.searchβ/mdpaper.conceptβ/mdpaper.draftβ/mdpaper.format
π§ Skill System + Project Memory
Our core differentiator: We don't just provide tools β we provide guided workflows that know how to combine tools effectively, AND project memory that remembers your research journey across sessions.
What is a Skill?
Tool = Single capability (search, save, analyze...)
Skill = Complete knowledge (how to combine tools to accomplish tasks)
26 Skills covering the full research lifecycle:
| Category | Skills | Triggers |
|---|---|---|
| π¬ Research | literature-review, concept-development, concept-validation, parallel-search |
"ζΎθ«ζ", "search", "concept", "validate" |
| βοΈ Writing | draft-writing, reference-management, word-export |
"ε―«θη¨Ώ", "draft", "citation", "export" |
| π Management | project-management, memory-updater, memory-checkpoint |
"ζ°ε°ζ‘", "εζ", "εζͺ" |
| π οΈ Development | git-precommit, code-refactor, test-generator, code-reviewer |
"commit", "refactor", "test" |
Project Memory
Each project maintains its own .memory/ folder, so the AI continues previous research coherently:
projects/{slug}/
βββ .memory/
β βββ activeContext.md β Agent's working memory
β βββ progress.md β Research milestones
βββ concept.md β Research concept (with π protected sections)
βββ references/ β Foam-compatible literature library
βββ drafts/ β Markdown drafts with [[citations]]
βββ data/ β CSV data files
βββ results/ β Figures, .docx exports
β¨ Key Features
Literature & References
- PubMed + Europe PMC + CORE search (37 search tools)
- PICO parsing for clinical questions
- MCP-to-MCP verified data β PMID sent directly, no agent hallucination
- Layered trust: π VERIFIED (PubMed) Β· π€ AGENT (AI notes) Β· βοΈ USER (your notes)
- Foam wikilinks:
[[author2024_12345678]]with hover preview & backlinks
Writing & Editing
- AI draft generation per section (Introduction, Methods, Results, Discussion)
- Citation-Aware Editing β
patch_draftvalidates all[[wikilinks]]before saving - Auto-fix citation format β
[[12345678]]β[[author2024_12345678]] - Novelty validation β 3-round independent scoring (threshold: 75/100)
- Anti-AI writing rules β Evidence funnel structure, no clichΓ©s
Data Analysis
- CSV dataset analysis with descriptive statistics
- Statistical tests (t-test, ANOVA, chiΒ², correlation, Mann-Whitney, Fisher's)
- Table 1 generator β Baseline characteristics with automatic variable detection
- Publication-ready figures (matplotlib/seaborn)
Export & Submission
- Word export with journal template support
- Cover letter + highlights generation
- Manuscript consistency checker
- Reviewer response generator (point-by-point format)
- Submission checklist (word count, figure format, etc.)
Infrastructure
- DDD Architecture (Domain-Driven Design) with clean layer separation
- 15 pre-commit hooks (ruff, mypy, bandit, pytest, prettier, doc-update...)
- Workspace State recovery for cross-session continuity
- uv for all Python package management
- MCP SDK features in active use β tools, elicitation, and progress notifications for long-running audit/review operations
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π€ User Layer β
β βββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββ β
β β VS Code β β Foam Extension β βDashboard β β
β β Editor β β [[wikilinks]] autocomplete β β(Next.js) β β
β β β β hover preview Β· backlinks β β β β
β βββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π€ Copilot Agent (Orchestrator) β
β 26 Skills + 15 Prompt Workflows + Agent Customization β
β /mdpaper.search β /mdpaper.concept β /mdpaper.draft β export β
βββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ¬ββββββββββ
β β β β
βΌ βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β π mdpaper β βπ pubmed- β βπ‘ cgu β βπ External β
β 88 tools β β search β β 13 tools β β MCPs (uvx) β
β β β 37 tools β β β β β
β β’ projects β β β’ PubMed β β β’ brainstorm β β π¨ drawio β
β β’ references β β β’ Europe PMC β β β’ deep_think β β β’ diagrams β
β β’ drafts β β β’ CORE β β β’ spark β β β
β β’ validation β β β’ PICO β β β’ methods β β π zotero β
β β’ analysis β β β’ Gene/Chem β β β β β’ import refs β
β β’ export β β β’ Session β β β β β
βββββββββ¬ββββββββ βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β πΎ Local Storage β
β projects/{slug}/ β
β βββ concept.md β Research concept with π protected sections β
β βββ references/{pmid}/ β Foam-compatible .md + metadata.json β
β βββ drafts/ β Markdown drafts with [[citations]] β
β βββ data/ β CSV data files β
β βββ results/ β Figures, .docx exports β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
MCP-to-MCP Direct Communication
When saving references, data flows directly between MCP servers β the Agent only passes a PMID, never full metadata:
Agent: "save PMID:24891204"
β
βΌ
mdpaper.save_reference_mcp(pmid="24891204")
β Direct HTTP call (not through Agent)
βΌ
pubmed-search: GET /api/cached_article/24891204
β Returns verified PubMed data
βΌ
Saved with layered trust:
π VERIFIED: PubMed data (immutable)
π€ AGENT: AI notes (marked source)
βοΈ USER: Your notes (editable)
π οΈ mdpaper MCP Tools
88 active tools organized into 7 groups, plus 3 MCP prompts and 3 MCP resources for official MCP clients.
π Project Management (17 tools)
Projects, exploration mode, workspace state recovery, diagram management.
| Key Tools | Description |
|---|---|
create_project / switch_project / delete_project |
Project lifecycle |
start_exploration / convert_exploration_to_project |
Explore-first workflow |
get_workspace_state / sync_workspace_state |
Cross-session recovery |
save_diagram / list_diagrams |
Draw.io integration |
setup_project_interactive |
Interactive paper type configuration |
update_authors |
Manage structured author metadata |
π Reference Management (12 tools)
Save, search, format, and manage references with Foam integration.
| Key Tools | Description |
|---|---|
save_reference_mcp |
Recommended β Save by PMID via MCP-to-MCP (verified data) |
list_saved_references / search_local_references |
Browse & search library |
format_references / set_citation_style |
Vancouver / APA / Nature |
sync_references |
Sync [[wikilinks]] to numbered references |
βοΈ Draft & Editing (13 tools)
Write, edit, cite β with built-in validation.
| Key Tools | Description |
|---|---|
draft_section / write_draft |
Create and write sections |
list_drafts / read_draft / delete_draft |
Draft lifecycle |
get_available_citations |
List all valid [[citation_key]] before editing |
patch_draft |
Citation-aware partial edit with wikilink validation |
insert_citation / suggest_citations |
Smart citation insertion |
scan_draft_citations / sync_references |
Citation management |
count_words |
Section and manuscript word-count checks |
β Validation (3 tools)
| Tool | Description |
|---|---|
validate_concept |
Full novelty scoring against the active concept |
validate_wikilinks |
Auto-fix [[12345678]] β [[author2024_12345678]] |
compare_with_literature |
Compare the current idea against saved references |
π Data Analysis (10 tools)
| Tool | Description |
|---|---|
analyze_dataset |
Descriptive statistics for CSV |
run_statistical_test |
t-test, ANOVA, chiΒ², correlation, etc. |
generate_table_one |
Baseline characteristics with auto variable detection |
create_plot |
Publication-ready figures |
insert_figure |
Insert figure into draft with archive validation |
insert_table |
Insert table into draft with archive validation |
list_assets |
List figures and tables in project results |
π Review & Audit (23 tools)
| Category | Key Tools |
|---|---|
| Pipeline Gates | validate_phase_gate, pipeline_heartbeat, validate_project_structure |
| Review Loop | start_review_round, submit_review_round, request_section_rewrite |
| Pipeline Control | pause_pipeline, resume_pipeline, approve_section |
| Audit & Hooks | run_quality_audit, run_writing_hooks, record_hook_event |
| Self-Evolution | run_meta_learning, verify_evolution, apply_pending_evolutions |
| Domain Constraints | check_domain_constraints, evolve_constraint |
| Data & Health | validate_data_artifacts, diagnose_tool_health, check_formatting |
π Export & Submission (10 tools)
| Category | Key Tools |
|---|---|
| Word Export | export_word, list_templates, start_document_session, verify_document |
| Pandoc Export | export_docx, export_pdf, preview_citations, build_bibliography |
| Submission | generate_cover_letter, generate_highlights |
π§© MCP Prompts & Resources
| Capability | Names / URIs | Purpose |
|---|---|---|
| Prompts | project_bootstrap, draft_section_plan, word_export_checklist |
Materialize guided prompt workflows through the official MCP prompt API |
| Resources | medpaper://workspace/state, medpaper://workspace/projects, medpaper://templates/catalog |
Surface live workspace state, project lists, and template metadata via MCP resources |
π pubmed-search MCP Tools (37 tools)
| Category | Key Tools |
|---|---|
| Search | search_literature, generate_search_queries, parse_pico |
| Databases | PubMed, Europe PMC (fulltext + text mining), CORE (200M+ open access) |
| Gene/Chem | search_gene, get_gene_details, search_compound, search_clinvar |
| Exploration | find_related_articles, find_citing_articles, get_article_references |
| Export | prepare_export (RIS/BibTeX/CSV), get_citation_metrics (iCite RCR) |
| Session | get_session_pmids, list_search_history (survives AI memory limits) |
π‘ CGU Creative Tools (13 tools)
| Category | Key Tools |
|---|---|
| Ideation | generate_ideas, spark_collision, spark_collision_deep |
| Analysis | deep_think, multi_agent_brainstorm |
| Methods | list_methods, select_method, apply_method |
CGU runtime notes:
- In the repository workflow, CGU is started from the pinned submodule with
uv run --directory integrations/cgu python -m cgu.server. - In the VSX workflow, MedPaper registers CGU when bundled code or the workspace submodule is available; otherwise CGU is simply skipped.
- CGU itself supports Python
>=3.11, but this repository currently requires Python>=3.12, so cross-platform repo setup should be treated as Python 3.12 baseline on macOS, Linux, and Windows. - The default repo MCP example uses
CGU_THINKING_ENGINE=simple, which is the low-friction mode. Advanced LLM-backed modes still depend on CGU-side model/provider configuration.
π Foam Integration
| Feature | How to Use | Benefit |
|---|---|---|
| Wikilinks | [[greer2017_27345583]] |
Link references in drafts |
| Hover Preview | Mouse over any [[link]] |
See abstract without opening file |
| Backlinks Panel | Open reference file | See which drafts cite this paper |
| Graph View | Ctrl+Shift+P β Foam: Show Graph |
Visualize paper connections |
| Project Isolation | Auto-switches on switch_project |
Only see current project's references |
Citation Autocomplete
Type [[ in any draft to trigger the autocomplete menu:
According to previous studies [[ β Type [[ here
βββββββββββββββββββββββββββββββ
β π greer2017_27345583 β
β smith2020_12345678 β
β chen2019_87654321 β
βββββββββββββββββββββββββββββββ
Search by author ([[greer), year ([[2017), PMID ([[27345583), or keyword ([[sedation).
π Reference File Structure
References are stored with Foam-optimized, layered-trust structure:
references/{pmid}/
βββ {citation_key}.md β YAML frontmatter + abstract (human-readable)
βββ metadata.json β Full metadata (programmatic access)
---
# π VERIFIED (from PubMed, immutable)
title: "Complications of airway management"
author:
- { family: Pacheco-Lopez, given: Paulette C }
year: 2014
journal: Respiratory Care
pmid: "24891204"
_source:
mcp: pubmed-search
verified: true
# π€ AGENT (AI-generated, marked)
_agent:
notes: "Key review on airway complications"
relevance: high
# Foam
aliases: [pachecolopez2014, "PMID:24891204"]
tags: [reference, airway, review]
---
π Project Structure
med-paper-assistant/
βββ src/med_paper_assistant/ # Core MCP server (DDD architecture)
β βββ domain/ # Business logic, entities, value objects
β βββ application/ # Use cases, services
β βββ infrastructure/ # DAL, external services
β βββ interfaces/mcp/ # MCP server, 88 tools + 3 prompts + 3 resources
β
βββ integrations/ # Bundled MCP servers
β βββ pubmed-search-mcp/ # PubMed/PMC/CORE search (37 tools)
β βββ cgu/ # Creative generation (13 tools)
β
βββ vscode-extension/ # VS Code Extension
β βββ src/ # Extension source
β βββ skills/ # Agent skill definitions
β βββ prompts/ # Quick-action prompts
β
βββ dashboard/ # Next.js project management UI
β βββ src/
β
βββ projects/ # Research projects (isolated workspaces)
β βββ {slug}/
β βββ .memory/ # Cross-session AI memory
β βββ concept.md # Research concept
β βββ references/ # Local reference library
β βββ drafts/ # Markdown drafts
β βββ results/ # Figures, exports
β
βββ .claude/skills/ # 26 Agent skill definitions
βββ .github/prompts/ # 15 Prompt workflow files
βββ templates/ # Journal Word templates
βββ memory-bank/ # Global project memory
βββ tests/ # pytest test suite
πΊοΈ Roadmap
| Status | Feature | Description |
|---|---|---|
| β | 3 MCP Servers | mdpaper (88) + pubmed-search (37) + CGU (13) |
| β | Foam Integration | Wikilinks, hover preview, backlinks, project isolation |
| β | Project Memory | .memory/ for cross-session AI context |
| β | Table 1 Generator | Auto-generate baseline characteristics |
| β | Novelty Validation | 3-round scoring with 75/100 threshold |
| β | Citation-Aware Editing | patch_draft with wikilink validation |
| β | MCP-to-MCP Trust | Verified PubMed data via direct HTTP |
| β | Pre-commit Hooks | 15 hooks (ruff, mypy, bandit, pytest, prettier...) |
| π | Full VSX Extension | TreeView, CodeLens, Diagnostics (Direction C) |
| π | Pandoc Export | Word + LaTeX dual export with CSL citations |
| π | Systematic Review | PRISMA flow, Risk of Bias, meta-analysis |
| π | AI Writing Intelligence | Citation intelligence, coherence engine |
| π | REST API Mode | Expose tools as REST API |
Architecture Direction: Direction C β Full VSX + Foam + Pandoc
Legend: β Complete | π In Progress | π Planned
π€ Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
- π Report bugs β Open an issue
- π‘ Suggest features β Share your ideas
- π§ Submit code β Fork β Branch β PR
οΏ½ Citation
If you use Medical Paper Assistant in your research, please cite our paper:
@article{medpaper2025,
title = {MedPaper Assistant: A Self-Evolving, MCP-Based Framework for
AI-Assisted Medical Paper Writing with Closed-Loop Quality Assurance},
author = {[Authors]},
year = {2025},
note = {Submitted to medRxiv},
url = {https://github.com/u9401066/med-paper-assistant}
}
Note: This paper was produced entirely by the MedPaper Assistant's autonomous pipeline as a self-referential demonstration. The manuscript, audit trail, and all quality metrics are available in
projects/self-evolving-ai-paper-writing-framework/. The preprint is being submitted to medRxiv β this section will be updated with the DOI once available.
οΏ½π License
Apache License 2.0 β See LICENSE
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found