Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<a href="https://github.com/PaperDebugger/PaperDebugger?tab=AGPL-3.0-1-ov-file"><img src="https://img.shields.io/github/license/PaperDebugger/paperdebugger" alt="License"/></a>
</div>

**PaperDebugger** is an AI-powered academic writing assistant that helps researchers debug and improve their LaTeX papers with intelligent suggestions and seamless Overleaf integration. It is powered by a custom MCP-based orchestration engine that simulates the full academic workflow **Research → Critique → Revision**. <br>
**PaperDebugger** is an AI-powered academic writing assistant that helps researchers debug and improve their research papers with intelligent suggestions and seamless Overleaf integration, without leaving the editor. It is powered by a custom MCP-based orchestration engine that simulates the full academic workflow **Research → Critique → Revision**. <br>
This enables multi-step reasoning, reviewer-style critique, and structured revision passes beyond standard chat-based assistance.

<div align="center">
Expand All @@ -25,11 +25,11 @@ This enables multi-step reasoning, reviewer-style critique, and structured revis

## 🌐 Social Media & Community Groups
Our team is actively working to improve long-term reliability, hoping to iron out issues this month. Thank you for your patience. <br>
Stay connected with the PaperDebugger community! Join our [Discord](https://discord.gg/WwTMzzt9xD) or WeChat channels below for updates, announcements, and support.
Stay connected with the PaperDebugger community! Join our [Discord](https://discord.gg/WwTMzzt9xD) or WeChat channels for updates, announcements, and support.

<div align="center">
<img src="docs/imgs/discord.png" width="40%" style="margin: 0 1.5%;"/>
<img src="docs/imgs/wechat.jpg" width="40%" style="margin: 0 1.5%;"/>
<img src="docs/imgs/discord.png" width="40%" style="margin: 0 3%;"/>
<img src="docs/imgs/wechat.jpg" width="40%" style="margin: 0 3%;"/>
</div>


Expand Down Expand Up @@ -168,13 +168,15 @@ cp .env.example .env
```

#### 4. Custom MCP Backend Orchestration [OPTIONAL FOR LOCAL DEV]
Our enhanced orchestration backend, [**XtraMCP**](https://github.com/4ndrelim/academic-paper-mcp-server), is partially in-production but currently closed-source while under active development. If you wish to learn more about XtraMCP backend logic, refer to [/demo/xtramcp/readme.md](./demo/xtramcp/readme.md).<br>
Our enhanced orchestration backend, [**XtraMCP**](https://github.com/4ndrelim/academic-paper-mcp-server), is partially deployed in-production, with selected components enabled to **balance stability and operational cost** at this stage. It is still under active development and remains closed-source for now.

To understand the backend orchestration logic and view the currently available and gated features, as well as planned capabilities, refer to [/demo/xtramcp/readme.md](./demo/xtramcp/readme.md).<br>
You can still self-host PaperDebugger without it; all core features (chat, formatting, edits, comments) work normally.

Connecting to XtraMCP unlocks:
- research-mode agents,
- research-mode agents (with on-demand search for latest publications),
- structured reviewer-style critique,
- domain-specific revisions tailored to academic writing powered by [XtraGPT](https://huggingface.co/Xtra-Computing/XtraGPT-14B) models.
- domain-specific revisions tailored for academic writing powered by [XtraGPT](https://huggingface.co/Xtra-Computing/XtraGPT-14B) models.

We plan to **open-source XtraMCP** once the API stabilizes for community use.

Expand Down
56 changes: 38 additions & 18 deletions demo/xtramcp/readme.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
# XtraMCP Server – Orchestration Prompts
# XtraMCP Orchestration Layer

XtraMCP is a **custom MCP-based orchestration server** that powers PaperDebugger’s higher-level workflows:

- 🧑‍🔬 **Researcher** – find and position your work within the literature
- 🧑‍⚖️ **Reviewer** – critique drafts like a top-tier ML reviewer
- 🧑‍🔬 **Researcher** – find relevant papers and position your work within the literature
- 🧑‍⚖️ **Reviewer** – critique drafts like a top-tier ML conference reviewer
- ✍️ **Enhancer** – perform fine-grained, context-aware rewrites
- 🧾 **Conference Formatter** (WIP) – adapt drafts to conference templates (NeurIPS, ICLR, AAAI, etc.)

This document describes the core tools exposed by XtraMCP and how they combine into these workflows.

> **Note:** XtraMCP is currently **closed-source** while the API and deployment story stabilize.
> **Note:** XtraMCP (see [4ndrelim/academic-paper-mcp-server](https://github.com/4ndrelim/academic-paper-mcp-server)) is currently **closed-source** while the API and development stabilize.
> PaperDebugger runs fully without it; connecting XtraMCP unlocks the advanced research/review pipelines described here.

---

## Tool Overview

| Tool Name | Role | Purpose | Primary Data Source |
|---------------------------|-----------|-----------------------------------------------------------------|-----------------------------|
| `search_relevant_papers` | Researcher | Fast semantic search over recent CS papers in a local vector DB, enhanced with semantic re-ranker module | Local vector database |
| `deep_research` | Researcher | Multi-step literature synthesis & positioning of your draft | Local DB + retrieved papers |
| `online_search_papers` | Researcher | Online search over external academic corpora | OpenReview + arXiv |
| `review_paper` | Reviewer | Conference-style structured review of a draft | Your draft |
| `enhance_academic_writing`| Enhancer | Context-aware rewriting and polishing of selected text | Your draft + XtraGPT |
| `get_user_papers`| Misc | Fetch all papers, alongside description, published (OpenReview) by a specific user identified by email | User's email address
| Tool Name | Role | Purpose | Primary Data Source | Presently Deployed |
|---------------------------|-----------|-----------------------------------------------------------------|--------------------------------|----------------------|
| `search_relevant_papers` | Researcher | Fast semantic search over recent CS papers in a local vector DB, enhanced with semantic re-ranker module | Local DB | Yes |
| `deep_research` | Researcher | Multi-step literature synthesis & positioning of your draft | Local DB + retrieved papers analysis | *Temporarily Disabled* |
| `online_search_papers` | Researcher | Online search over external academic corpora | OpenReview + arXiv | Yes (*Partially*) with arXiv |
| `review_paper` | Reviewer | Conference-style structured review of a draft | Your draft + section-level review (static & semantic) | Yes (*Partially*) — Title, Abstract, Intro — to balance operational cost. |
| `verify_citations` | Reviewer | Ensure citations are grounded, valid, and traceable | Your draft's bibliography | *Coming Soon*! |
| `enhance_academic_writing`| Enhancer | Context-aware rewriting and polishing of selected text | Your draft + XtraGPT | *Temporarily Disabled* |
| `get_user_papers` | Misc / Researcher| Fetch all published papers with description, by a specific user | OpenReview | *Disabled* (requires auth; easy to enable with local deployment) |
| `search_user` | Misc | Fetch user's profile, including info such as publications, co-authors | OpenReview | *Disabled* (requires auth; easy to enable with local deployment)|

---

## 1. `search_relevant_papers`

**Purpose:**
Search for similar or relevant papers by keywords or extracted concepts against a **local database of academic papers**.<br>This tool uses semantic search with vector embeddings to find the most relevant results, enhanced with a re-ranker module to better capture nuance. It is fast and the default and recommended tool for paper searches.
Search for similar or relevant papers by keywords or extracted concepts against a **local corpus of ~800,000 academic papers**.<br>This tool uses semantic search with vector embeddings to find the most relevant results, enhanced with a re-ranker module to better capture nuance. It is fast and the default and recommended tool for paper searches.

**How it works:**

Expand All @@ -48,7 +50,7 @@ Search for similar or relevant papers by keywords or extracted concepts against
## 2. `deep_research`

**Purpose:**
Given a **research topic or draft paper**, perform multi-step literature exploration and synthesis. Summarize their findings, and provide insights on similarities and differences to assist in the research process.
Given a **research topic or draft paper**, perform multi-step literature exploration and synthesis. Summarize their findings, and provide insights on similarities and differences to assist in the research process. This helps you to position your work.

**How it works:**

Expand All @@ -62,7 +64,7 @@ Given a **research topic or draft paper**, perform multi-step literature explora
**Typical usage:**

- “deep_research to compare my draft to recent work on retrieval-augmented generation.”
- “For this topic, deep_research 5-10 relevant papers and explain where the open gaps are.”
- “For this topic, deep_research 5-10 relevant papers and explain where the open gaps are and what I can adopt.”

---

Expand Down Expand Up @@ -117,8 +119,26 @@ Analyze and review a draft against the standards of **top-tier ML conferences**
- “review_paper on method clarity and experimental rigor.”

---
## 5. `verify_citations`

## 5. `enhance_academic_writing`
**Purpose:**
Verify that citations in your draft are valid, grounded, and traceable, helping reduce the risk of desk rejection due to incorrect or unverifiable references.

**How it works**:
- Parses your bibliography and in-text citations.
- Verifies that cited papers, preprints, and URLs:
- exist and are reachable,
- correspond to real publications or preprints,
- match their claimed titles/authors/venues where possible.
- Flags any issues or un-verifiable sources.

Typical usage:
- “verify_citations”
- “Check whether any citations in this draft are invalid or unverifiable.”

---

## 6. `enhance_academic_writing`

**Purpose:**
Suggest **context-aware academic writing enhancements** for selected text.
Expand All @@ -137,7 +157,7 @@ Suggest **context-aware academic writing enhancements** for selected text.
- "enhance_academic_writing this paragraph to be clearer and more concise, preserving all technical details.”
- "enhance_academic_writing the abstract to be suitable for NeurIPS.”

## 6. `get_user_papers`
## 7. `get_user_papers`

**Purpose:**
Retrieve **all papers authored by a given user** (OpenReview), identified by email.
Expand All @@ -152,7 +172,7 @@ Useful for quickly assembling a researcher’s publication list or grounding con
- “get_user_papers for <author-email> in summary mode.”
- “Retrieve all publications by this researcher and then compare my draft using deep_research.”

## 7. Conference Formatter (WIP)
## 8. Conference Formatter (WIP)

Upcoming workflows will:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,22 @@ type JsonRpcProps = {
};

export const JsonRpc = ({ functionName, jsonRpcResult, preparing, animated }: JsonRpcProps) => {
const [isCollapsed, setIsCollapsed] = useState(false);

if (preparing) {
return (
<div className={cn("tool-card", { animated: animated })}>
<div className="flex items-center justify-between">
<h3 className="tool-card-title tool-card-jsonrpc">{functionName}</h3>
<h3 className="tool-card-title tool-card-jsonrpc">{"Calling " + functionName}</h3>
</div>
<LoadingIndicator text="Processing ..." estimatedSeconds={300} />
</div>
);
}

const toggleCollapse = () => {
setIsCollapsed(!isCollapsed);
};

return (
<div className={cn("tool-card noselect narrow", { animated: animated })}>
<div className="flex items-center justify-between cursor-pointer" onClick={toggleCollapse}>
<div className="flex items-center justify-between cursor-pointer">
<h3 className="tool-card-title tool-card-jsonrpc">{functionName}</h3>
<button
className="text-gray-400 hover:text-gray-600 transition-colors duration-200 p-1 rounded"
aria-label={isCollapsed ? "Expand" : "Collapse"}
>
<svg
className={cn("w-4 h-4 transition-transform duration-200", {
"rotate-180": !isCollapsed,
})}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
</svg>
</button>
</div>

<div
className={cn("canselect overflow-hidden transition-all duration-300 ease-in-out", {
"max-h-0 opacity-0": isCollapsed,
"max-h-[1000px] opacity-100": !isCollapsed,
})}
>
{jsonRpcResult.result && (
<div className="text-xs">
<MarkdownComponent animated={animated}>
{jsonRpcResult.result.content?.map((content) => content.text).join("\n") || ""}
</MarkdownComponent>
</div>
)}

{jsonRpcResult.error && <div className="text-xs text-red-600">{jsonRpcResult.error.message}</div>}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ type ToolsProps = {

// define a const string list.
const XTRA_MCP_TOOL_NAMES = [
// researcher tools
// RESEARCHER TOOLS
"search_relevant_papers",
"online_search_papers",
"deep_research",
// reviewer tools
// "deep_research",
// REVIEWER TOOLS
"review_paper",
// enhancer tools
"enhance_academic_writing",
// misc
"get_user_papers",
// "verify_citations"
// ENHANCER TOOLS
// "enhance_academic_writing",
// OPENREVIEW ONLINE TOOLS
// "get_user_papers",
// "search_user"
];

export default function Tools({ messageId, functionName, message, error, preparing, animated }: ToolsProps) {
Expand Down