Spaces:
Sleeping
Sleeping
File size: 2,842 Bytes
e98cc10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | # Medium-MCP API Reference
## Overview
Medium-MCP provides a Model Context Protocol (MCP) server for scraping Medium articles.
---
## MCP Tools
### `medium_scrape`
Scrape a single Medium article.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | β
| Medium article URL |
| `force_refresh` | boolean | β | Bypass cache (default: false) |
| `output_format` | string | β | "markdown", "html", or "both" |
**Response:**
```json
{
"url": "https://medium.com/...",
"title": "Article Title",
"author": {"name": "...", "username": "..."},
"markdown_content": "...",
"html_content": "...",
"reading_time": 5,
"is_paywalled": false
}
```
---
### `medium_batch`
Scrape multiple articles in parallel.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `urls` | string[] | β
| List of URLs (max 20) |
**Response:**
```json
{
"success": [...],
"failed": [{"url": "...", "error": "..."}],
"total": 5,
"success_count": 4,
"fail_count": 1
}
```
---
### `medium_search`
Search for articles.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `query` | string | β
| Search query |
| `max_results` | number | β | Max results (1-20) |
**Response:**
```json
[
{"title": "...", "url": "...", "author": "..."}
]
```
---
### `medium_fresh`
Browse trending articles by tag.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tag` | string | β
| Tag name (e.g., "python") |
| `max_articles` | number | β | Max articles (1-20) |
---
### `medium_export`
Export article to file.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | β
| Article URL |
| `format` | string | β | "pdf", "html", "json", "md" |
---
### `medium_tts`
Convert article to audio.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | β
| Article URL |
| `voice` | string | β | Voice name (default: "george") |
---
## Error Codes
| Code | HTTP | Description |
|------|------|-------------|
| `INVALID_URL` | 400 | Invalid URL format |
| `ARTICLE_NOT_FOUND` | 404 | Article not found |
| `RATE_LIMITED` | 429 | Rate limit exceeded |
| `SCRAPE_FAILED` | 502 | Scraping failed |
| `TIMEOUT` | 504 | Request timeout |
---
## Rate Limits
- **60 requests/minute** per client
- **1000 requests/hour** daily limit
- Burst limit: 10 requests
---
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `GROQ_API_KEY` | β
| Groq API for LLM |
| `ELEVENLABS_API_KEY` | β | ElevenLabs TTS |
| `GEMINI_API_KEY` | β | Gemini fallback |
|