Skip to content

Commit 6a88799

Browse files
committed
feat: Claude Code plugin marketplace structure
- .claude-plugin/plugin.json: plugin manifest - .claude-plugin/marketplace.json: marketplace registry - .mcp.json: MCP server config (rawdoc --serve) - commands/rawdoc.md: /rawdoc <url> slash command - commands/rawdoc-crawl.md: /rawdoc-crawl <url> slash command - hooks/setup.sh: auto-builds Go binary on plugin install Install: /install-plugin RandomCodeSpace/rawdoc Requires: Go 1.24+
1 parent 9b805a4 commit 6a88799

12 files changed

Lines changed: 145 additions & 161 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "rawdoc-marketplace",
3+
"owner": {
4+
"name": "RandomCodeSpace",
5+
"email": "randomcodespace@users.noreply.github.com"
6+
},
7+
"metadata": {
8+
"description": "rawdoc — fetch web pages as clean markdown for AI agents",
9+
"version": "0.2.0"
10+
},
11+
"plugins": [
12+
{
13+
"name": "rawdoc",
14+
"description": "Fetch web pages as clean markdown. Strips noise, extracts content, 95%+ token reduction vs raw HTML.",
15+
"version": "0.2.0",
16+
"author": {
17+
"name": "RandomCodeSpace"
18+
},
19+
"source": ".",
20+
"category": "developer-tools",
21+
"tags": ["markdown", "web-scraper", "documentation", "mcp", "fetch"],
22+
"keywords": ["rawdoc", "markdown", "web-scraper", "documentation", "fetch", "crawl"]
23+
}
24+
]
25+
}

.claude-plugin/plugin.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "rawdoc",
3+
"version": "0.2.0",
4+
"description": "Fetch web pages as clean markdown for AI agents. Strips noise, extracts content, 95%+ token reduction.",
5+
"author": {
6+
"name": "RandomCodeSpace",
7+
"url": "https://github.com/RandomCodeSpace"
8+
},
9+
"homepage": "https://github.com/RandomCodeSpace/rawdoc",
10+
"repository": "https://github.com/RandomCodeSpace/rawdoc",
11+
"license": "MIT",
12+
"keywords": ["rawdoc", "markdown", "web-scraper", "documentation", "mcp", "fetch"]
13+
}

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dist/
88
.vscode/
99
.idea/
1010

11-
# IDE
11+
# Node
1212
node_modules/
1313

1414
# OS
@@ -18,6 +18,3 @@ Thumbs.db
1818
# Test artifacts
1919
xx.md
2020
/tmp/
21-
22-
# Plans (internal)
23-
docs/superpowers/

.mcp.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"mcpServers": {
33
"rawdoc": {
4-
"command": "node",
5-
"args": [
6-
"${CLAUDE_PLUGIN_ROOT}/start.mjs"
7-
]
4+
"command": "${CLAUDE_PLUGIN_ROOT}/rawdoc",
5+
"args": ["--serve"]
86
}
97
}
108
}

README.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@ Fetch web pages as clean markdown for AI coding agents.
44

55
[![CI](https://github.com/RandomCodeSpace/rawdoc/actions/workflows/ci.yml/badge.svg)](https://github.com/RandomCodeSpace/rawdoc/actions/workflows/ci.yml)
66

7-
Single Go binary. Fetches HTML, strips noise, outputs markdown. Supports single-page fetch and multi-page crawling by depth.
7+
Single Go binary. Fetches HTML, strips noise, outputs markdown. Works as a CLI and as a Claude Code plugin.
88

99
---
1010

1111
## Install
1212

13+
### Claude Code Plugin
14+
15+
```
16+
/install-plugin RandomCodeSpace/rawdoc
17+
```
18+
19+
Adds `/rawdoc` and `/rawdoc-crawl` commands plus `rawdoc_fetch` and `rawdoc_crawl` MCP tools. Requires Go installed on the machine (binary builds automatically on install).
20+
21+
### CLI Only
22+
1323
```bash
1424
go install github.com/RandomCodeSpace/rawdoc@latest
1525
```
@@ -148,45 +158,44 @@ Falls back to readability scoring when no selector matches.
148158

149159
---
150160

151-
## Claude Code MCP Plugin
161+
## Claude Code Plugin
152162

153-
rawdoc runs as an MCP stdio server with `--serve`. Two tools are exposed:
163+
### What You Get
154164

155-
- **`rawdoc_fetch`** — fetch a single page as markdown/json/text
156-
- **`rawdoc_crawl`** — crawl linked pages by depth
165+
| Component | Name | Description |
166+
|-----------|------|-------------|
167+
| Command | `/rawdoc <url>` | Fetch a page as markdown |
168+
| Command | `/rawdoc-crawl <url> [depth]` | Crawl linked pages |
169+
| MCP Tool | `rawdoc_fetch` | Programmatic single-page fetch |
170+
| MCP Tool | `rawdoc_crawl` | Programmatic multi-page crawl |
157171

158172
### Install
159173

174+
```
175+
/install-plugin RandomCodeSpace/rawdoc
176+
```
177+
178+
The setup hook builds the Go binary automatically. Requires Go 1.24+.
179+
180+
### Manual MCP Setup (without plugin)
181+
160182
```bash
161-
# 1. Install the binary
162183
go install github.com/RandomCodeSpace/rawdoc@latest
163-
164-
# 2. Add to Claude Code settings (~/.claude/settings.json)
165184
```
166185

186+
Add to `~/.claude/settings.json`:
187+
167188
```json
168189
{
169190
"mcpServers": {
170191
"rawdoc": {
171-
"type": "stdio",
172192
"command": "rawdoc",
173193
"args": ["--serve"]
174194
}
175195
}
176196
}
177197
```
178198

179-
That's it. Restart Claude Code — `rawdoc_fetch` and `rawdoc_crawl` appear as tools.
180-
181-
### CLI Usage (without MCP)
182-
183-
```bash
184-
rawdoc <url> — fetch docs as markdown
185-
rawdoc <url> --code-only — code blocks only
186-
rawdoc <url> -f json — structured output
187-
rawdoc <url> -d 2 -o dir/ — crawl to local directory
188-
```
189-
190199
---
191200

192201
## Exit Codes

commands/rawdoc-crawl.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
description: Crawl linked pages from a URL by depth
3+
argument-hint: <url> [depth]
4+
---
5+
6+
# rawdoc-crawl Command
7+
8+
Crawl a documentation site starting from the given URL. Use the `rawdoc_crawl` MCP tool.
9+
10+
## Instructions
11+
12+
1. Parse `$ARGUMENTS` — first word is URL, optional second word is depth (default: 1)
13+
2. Call `rawdoc_crawl` with `{"url": "<url>", "depth": <depth>}`
14+
3. Return the concatenated markdown for all crawled pages
15+
4. If the crawl fails, report the error clearly
16+
17+
## Examples
18+
19+
- `/rawdoc-crawl https://kubernetes.io/docs/concepts/workloads/` — crawl depth 1
20+
- `/rawdoc-crawl https://helm.sh/docs/ 2` — crawl depth 2

commands/rawdoc.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description: Fetch a web page as clean markdown
3+
argument-hint: <url>
4+
---
5+
6+
# rawdoc Command
7+
8+
Fetch the given URL and return clean markdown content. Use the `rawdoc_fetch` MCP tool.
9+
10+
## Instructions
11+
12+
1. Take the URL from `$ARGUMENTS`
13+
2. Call the `rawdoc_fetch` tool with `{"url": "$ARGUMENTS"}`
14+
3. Return the markdown content directly — do not summarize or modify it
15+
4. If the fetch fails, report the error clearly
16+
17+
## Examples
18+
19+
- `/rawdoc https://kubernetes.io/docs/concepts/workloads/pods/` — fetch K8s pods docs
20+
- `/rawdoc https://pkg.go.dev/fmt` — fetch Go fmt package docs
21+
- `/rawdoc https://www.baeldung.com/spring-kafka` — fetch Baeldung article

hooks/setup.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# Post-install hook: build rawdoc binary from Go source.
3+
# Runs when the plugin is installed or updated.
4+
5+
set -e
6+
7+
PLUGIN_DIR="$(cd "$(dirname "$0")/.." && pwd)"
8+
BINARY="$PLUGIN_DIR/rawdoc"
9+
10+
# Skip if binary already exists
11+
if [ -f "$BINARY" ]; then
12+
echo "[rawdoc] Binary exists: $BINARY"
13+
exit 0
14+
fi
15+
16+
# Try building from source
17+
if command -v go &>/dev/null; then
18+
echo "[rawdoc] Building from source..."
19+
cd "$PLUGIN_DIR"
20+
go build -ldflags="-s -w" -o "$BINARY" .
21+
echo "[rawdoc] Built: $BINARY"
22+
exit 0
23+
fi
24+
25+
# Try go install
26+
if command -v go &>/dev/null; then
27+
echo "[rawdoc] Installing via go install..."
28+
go install github.com/RandomCodeSpace/rawdoc@latest
29+
exit 0
30+
fi
31+
32+
echo "[rawdoc] Error: Go is not installed."
33+
echo "[rawdoc] Install Go from https://go.dev/dl/ then re-install this plugin."
34+
exit 1

openclaw.plugin.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)