# jmiao24/paper2agent architecture

> Architecture diagram of the GitHub repository jmiao24/paper2agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jmiao24/paper2agent
- Repository: https://github.com/jmiao24/paper2agent

## Overview

Paper2Agent is a coding-agent skill system that turns research papers and associated code into delivered scientific agents, chiefly MCP servers and reusable skills. A user invokes the installed skill with paper/repository inputs and an output directory; the workflow coordinates specialist agents, prepares and implements tools, verifies them, and packages results for connection to an MCP client. The repository also contains a paper-to-skill publication path and concrete PDF/bundle utilities. Most orchestration detail is documented in skill references not excerpted here, so those workflow links are based on the README rather than inspected implementation.

Main entry points: [`skills/paper2agent/SKILL.md`](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/SKILL.md) (Paper2Agent skill), [`skills/paper2agent/paper2mcp/SKILL.md`](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/SKILL.md) (MCP server output), [`skills/paper2agent/paper2mcp/references/agents`](https://github.com/jmiao24/paper2agent/tree/main/skills/paper2agent/paper2mcp/references/agents) (Specialist agents), [`skills/paper2agent/paper2skill/scripts/paper_bundle.py`](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/paper_bundle.py) (Source bundling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Agent workflow"]
  node_skill["Paper2Agent skill<br/>[SKILL.md]"]
  node_paper_input["Paper and code"]
  node_specialists["Specialist agents"]
end

subgraph group_mcp["MCP generation"]
  node_tool_extract["Tool extraction"]
  node_tutorial["Tutorial workflow"]
  node_language_route["Language routing"]
  node_mcp_output["MCP server output<br/>[SKILL.md]"]
  node_verification["Server verification"]
  node_workflow_state["Workflow verification<br/>[verify_workflow.py]"]
  node_delivery["Usage and delivery<br/>[output-delivery.md]"]
end

subgraph group_publication["Paper packaging"]
  node_pdf_extract["PDF extraction<br/>[pdf_to_skill.py]"]
  node_bundle["Source bundling<br/>[paper_bundle.py]"]
  node_reading_package["Reading package<br/>[reading_package.py]"]
  node_paper_skill["Generated paper skill<br/>[SKILL.md]"]
end

subgraph group_utilities["Input utilities"]
  node_notebook_prep["Notebook inspection copy"]
  node_notebook_images["Notebook image extraction"]
end

node_user(("Researcher"))
node_client(("Coding-agent MCP client"))

node_user -->|"invokes"| node_skill
node_paper_input -->|"supplies inputs"| node_skill
node_skill -->|"coordinates"| node_specialists
node_specialists -.->|"extracts tools"| node_tool_extract
node_specialists -.->|"executes tutorials"| node_tutorial
node_skill -.->|"routes language"| node_language_route
node_skill -->|"generates MCP"| node_mcp_output
node_mcp_output -.->|"verified by"| node_verification
node_skill -.->|"checks workflow"| node_workflow_state
node_mcp_output -->|"documents delivery"| node_delivery
node_client -->|"connects to"| node_mcp_output
node_paper_input -->|"extracts PDF"| node_pdf_extract
node_bundle -->|"uses PDF tools"| node_pdf_extract
node_bundle -->|"prepares package"| node_reading_package
node_reading_package -.->|"publishes skill"| node_paper_skill
node_paper_input -->|"compacts notebook"| node_notebook_prep
node_paper_input -->|"extracts images"| node_notebook_images

click node_skill "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/SKILL.md"
click node_specialists "https://github.com/jmiao24/paper2agent/tree/main/skills/paper2agent/paper2mcp/references/agents"
click node_tool_extract "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/tool-selection-and-wrapping.md"
click node_tutorial "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/agents/tutorial-executor.md"
click node_language_route "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/language-routing.md"
click node_mcp_output "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/SKILL.md"
click node_verification "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/verify_mcp_server.py"
click node_workflow_state "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/verify_workflow.py"
click node_delivery "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/output-delivery.md"
click node_pdf_extract "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/pdf_to_skill.py"
click node_bundle "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/paper_bundle.py"
click node_reading_package "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/reading_package.py"
click node_paper_skill "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/SKILL.md"
click node_notebook_prep "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/preprocess_notebook.py"
click node_notebook_images "https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/extract_notebook_images.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skill,node_paper_input,node_specialists,node_client toneBlue
class node_tool_extract,node_tutorial,node_language_route,node_mcp_output,node_verification,node_workflow_state,node_delivery toneAmber
class node_pdf_extract,node_bundle,node_reading_package,node_paper_skill toneMint
class node_notebook_prep,node_notebook_images toneRose
class node_user toneIndigo
```

## Components

### Agent workflow

- [Paper2Agent skill](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/SKILL.md): `skills/paper2agent/SKILL.md`
- **Paper and code**
- [Specialist agents](https://github.com/jmiao24/paper2agent/tree/main/skills/paper2agent/paper2mcp/references/agents): `skills/paper2agent/paper2mcp/references/agents`

### MCP generation

- [Tool extraction](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/tool-selection-and-wrapping.md): `skills/paper2agent/paper2mcp/references/tool-selection-and-wrapping.md`
- [Tutorial workflow](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/agents/tutorial-executor.md): `skills/paper2agent/paper2mcp/references/agents/tutorial-executor.md`
- [Language routing](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/language-routing.md): `skills/paper2agent/paper2mcp/references/language-routing.md`
- [MCP server output](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/SKILL.md): `skills/paper2agent/paper2mcp/SKILL.md`
- [Server verification](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/verify_mcp_server.py): `skills/paper2agent/paper2mcp/scripts/verify_mcp_server.py`
- [Workflow verification](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/verify_workflow.py): `skills/paper2agent/paper2mcp/scripts/verify_workflow.py`
- [Usage and delivery](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/references/output-delivery.md): `skills/paper2agent/paper2mcp/references/output-delivery.md`

### Paper packaging

- [PDF extraction](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/pdf_to_skill.py): `skills/paper2agent/paper2skill/scripts/pdf_to_skill.py`
- [Source bundling](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/paper_bundle.py): `skills/paper2agent/paper2skill/scripts/paper_bundle.py`
- [Reading package](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/scripts/reading_package.py): `skills/paper2agent/paper2skill/scripts/reading_package.py`
- [Generated paper skill](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2skill/SKILL.md): `skills/paper2agent/paper2skill/SKILL.md`

### Input utilities

- [Notebook inspection copy](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/preprocess_notebook.py): `skills/paper2agent/paper2mcp/scripts/preprocess_notebook.py`
- [Notebook image extraction](https://github.com/jmiao24/paper2agent/blob/main/skills/paper2agent/paper2mcp/scripts/extract_notebook_images.py): `skills/paper2agent/paper2mcp/scripts/extract_notebook_images.py`

### Other components

- **Researcher**
- **Coding-agent MCP client**

## Connections

- Researcher → Paper2Agent skill: invokes (evidence: `README.md`)
- Paper and code → Paper2Agent skill: supplies inputs (evidence: `README.md`)
- Paper2Agent skill → Specialist agents: coordinates (evidence: `README.md`)
- Specialist agents → Tool extraction: extracts tools
- Specialist agents → Tutorial workflow: executes tutorials
- Paper2Agent skill → Language routing: routes language
- Paper2Agent skill → MCP server output: generates MCP (evidence: `README.md`)
- MCP server output → Server verification: verified by
- Paper2Agent skill → Workflow verification: checks workflow
- MCP server output → Usage and delivery: documents delivery (evidence: `README.md`)
- Coding-agent MCP client → MCP server output: connects to (evidence: `README.md`)
- Paper and code → PDF extraction: extracts PDF
- Source bundling → PDF extraction: uses PDF tools (evidence: `skills/paper2agent/paper2skill/scripts/paper_bundle.py`)
- Source bundling → Reading package: prepares package (evidence: `skills/paper2agent/paper2skill/scripts/paper_bundle.py`)
- Reading package → Generated paper skill: publishes skill
- Paper and code → Notebook inspection copy: compacts notebook (evidence: `skills/paper2agent/paper2mcp/scripts/preprocess_notebook.py`)
- Paper and code → Notebook image extraction: extracts images (evidence: `skills/paper2agent/paper2mcp/scripts/extract_notebook_images.py`)
