Spaces:
Sleeping
Sleeping
docs: readme
Browse files
README.md
CHANGED
|
@@ -8,7 +8,68 @@ sdk_version: 5.34.2
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
-
short_description: XKCD Remote MCP
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
+
short_description: XKCD Remote MCP Server
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# XKCD MCP Server
|
| 15 |
+
|
| 16 |
+
A Model Context Protocol (MCP) server for fetching and searching XKCD comics, built with Gradio.
|
| 17 |
+
|
| 18 |
+
## Features
|
| 19 |
+
|
| 20 |
+
- **Get XKCD Comic**: Fetch specific comics by ID or get the latest comic
|
| 21 |
+
- **Search Comics**: Search through recent comics by title, alt text, and transcript
|
| 22 |
+
|
| 23 |
+
## Installation
|
| 24 |
+
|
| 25 |
+
1. Install dependencies:
|
| 26 |
+
```bash
|
| 27 |
+
pip install -r requirements.txt
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
2. Run the server:
|
| 31 |
+
```bash
|
| 32 |
+
python app.py
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## MCP Tools Available
|
| 36 |
+
|
| 37 |
+
### `get_xkcd_comic`
|
| 38 |
+
Fetch XKCD comic information by ID or get the latest comic.
|
| 39 |
+
|
| 40 |
+
**Parameters:**
|
| 41 |
+
- `comic_id` (str): Comic ID number (leave empty for latest comic)
|
| 42 |
+
|
| 43 |
+
**Returns:** JSON string with comic data including title, alt text, image URL, and metadata.
|
| 44 |
+
|
| 45 |
+
### `search_xkcd_transcript`
|
| 46 |
+
Search for XKCD comics by searching their transcripts and titles.
|
| 47 |
+
|
| 48 |
+
**Parameters:**
|
| 49 |
+
- `search_term` (str): Term to search for in comic transcripts and titles
|
| 50 |
+
|
| 51 |
+
**Returns:** JSON string with matching comics information.
|
| 52 |
+
|
| 53 |
+
## Deployment to Hugging Face Spaces
|
| 54 |
+
|
| 55 |
+
1. Create a new Space on Hugging Face
|
| 56 |
+
2. Upload `app.py` and `requirements.txt`
|
| 57 |
+
3. Set the Space to use Gradio SDK
|
| 58 |
+
4. Configure your MCP client to connect to the Space URL
|
| 59 |
+
|
| 60 |
+
## Usage with MCP Clients
|
| 61 |
+
|
| 62 |
+
Configure your MCP client (e.g., Claude Desktop) to connect to this server:
|
| 63 |
+
|
| 64 |
+
```json
|
| 65 |
+
{
|
| 66 |
+
"servers": {
|
| 67 |
+
"xkcd": {
|
| 68 |
+
"command": "python",
|
| 69 |
+
"args": ["app.py"]
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
Or use the Hugging Face Spaces URL if deployed online.
|