@xjtlumedia/markdown-mcp-server 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +314 -0
- package/package.json +20 -6
package/README.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# AI Answer Copier — Markdown MCP Server
|
|
2
|
+
|
|
3
|
+
### Turn AI output into any document format. Instantly.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@xjtlumedia/markdown-mcp-server)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://registry.modelcontextprotocol.io)
|
|
8
|
+
[](https://github.com/XJTLUmedia/AI_answer_copier)
|
|
9
|
+
|
|
10
|
+
**A Model Context Protocol (MCP) server that gives your AI assistant the power to convert Markdown into 14 professional document formats** — PDF, DOCX, HTML, LaTeX, CSV, JSON, XML, XLSX, RTF, PNG, and more. Stop copy-pasting. Let the AI do the exporting.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Why AI Answer Copier?
|
|
15
|
+
|
|
16
|
+
You asked an AI to generate 20 exam questions. It delivered — beautifully. But then reality hits:
|
|
17
|
+
|
|
18
|
+
| Pain Point | Manual Workflow | With AI Answer Copier |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| **Extracting Q&A** | 10–15 min copying each line | **2 seconds** (auto-detect) |
|
|
21
|
+
| **Formatting Math** | 20 min fixing broken symbols | **Instant** (KaTeX support) |
|
|
22
|
+
| **LMS Upload** | 15 min manual CSV entry | **1-click** export |
|
|
23
|
+
| **Total Prep Time** | **~45–60 minutes** | **< 1 minute** |
|
|
24
|
+
|
|
25
|
+
**The last mile of AI workflows is broken.** Generating content takes seconds; formatting it for the real world takes an hour. This MCP server eliminates that gap entirely.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 14 Export Tools at Your AI's Fingertips
|
|
30
|
+
|
|
31
|
+
| Tool | Output Format | Use Case |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `harmonize_markdown` | Clean `.md` | Standardize messy AI output |
|
|
34
|
+
| `convert_to_txt` | Plain `.txt` | Strip all formatting |
|
|
35
|
+
| `convert_to_html` | `.html` | Web pages, email templates |
|
|
36
|
+
| `convert_to_pdf` | `.pdf` | Print-ready exams, handouts |
|
|
37
|
+
| `convert_to_docx` | `.docx` | Microsoft Word documents |
|
|
38
|
+
| `convert_to_latex` | `.tex` | Academic papers, journals |
|
|
39
|
+
| `convert_to_rtf` | `.rtf` | Rich text for legacy systems |
|
|
40
|
+
| `convert_to_csv` | `.csv` | Kahoot, Quizizz, Google Forms |
|
|
41
|
+
| `convert_to_json` | `.json` | APIs, Canvas LMS, custom apps |
|
|
42
|
+
| `convert_to_xml` | `.xml` | Moodle, Blackboard, SCORM |
|
|
43
|
+
| `convert_to_xlsx` | `.xlsx` | Excel spreadsheets |
|
|
44
|
+
| `convert_to_image` | `.png` | Social media, presentations |
|
|
45
|
+
| `convert_to_md` | `.md` | Documentation, GitHub |
|
|
46
|
+
| `generate_html` | Full HTML doc | Self-contained pages with inline styles |
|
|
47
|
+
|
|
48
|
+
Every tool accepts a `markdown` string input and an optional `output_path` to save directly to disk. Binary formats (PDF, DOCX, XLSX, PNG) intelligently guide the AI to save files rather than dumping raw base64.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
### Install via npx (Recommended)
|
|
55
|
+
|
|
56
|
+
No installation needed — just configure your MCP client:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"ai-answer-copier": {
|
|
62
|
+
"command": "npx",
|
|
63
|
+
"args": ["-y", "@xjtlumedia/markdown-mcp-server"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Install Globally
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install -g @xjtlumedia/markdown-mcp-server
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then configure your MCP client:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"ai-answer-copier": {
|
|
81
|
+
"command": "markdown-mcp-server"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Configuration by AI Client
|
|
90
|
+
|
|
91
|
+
### Claude Desktop
|
|
92
|
+
|
|
93
|
+
Edit `%APPDATA%\Claude\claude_desktop_config.json` (Windows) or `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"ai-answer-copier": {
|
|
99
|
+
"command": "npx",
|
|
100
|
+
"args": ["-y", "@xjtlumedia/markdown-mcp-server"]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Restart Claude Desktop. You'll see a 🔌 icon — all 14 conversion tools are now available to Claude.
|
|
107
|
+
|
|
108
|
+
### VS Code (GitHub Copilot)
|
|
109
|
+
|
|
110
|
+
Add to your `.vscode/mcp.json` or VS Code settings:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"servers": {
|
|
115
|
+
"ai-answer-copier": {
|
|
116
|
+
"command": "npx",
|
|
117
|
+
"args": ["-y", "@xjtlumedia/markdown-mcp-server"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Cursor / Windsurf / Any MCP Client
|
|
124
|
+
|
|
125
|
+
Use the same `npx` command pattern above in your client's MCP configuration.
|
|
126
|
+
|
|
127
|
+
### HTTP Mode (Vercel)
|
|
128
|
+
|
|
129
|
+
A hosted HTTP endpoint is also available for browser-based and remote integrations:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
https://ai-answer-copier.vercel.app/api/mcp
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Test it with the MCP Inspector:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npx @modelcontextprotocol/inspector https://ai-answer-copier.vercel.app/api/mcp
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Usage Examples
|
|
144
|
+
|
|
145
|
+
Once connected, just talk to your AI naturally:
|
|
146
|
+
|
|
147
|
+
> **"Generate 10 physics questions about Newton's Laws and export them as a Kahoot CSV."**
|
|
148
|
+
|
|
149
|
+
The AI will use `convert_to_csv` automatically.
|
|
150
|
+
|
|
151
|
+
> **"Convert this markdown into a Word document and save it to my Desktop."**
|
|
152
|
+
|
|
153
|
+
The AI calls `convert_to_docx` with `output_path: "C:/Users/you/Desktop/questions.docx"`.
|
|
154
|
+
|
|
155
|
+
> **"Take these lecture notes and produce a print-ready PDF."**
|
|
156
|
+
|
|
157
|
+
The AI calls `convert_to_pdf` with Puppeteer-powered rendering, full KaTeX math support, and syntax highlighting.
|
|
158
|
+
|
|
159
|
+
> **"Turn this into a Moodle-compatible XML quiz bank."**
|
|
160
|
+
|
|
161
|
+
The AI calls `convert_to_xml` with structured question/answer extraction.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Features
|
|
166
|
+
|
|
167
|
+
### Math & Code as First-Class Citizens
|
|
168
|
+
|
|
169
|
+
Full support for LaTeX math expressions and syntax-highlighted code blocks. Your `$\sqrt{x^2 + y^2}$` and Python snippets survive every conversion perfectly.
|
|
170
|
+
|
|
171
|
+
### Smart Binary Handling
|
|
172
|
+
|
|
173
|
+
Binary formats (PDF, DOCX, XLSX, PNG) don't dump raw base64 into chat. Instead, the server returns actionable guidance so the AI knows to save to a file path — a much better UX.
|
|
174
|
+
|
|
175
|
+
### GFM (GitHub Flavored Markdown)
|
|
176
|
+
|
|
177
|
+
Tables, task lists, strikethrough, autolinks — all parsed correctly via `remark-gfm`.
|
|
178
|
+
|
|
179
|
+
### Puppeteer-Powered PDF & PNG
|
|
180
|
+
|
|
181
|
+
PDF and image exports use headless Chromium for pixel-perfect rendering with:
|
|
182
|
+
- Full CSS styling
|
|
183
|
+
- KaTeX math rendering
|
|
184
|
+
- Syntax-highlighted code blocks
|
|
185
|
+
- Print-optimized layouts
|
|
186
|
+
|
|
187
|
+
### Self-Contained
|
|
188
|
+
|
|
189
|
+
Zero runtime dependencies on external APIs. Everything runs locally on your machine. Your data never leaves your computer.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Supported Formats Deep Dive
|
|
194
|
+
|
|
195
|
+
### For Educators
|
|
196
|
+
- **CSV/XLSX** → Direct upload to Kahoot, Quizizz, Google Forms
|
|
197
|
+
- **PDF** → Print and distribute physical exam papers
|
|
198
|
+
- **DOCX** → Edit in Word, share with colleagues
|
|
199
|
+
- **XML/JSON** → Import into Canvas, Moodle, Blackboard LMS
|
|
200
|
+
|
|
201
|
+
### For Developers
|
|
202
|
+
- **JSON** → Structured data for APIs and databases
|
|
203
|
+
- **XML** → Enterprise integrations, SOAP services
|
|
204
|
+
- **HTML** → Embed in web apps, email templates
|
|
205
|
+
- **LaTeX** → Academic publishing, research papers
|
|
206
|
+
|
|
207
|
+
### For Content Creators
|
|
208
|
+
- **PNG** → Social media posts, slide decks
|
|
209
|
+
- **HTML** → Blog posts, newsletters
|
|
210
|
+
- **Markdown** → Documentation, READMEs, wikis
|
|
211
|
+
- **RTF** → Universal rich text compatibility
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Architecture
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
┌─────────────────────┐
|
|
219
|
+
│ AI Client │
|
|
220
|
+
│ (Claude, Copilot, │
|
|
221
|
+
│ Cursor, etc.) │
|
|
222
|
+
└────────┬────────────┘
|
|
223
|
+
│ MCP Protocol (stdio)
|
|
224
|
+
▼
|
|
225
|
+
┌─────────────────────┐
|
|
226
|
+
│ AI Answer Copier │
|
|
227
|
+
│ MCP Server │
|
|
228
|
+
│ │
|
|
229
|
+
│ ┌─ remark/rehype ──┐│
|
|
230
|
+
│ │ Markdown Parser ││
|
|
231
|
+
│ └───────────────────┘│
|
|
232
|
+
│ ┌─ docx ───────────┐│
|
|
233
|
+
│ │ Word Generator ││
|
|
234
|
+
│ └───────────────────┘│
|
|
235
|
+
│ ┌─ puppeteer ──────┐│
|
|
236
|
+
│ │ PDF/PNG Renderer ││
|
|
237
|
+
│ └───────────────────┘│
|
|
238
|
+
│ ┌─ xlsx ───────────┐│
|
|
239
|
+
│ │ Excel Generator ││
|
|
240
|
+
│ └───────────────────┘│
|
|
241
|
+
│ ┌─ Custom Parsers ─┐│
|
|
242
|
+
│ │ CSV/JSON/XML/ ││
|
|
243
|
+
│ │ RTF/LaTeX/TXT ││
|
|
244
|
+
│ └───────────────────┘│
|
|
245
|
+
└─────────────────────┘
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Development
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Clone the repository
|
|
254
|
+
git clone https://github.com/XJTLUmedia/AI_answer_copier.git
|
|
255
|
+
cd AI_answer_copier/mcp-server
|
|
256
|
+
|
|
257
|
+
# Install dependencies
|
|
258
|
+
npm install
|
|
259
|
+
|
|
260
|
+
# Development mode (hot reload)
|
|
261
|
+
npm run dev
|
|
262
|
+
|
|
263
|
+
# Build for production
|
|
264
|
+
npm run build
|
|
265
|
+
|
|
266
|
+
# Test with MCP Inspector
|
|
267
|
+
npm run inspector
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Live Demo
|
|
273
|
+
|
|
274
|
+
Try the web interface (no install needed):
|
|
275
|
+
|
|
276
|
+
**[https://ai-answer-copier.vercel.app](https://ai-answer-copier.vercel.app)**
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Tech Stack
|
|
281
|
+
|
|
282
|
+
| Component | Technology |
|
|
283
|
+
|---|---|
|
|
284
|
+
| MCP SDK | `@modelcontextprotocol/sdk` |
|
|
285
|
+
| Markdown Parser | `unified` + `remark` + `rehype` |
|
|
286
|
+
| Math Rendering | `remark-math` + `rehype-katex` |
|
|
287
|
+
| Word Export | `docx` |
|
|
288
|
+
| Excel Export | `xlsx` |
|
|
289
|
+
| PDF/PNG Export | `puppeteer` |
|
|
290
|
+
| Schema Validation | `zod` |
|
|
291
|
+
| Runtime | Node.js (ESM) |
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Contributing
|
|
296
|
+
|
|
297
|
+
We welcome contributions! Whether it's a new export format, a bug fix, or documentation improvement:
|
|
298
|
+
|
|
299
|
+
1. Fork the [repository](https://github.com/XJTLUmedia/AI_answer_copier)
|
|
300
|
+
2. Create a feature branch
|
|
301
|
+
3. Submit a pull request
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## License
|
|
306
|
+
|
|
307
|
+
[MIT](https://opensource.org/licenses/MIT) © [XJTLUmedia](https://github.com/XJTLUmedia)
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
<p align="center">
|
|
312
|
+
<b>Built by educators, for educators.</b><br/>
|
|
313
|
+
<i>Reclaim 5 hours of your week. Let the AI handle the formatting.</i>
|
|
314
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xjtlumedia/markdown-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "AI Answer Copier — MCP Server that converts Markdown to 14 formats: PDF, DOCX, HTML, LaTeX, CSV, JSON, XML, XLSX, RTF, PNG and more. Built for educators and developers.",
|
|
5
5
|
"mcpName": "io.github.XJTLUmedia/markdown-formatter",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"bin": {
|
|
9
9
|
"markdown-mcp-server": "dist/index.js"
|
|
10
10
|
},
|
|
11
|
+
"homepage": "https://ai-answer-copier.vercel.app",
|
|
11
12
|
"repository": {
|
|
12
13
|
"type": "git",
|
|
13
14
|
"url": "https://github.com/XJTLUmedia/AI_answer_copier.git"
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
"markdown",
|
|
19
20
|
"converter",
|
|
20
21
|
"exporter",
|
|
22
|
+
"ai-answer-copier",
|
|
21
23
|
"pdf",
|
|
22
24
|
"docx",
|
|
23
25
|
"latex",
|
|
@@ -26,8 +28,18 @@
|
|
|
26
28
|
"json",
|
|
27
29
|
"xml",
|
|
28
30
|
"xlsx",
|
|
29
|
-
"rtf"
|
|
31
|
+
"rtf",
|
|
32
|
+
"png",
|
|
33
|
+
"education",
|
|
34
|
+
"quiz",
|
|
35
|
+
"kahoot",
|
|
36
|
+
"quizizz",
|
|
37
|
+
"lms",
|
|
38
|
+
"claude",
|
|
39
|
+
"copilot",
|
|
40
|
+
"ai-tools"
|
|
30
41
|
],
|
|
42
|
+
"author": "XJTLUmedia",
|
|
31
43
|
"license": "MIT",
|
|
32
44
|
"scripts": {
|
|
33
45
|
"start": "node dist/index.js",
|
|
@@ -38,7 +50,6 @@
|
|
|
38
50
|
},
|
|
39
51
|
"dependencies": {
|
|
40
52
|
"@modelcontextprotocol/sdk": "^0.6.0",
|
|
41
|
-
"@types/node": "^20.11.0",
|
|
42
53
|
"docx": "^9.5.1",
|
|
43
54
|
"puppeteer": "^23.0.0",
|
|
44
55
|
"rehype-katex": "^7.0.0",
|
|
@@ -49,10 +60,13 @@
|
|
|
49
60
|
"remark-parse": "^11.0.0",
|
|
50
61
|
"remark-rehype": "^11.1.0",
|
|
51
62
|
"remark-stringify": "^11.0.0",
|
|
52
|
-
"tsx": "^4.7.1",
|
|
53
|
-
"typescript": "^5.3.3",
|
|
54
63
|
"unified": "^11.0.5",
|
|
55
64
|
"xlsx": "^0.18.5",
|
|
56
65
|
"zod": "^3.23.8"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^20.11.0",
|
|
69
|
+
"tsx": "^4.7.1",
|
|
70
|
+
"typescript": "^5.3.3"
|
|
57
71
|
}
|
|
58
72
|
}
|