DEV Community

SuperLede
SuperLede

Posted on

Giving Claude Code a Reddit thread through a local MCP server

On 2026-10-29 I asked Claude Code to fetch a Reddit thread's .json URL. Its WebFetch tool refused, with this error:

Claude Code is unable to fetch from www.reddit.com
Enter fullscreen mode Exit fullscreen mode

A logged-out curl request from my terminal to the same URL got a 403:

curl -s -o /dev/null -w '%{http_code}\n' https://www.reddit.com/r/modnews/comments/1tq9vxo/.json
Enter fullscreen mode Exit fullscreen mode
403
Enter fullscreen mode Exit fullscreen mode

So I split the job. The browser, where I'm logged in to Reddit, exports the thread to a file. A small MCP server on my machine reads those files and hands them to Claude. Claude never talks to Reddit.

I make Comment Scraper, the Chrome and Edge extension that does the export, and comment-scraper-mcp, the server. This post points the server at some sample files, calls each tool by hand to see exactly what Claude will receive, then asks Claude a question and checks what it cites.

What you need

  • Node.js 22.19 or newer. The server itself runs on Node 20, but MCP Inspector 2.12.0, used below to call the tools by hand, needs 22.19.
  • Claude Code (other MCP clients work too, but the commands below are for Claude Code)
  • jq, to print the tool output as plain text

To follow along without the extension, use the made-up threads from the tests of my LangChain loader. They were written by the extension's own export code, so they have the same format as real exports:

mkdir -p cs-demo/exports && cd cs-demo
for f in which-crm.json pricing-nested.json hacker-news-two-threads.json; do
  curl -fsSL -o "exports/$f" "https://raw.githubusercontent.com/supertj/langchain-comment-scraper/ad480fb98e0e4e2f0d55537e3ad67147eb4c7ca2/tests/fixtures/$f"
done
Enter fullscreen mode Exit fullscreen mode

That's four threads in three files: a Reddit thread about CRMs whose export stopped early, a short Reddit thread about raising prices, and two Hacker News threads in one file.

For your own threads, open one with the extension's side panel, choose "JSON, one row per comment" or "JSON, replies nested", and export. The server doesn't read the CSV or Markdown exports.

I ran everything below with comment-scraper-mcp 0.1.2, MCP Inspector 2.12.0, Claude Code 2.1.310 and Node 26.3 on macOS. Outputs are pasted as printed.

Call the tools before Claude does

Before I give a server to Claude, I call it by hand and read what comes back. The MCP Inspector has a CLI mode for this. First, the tool list:

npx -y @modelcontextprotocol/inspector@2.12.0 --cli npx -y comment-scraper-mcp --dir ./exports \
  --method tools/list 2>/dev/null | jq -r '.tools[] | "\(.name)  readOnly=\(.annotations.readOnlyHint)"'
Enter fullscreen mode Exit fullscreen mode
list_threads  readOnly=true
read_thread  readOnly=true
search_comments  readOnly=true
get_comment  readOnly=true
Enter fullscreen mode Exit fullscreen mode

Four tools, all marked read-only. The server reads JSON files in the folders you give it and does nothing else: it doesn't write files and doesn't open network connections.

To call a tool, this shell function starts the server against ./exports, runs one tool and prints the text it returns. It works in bash and zsh:

call() {
  npx -y @modelcontextprotocol/inspector@2.12.0 --cli \
    npx -y comment-scraper-mcp --dir ./exports \
    --method tools/call --tool-name "$@" 2>/dev/null | jq -r '.content[].text'
}
Enter fullscreen mode Exit fullscreen mode

2>/dev/null hides the server's startup message. If a call prints nothing, drop it and look at the error. The first call is slow because npx downloads both packages.

list_threads

call list_threads
Enter fullscreen mode Exit fullscreen mode
4 exported threads:

- id: reddit:crm1
  title: Which CRM do small teams actually stick with?
  r/smallbusiness, exported 2026-10-10
  8 fetched, at least 2 known but not fetched, 12 reported by Reddit; partial (rate_limited)

- id: reddit:price1
  title: Raising prices as a freelancer
  r/smallbusiness, exported 2026-10-10
  2 fetched, at least 0 known but not fetched, 2 reported by Reddit; all known comments fetched

- id: hn:40001
  title: Ask HN: How do you price a side project?
  Hacker News, exported 2026-10-10
  2 fetched, at least 1 known but not fetched, 3 reported by Hacker News; stopped at plan limit (comment_limit)

- id: hn:40002
  title: Show HN: A tiny invoice generator
  Hacker News, exported 2026-10-10
  0 fetched, at least 0 known but not fetched, Hacker News doesn't report a total; all known comments fetched
Enter fullscreen mode Exit fullscreen mode

Each thread comes with three counts: comments fetched, comments known to exist but not fetched, and the total the site itself reports. The CRM export stopped at 8 of Reddit's 12 because Reddit rate-limited it. That line goes to Claude with every thread it reads, so Claude can tell you an answer is based on 8 of 12 comments instead of talking about "most people".

read_thread

You can name a thread by its id or by words from its title:

call read_thread --tool-arg thread=crm
Enter fullscreen mode Exit fullscreen mode
# Which CRM do small teams actually stick with?

r/smallbusiness · https://www.reddit.com/r/smallbusiness/comments/crm1/
8 fetched, at least 2 known but not fetched, 12 reported by Reddit; partial (rate_limited)
Exported 2026-10-10T12:00:00.000Z. Comment numbers like [c12] match the Markdown export of this thread.

## Post (score 50)

\# Which CRM?
We are four people.

## Comments

[c1] (score 214, 1d ago)
We left our CRM after the renewal doubled.

[c2] reply to [c1] (score 88, 1d ago, OP)
Ask for the year-two price in writing.

[c3] reply to [c2] (score 31, 1d ago, edited)
The export button was the first thing they hid.

[c4] reply to [c1] (score 2, 1d ago)
(removed)

[c5] (score hidden, 1d ago)
Email sync is what made us stay. Renewal was fine.

[c6] (score 3, 1d ago)
(deleted)

[c7] reply to [c6] (score 12, 1d ago)
\# Not a heading
We ended up on a spreadsheet.

Second paragraph.

[c8] reply to a comment not fetched (score 5, 1d ago)
Same here, the renewal email came with no warning.

Showing comments 1–8 of 8. That's the end of the thread.
Enter fullscreen mode Exit fullscreen mode

The last line means the end of this export, not of the thread: 4 of the 12 comments Reddit reports aren't in the file.

The rest is the extension's Markdown export format. Each comment has a number, and each reply names the comment it answers, so Claude doesn't have to work out the tree from indentation. Removed and deleted comments keep their place in the numbering, which is why [c7] here is the same [c7] as in the Markdown file the extension downloads. [c8] answers a comment that was never fetched, and its first line says so. The backslash before # stops a line that starts with # from being read as a heading.

Long threads come back 200 comments at a time, with the offset for the next page at the bottom. min_score leaves out comments below a score, along with comments whose score is hidden.

A title word that matches more than one thread gets you a list instead of a guess:

call read_thread --tool-arg thread=price
Enter fullscreen mode Exit fullscreen mode
"price" matches 2 threads. Use one of these ids:
- reddit:price1: Raising prices as a freelancer
- hn:40001: Ask HN: How do you price a side project?
Enter fullscreen mode Exit fullscreen mode

search_comments

call search_comments --tool-arg query=renewal
Enter fullscreen mode Exit fullscreen mode
4 matching comments, highest score first:

- Which CRM do small teams actually stick with? (reddit:crm1) [c1], score 214
  We left our CRM after the renewal doubled.
  https://www.reddit.com/r/smallbusiness/comments/crm1/_/a1/

- Raising prices as a freelancer (reddit:price1) [c1], score 12
  I raised my renewal rate by 20% and nobody left.
  https://www.reddit.com/r/smallbusiness/comments/price1/_/b1/

- Which CRM do small teams actually stick with? (reddit:crm1) [c8], score 5
  Same here, the renewal email came with no warning.
  https://www.reddit.com/r/smallbusiness/comments/crm1/_/a7/

- Which CRM do small teams actually stick with? (reddit:crm1) [c5], score hidden
  Email sync is what made us stay. Renewal was fine.
  https://www.reddit.com/r/smallbusiness/comments/crm1/_/a4/
Enter fullscreen mode Exit fullscreen mode

The matching is simple: a comment has to contain every word you pass, ignoring case. There's no stemming and no embeddings, so "renew" finds "renewal" but "renewal" won't find "renew". In the run further down, Claude searched for both.

There are two [c1]s in that output. Numbers count from 1 in each thread, so a citation needs the thread id as well.

get_comment

call get_comment --tool-arg thread=reddit:crm1 comment=c3
Enter fullscreen mode Exit fullscreen mode
# Which CRM do small teams actually stick with?

## Replying to

[c1] (score 214, 1d ago)
We left our CRM after the renewal doubled.

[c2] reply to [c1] (score 88, 1d ago, OP)
Ask for the year-two price in writing.

## The comment

[c3] reply to [c2] (score 31, 1d ago, edited)
The export button was the first thing they hid.
https://www.reddit.com/r/smallbusiness/comments/crm1/_/a3/

## No replies in this export
Enter fullscreen mode Exit fullscreen mode

This is the tool I use most after Claude answers. It puts a cited comment back in its chain, so I can see what it was replying to. Ask for a number that doesn't exist and you get an error back rather than an empty result:

call get_comment --tool-arg thread=reddit:crm1 comment=c9
Enter fullscreen mode Exit fullscreen mode
"c9" isn't a comment in this export. Numbers run from c1 to c8.
Enter fullscreen mode Exit fullscreen mode

The response is flagged as an error, so a client sees the lookup failed rather than reading an empty answer.

Add it to Claude Code

claude mcp add comment-scraper -- npx -y comment-scraper-mcp --dir "$PWD/exports"
claude mcp get comment-scraper
Enter fullscreen mode Exit fullscreen mode
comment-scraper:
  Scope: Local config (private to you in this project)
  Status: ✔ Connected
  Type: stdio
  Command: npx
  Args: -y comment-scraper-mcp --dir /…/cs-demo/exports
  Environment:

To remove this server, run: claude mcp remove comment-scraper -s local
Enter fullscreen mode Exit fullscreen mode

I shortened the path in Args. I pass an absolute path so it doesn't matter which directory the server is started from. Without --dir, the server reads your Downloads folder and the folders directly inside it, which is where the extension's exports end up. It recognises exports by their content, so renamed files are fine, and if you export the same thread twice it uses the newer file.

Ask Claude

claude -p "What do people in my exported threads say about renewal prices? Cite every point with the thread id and comment number, and say how complete each export is." \
  --allowedTools "mcp__comment-scraper"
Enter fullscreen mode Exit fullscreen mode

--allowedTools "mcp__comment-scraper" lets Claude call this server's tools without asking first. In this run it searched for "renewal" and then "renew", read all four threads, and looked up [c8] and one other comment with get_comment. Answers vary between runs, and a later run grouped the comments differently. Here is this run's answer, unedited:

Only 4 comments across your 4 exported threads mention renewals, and the sample is too small to show a trend.

What people say about renewal prices

Sudden renewal increases drove people away (reddit:crm1)

  • The thread's top comment (score 214) says their team left their CRM "after the renewal doubled" (reddit:crm1 [c1]).
  • Another commenter says the renewal email "came with no warning" (reddit:crm1 [c8]). It replies to a comment that wasn't fetched, so I can't tell whose experience it's agreeing with.

Advice: get the year-two price in writing (reddit:crm1)

  • The original poster replied to [c1] with "Ask for the year-two price in writing" (reddit:crm1 [c2], score 88).
  • A reply in the same chain says "the export button was the first thing they hid" (reddit:crm1 [c3]). That's about the vendor making it hard to leave, not about price.

Not everyone had a problem (reddit:crm1)

  • One commenter says email sync kept them on their CRM and "Renewal was fine" (reddit:crm1 [c5], score hidden).

The seller's side: a renewal increase that didn't cost customers (reddit:price1)

  • A freelancer says they "raised my renewal rate by 20% and nobody left" (reddit:price1 [c1]).
  • The only reply asks whether they warned clients in advance or just sent the new price (reddit:price1 [c2]). No answer was captured.

Related, but not about renewals (hn:40001)

  • These comments are about price changes in general, so treat them as context only. One says "Half my users never noticed the price change" (hn:40001 [c1]). Its reply says the people who left "were not paying much anyway" (hn:40001 [c2]).

How complete each export is

Thread Fetched Status
reddit:crm1: Which CRM do small teams actually stick with? 8 of 12 reported by Reddit Partial: stopped by a rate limit. At least 2 known comments weren't fetched. [c4] is "(removed)" and [c6] is "(deleted)". [c8]'s parent is missing.
reddit:price1: Raising prices as a freelancer 2 of 2 Complete.
hn:40001: Ask HN: How do you price a side project? 2 of 3 reported by HN Partial: stopped at your plan's comment limit. 1 comment is missing. All scores are hidden.
hn:40002: Show HN: A tiny invoice generator 0 Unknown. Nothing was fetched, and Hacker News doesn't report a total, so I can't tell whether the thread has no comments or the export missed them.

Most of the renewal discussion is in reddit:crm1, which is also the most incomplete export. At least a third of its comments are missing, including the one [c8] replies to, so a re-export once the rate limit clears may turn up more.

I read everything through Comment Scraper: a keyword search for "renewal" and "renew", plus a full read of all 4 threads. I didn't separately open the JSON files in exports/.

I checked it against the tool output above. Every quoted phrase appears in the comment it's attributed to, apart from a lowercased "The" at the start of the [c3] quote. [c3] is the comment get_comment showed under [c2], and Claude was right that it's about lock-in, not price. The [c8] caveat matches what get_comment says about its parent. "At least a third of its comments are missing" is 4 of Reddit's 12. On a real thread with a few hundred comments, I'd spot-check three or four citations this way rather than all of them.

One thing the transcript showed that the answer doesn't mention: Claude also ran ls on the folder, because my own Claude Code permission settings allow that. The server is read-only, but that doesn't make the session read-only. Comments are text written by strangers, and some of it can be written to look like instructions. When Claude is reading other people's comments, I keep the session's other permissions tight.

What it doesn't do

  • It doesn't fetch anything. If an export stopped early, the gap stays until you export the thread again in the browser.
  • It reads the JSON exports only, not CSV or Markdown.
  • What Claude reads through the tools goes to Anthropic, or to whichever model provider your client uses, under their terms. Exports leave out author fields. A username someone typed inside a comment stays as written.
  • Comment Scraper doesn't use Reddit's API and has no agreement with Reddit. The extension reads the thread you open, in your logged-in browser, when you click Export, with at least 1.5 seconds between requests. Reddit's User Agreement prohibits scraping without Reddit's prior written consent, so whether to use it, and the risk to your Reddit account, are yours to weigh. The extension's terms also don't allow using exports to train or fine-tune AI models.

The server is MIT-licensed, and the source is on GitHub at supertj/comment-scraper-mcp. The Claude Desktop config, copyable prompts and the steps for pasting a thread into ChatGPT are in the setup guide: https://comment-scraper.com/reddit-to-claude


I make Comment Scraper and comment-scraper-mcp. Every command in this post was run before publishing, and the outputs are pasted as printed.

Top comments (0)