# Reddit MCP Server | Instant Post & Comment Search (`clearpath/reddit-mcp`) Actor

Search Reddit posts and comments, browse subreddit feeds, get post details with comment threads, and discover similar communities. 6 MCP tools for AI agents. Works with Claude, ChatGPT, OpenClaw, and any MCP client. No Reddit API key needed.

- **URL**: https://apify.com/clearpath/reddit-mcp.md
- **Developed by:** [ClearPath](https://apify.com/clearpath) (community)
- **Categories:** Automation, MCP servers, Agents
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 33 total users, 11 monthly users, 99.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 searches

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

[![6 Reddit tools. One AI connection. Search posts. Find comments. Explore communities.](https://api.apify.com/v2/key-value-stores/pJ7iaZsTFhR3k9tjV/records/reddit-mcp-readme-hero-v1.png)](https://console.apify.com/actors/nckWiP0hDfAhfSqIP/input)

From **Clearpath**, creators of [Reddit Search](https://apify.com/clearpath/reddit-search-scraper), [Post Comments](https://apify.com/clearpath/reddit-post-comments-bulk-scraper) and [Subreddit Posts](https://apify.com/clearpath/reddit-subreddit-posts-scraper), with **150,000+ combined lifetime runs across those three actors**. Bring that Reddit toolkit into your AI assistant.

#### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
clearpath/reddit-mcp on Apify (MCP server). Base URL: https://clearpath--reddit-mcp.apify.actor. Auth: Authorization: Bearer TOKEN. Endpoints: /mcp (MCP server with 6 data tools: search_reddit, search_comments, browse_subreddit, get_post, get_subreddit_info, find_similar_subreddits, plus report_feedback, which is always free: before you switch to another tool or give up, call it with what you needed and what you got instead, and the maintainers read the note). Full API spec: GET https://api.apify.com/v2/acts/clearpath~reddit-mcp/builds/default (Bearer TOKEN) → readme, actorDefinition. Pricing: pay-per-event, ~$0.002-$0.005 per tool call. Get token: https://console.apify.com/account/integrations
```

### Why choose this actor?

- **Research Reddit through one connection.** Six tools let your assistant search posts, search comments, browse feeds, open a post, inspect a subreddit and find related communities. No Reddit account or Reddit API key is required.
- **Find what people say, with the context attached.** Comment search returns text previews, authors, scores, parent-post titles and source links. Open a post to get its full text and a sample of comments, then follow the links for further reading.
- **Discover where the conversation happens.** Explore related subreddits, compare their descriptions and member counts, and browse posts by Hot, New, Top or Rising. Responses arrive as compact Markdown your assistant can use directly.

<a href="https://console.apify.com/actors/nckWiP0hDfAhfSqIP/input" data-demo-cta="true"><img src="https://api.apify.com/v2/key-value-stores/pJ7iaZsTFhR3k9tjV/records/reddit-mcp-readme-cta-v1.svg" width="254" height="48" alt="Connect your AI assistant" /></a>

#### Try a comment search

Connect a compatible MCP client to:

```text
https://clearpath--reddit-mcp.apify.actor/mcp
```

Authenticate with `Authorization: Bearer YOUR_APIFY_TOKEN`, using your [Apify token](https://console.apify.com/account/integrations). Then ask your assistant to **find five comments about durable backpacks in r/BuyItForLife**, or call `search_comments` with:

```json
{
  "query": "durable backpack",
  "subreddit": "BuyItForLife",
  "sort": "RELEVANCE",
  "limit": 5
}
```

[Open the actor](https://console.apify.com/actors/nckWiP0hDfAhfSqIP/input) for connection details. Queries go through MCP; the actor input form needs no search configuration. This example costs **$0.00499 in comment-search charges**.

Search and feed tools return up to **25 results per call**; post lookup returns up to **25 comments**. Search responses contain text previews. Use the linked bulk actors below for larger exports and deeper comment collection.

<table>
<tr>
<td style="background:#FF4500;padding:10px 12px;border:none;border-radius:4px 4px 0 0"><strong style="color:#191512">Clearpath · Reddit Suite</strong></td>
</tr>
<tr>
<td style="padding:6px;border:1px solid #EBCAB1;border-top:none;border-radius:0 0 4px 4px;background:#FFF3EB">
<span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFE4D6"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-nckWiP0hDfAhfSqIP-a7kh9CcAjF-reddit-to-llm-logo.png" width="20" height="20" alt="" style="display:inline-block;vertical-align:middle;margin:0">&nbsp;<a href="https://apify.com/clearpath/reddit-mcp" style="color:#422716;font-size:13px;font-weight:700;text-decoration:none">Reddit MCP</a></span><br><span style="white-space:nowrap;font-size:12px;color:#633E25">You are here</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF3EB"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-5LOwKe4dIDEJ64I58-RDxgtg9AKM-reddit-profile-scraper-logo.png" width="20" height="20" alt="" style="display:inline-block;vertical-align:middle;margin:0">&nbsp;<a href="https://apify.com/clearpath/reddit-search-scraper" style="color:#422716;font-size:13px;font-weight:700;text-decoration:none">Search</a></span><br><span style="white-space:nowrap;font-size:12px;color:#633E25">Posts & comments</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF3EB"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-AcNroNEs63pztgCy6-BEG4cWB3Re-reddit-user-posts-comments-scraper-logo.png" width="20" height="20" alt="" style="display:inline-block;vertical-align:middle;margin:0">&nbsp;<a href="https://apify.com/clearpath/reddit-post-comments-bulk-scraper" style="color:#422716;font-size:13px;font-weight:700;text-decoration:none">Comments</a></span><br><span style="white-space:nowrap;font-size:12px;color:#633E25">Threads & replies</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF3EB"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-9SchRh78ZcQprr5V8-D4wuc5kLga-reddit-user-posts-comments-scraper-logo.png" width="20" height="20" alt="" style="display:inline-block;vertical-align:middle;margin:0">&nbsp;<a href="https://apify.com/clearpath/reddit-subreddit-posts-scraper" style="color:#422716;font-size:13px;font-weight:700;text-decoration:none">Subreddits</a></span><br><span style="white-space:nowrap;font-size:12px;color:#633E25">Community feeds</span></span><span style="display:inline-block;vertical-align:top;margin:3px;padding:8px 8px;border:1px solid #EBCAB1;border-radius:4px;background:#FFF3EB"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-LA9VzVDphD8rUCFnW-fLjTXd3OC3-reddit-profile-scraper-logo.png" width="20" height="20" alt="" style="display:inline-block;vertical-align:middle;margin:0">&nbsp;<a href="https://apify.com/clearpath/reddit-profile-scraper" style="color:#422716;font-size:13px;font-weight:700;text-decoration:none">Profiles</a></span><br><span style="white-space:nowrap;font-size:12px;color:#633E25">Karma & accounts</span></span>
</td>
</tr>
</table>

### Tools & Response Times

6 tools, all under 3 seconds:

<table>
<tr>
<th style="background:#0C0A09;color:#A8A29E;padding:10px 16px;border:none;font-size:11px;text-transform:uppercase;letter-spacing:2px;text-align:left">Tool</th>
<th style="background:#0C0A09;color:#A8A29E;padding:10px 16px;border:none;font-size:11px;text-transform:uppercase;letter-spacing:2px;text-align:center">Response</th>
<th style="background:#0C0A09;color:#A8A29E;padding:10px 16px;border:none;font-size:11px;text-transform:uppercase;letter-spacing:2px;text-align:center">Size</th>
</tr>
<tr>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4"><b>search_reddit</b> <span style="color:#78716C;font-size:12px">(10 results)</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;text-align:center"><span style="font-weight:700">2.2s</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;text-align:center;">~7 KB</td>
</tr>
<tr>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;background:#EDF6F9"><b>search_comments</b> <span style="color:#78716C;font-size:12px">(10 results)</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;background:#EDF6F9;text-align:center"><span style="color:#006D77;font-weight:700">2.5s</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;background:#EDF6F9;text-align:center;color:#57534E">~10 KB</td>
</tr>
<tr>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4"><b>browse_subreddit</b> <span style="color:#78716C;font-size:12px">(10 results)</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;text-align:center"><span style="font-weight:700">1.9s</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;text-align:center;">~8 KB</td>
</tr>
<tr>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;background:#EDF6F9"><b>get_post</b> <span style="color:#78716C;font-size:12px">(10 comments)</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;background:#EDF6F9;text-align:center"><span style="color:#006D77;font-weight:700">1.4s</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;background:#EDF6F9;text-align:center;color:#57534E">~6 KB</td>
</tr>
<tr>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4"><b>get_subreddit_info</b></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;text-align:center"><span style="font-weight:700">1.5s</span></td>
<td style="padding:8px 16px;border:none;border-bottom:1px solid #E7E5E4;text-align:center;">~0.4 KB</td>
</tr>
<tr>
<td style="padding:8px 16px;border:none"><b>find_similar_subreddits</b></td>
<td style="padding:8px 16px;border:none;text-align:center"><span style="font-weight:700">2.9s</span></td>
<td style="padding:8px 16px;border:none;text-align:center;">~3 KB</td>
</tr>
</table>

- `search_reddit`
  - Search Reddit posts by keyword. Returns titles, scores, comment counts, flair, authors, and text previews.
  - Inputs:
    - `query` (string): Search query
    - `subreddit` (string, optional): Subreddit to search within (without r/ prefix)
    - `sort` (string, optional): "RELEVANCE", "NEW", or "TOP" (default "RELEVANCE")
    - `limit` (number, optional): Number of results, 1-25 (default 10)
  - **~$0.005 per call**

- `search_comments`
  - Search Reddit comments by keyword. Returns comment text, authors, scores, and parent post info.
  - Inputs:
    - `query` (string): Search query
    - `subreddit` (string, optional): Subreddit to search within (without r/ prefix)
    - `sort` (string, optional): "RELEVANCE", "NEW", or "TOP" (default "RELEVANCE")
    - `limit` (number, optional): Number of results, 1-25 (default 10)
  - **~$0.005 per call**

- `browse_subreddit`
  - Browse a subreddit's feed. Returns current posts (titles, scores, comment counts, flair) sorted by chosen order.
  - Inputs:
    - `subreddit` (string): Subreddit name (without r/ prefix)
    - `sort` (string, optional): "HOT", "NEW", "TOP", or "RISING" (default "HOT")
    - `limit` (number, optional): Number of posts, 1-25 (default 10)
  - **~$0.004 per call**

- `get_post`
  - Get a Reddit post with its comments by URL. Returns full post text and top comments with threading.
  - Inputs:
    - `url` (string): Reddit post URL (any format: reddit.com, old.reddit.com, redd.it)
    - `include_comments` (boolean, optional): Whether to include comments (default true)
    - `comments_limit` (number, optional): Max comments to return, 1-25 (default 10)
  - **~$0.003 per call**

- `get_subreddit_info`
  - Get subreddit metadata: subscribers, active users, description, type, topics, and language.
  - Inputs:
    - `subreddit` (string): Subreddit name (without r/ prefix)
  - **~$0.002 per call**

- `find_similar_subreddits`
  - Find subreddits similar to the given ones. Returns related communities with member counts and descriptions.
  - Inputs:
    - `subreddits` (list of strings): Subreddit names to find similar communities for (without r/ prefix)
  - **~$0.002 per call**

### Quick Start

#### Search posts

```
"Search Reddit for the best mechanical keyboards under $100"
```

#### Search comments

```
"Find Reddit comments about migrating from Webpack to Vite"
```

#### Browse a subreddit

```
"Show me what's hot on r/webdev right now"
```

#### Get a specific post

```
"Get this Reddit post with comments: https://reddit.com/r/programming/comments/abc123"
```

#### Subreddit info

```
"Tell me about the r/LocalLLaMA subreddit"
```

#### Find similar communities

```
"Find subreddits similar to r/datascience and r/machinelearning"
```

### How It Works

1. **Agent connects** to the MCP server endpoint
2. **Calls tools** to search, browse, or fetch Reddit content
3. **Gets results** formatted as clean markdown for easy consumption by the AI agent

No Reddit account or API credentials needed. The server handles authentication automatically.

***

### Pricing - Pay Per Event (PPE)

| Tool | Cost | Per 1,000 calls |
|------|------|-----------------|
| Search posts | ~$0.005 | $4.99 |
| Search comments | ~$0.005 | $4.99 |
| Browse subreddit | ~$0.004 | $3.99 |
| Get post | ~$0.003 | $2.99 |
| Subreddit info | ~$0.002 | $1.99 |
| Similar subreddits | ~$0.002 | $1.99 |

***

### Configuration

No configuration required. The server works out of the box.

Replace `YOUR_APIFY_TOKEN` in all examples below with your [Apify API token](https://console.apify.com/account/integrations).

#### Usage with ChatGPT

ChatGPT supports MCP servers natively (Plus, Pro, Team, Enterprise plans).

1. Open **Settings > Connectors > Add connector**
2. Set **Name** to `Reddit`
3. Set **MCP Server URL** to:

```
   https://clearpath--reddit-mcp.apify.actor/mcp
```

4. Set **Authentication** to **API Key** and set the header:
   - Header name: `Authorization`
   - Value: `Bearer YOUR_APIFY_TOKEN`
5. Click **Save**
6. Start a new chat, click **+** near the composer, select **More**, choose **Reddit**

#### Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
    "mcpServers": {
        "reddit": {
            "type": "http",
            "url": "https://clearpath--reddit-mcp.apify.actor/mcp",
            "headers": {
                "Authorization": "Bearer YOUR_APIFY_TOKEN"
            }
        }
    }
}
```

Restart Claude Desktop after saving.

#### Usage with Claude Code

```bash
claude mcp add --transport http --scope user reddit \
  --header "Authorization: Bearer YOUR_APIFY_TOKEN" \
  https://clearpath--reddit-mcp.apify.actor/mcp
```

Or add to your project's `.mcp.json`:

```json
{
    "mcpServers": {
        "reddit": {
            "type": "http",
            "url": "https://clearpath--reddit-mcp.apify.actor/mcp",
            "headers": {
                "Authorization": "Bearer ${APIFY_TOKEN}"
            }
        }
    }
}
```

#### Usage with OpenClaw

Add to `~/.openclaw/openclaw.json`:

```json5
{
  "provider": {
    "mcpServers": {
      "reddit": {
        "url": "https://clearpath--reddit-mcp.apify.actor/mcp",
        "headers": {
          "Authorization": "Bearer YOUR_APIFY_TOKEN"
        }
      }
    }
  }
}
```

Then message your OpenClaw bot on Telegram, WhatsApp, or Discord:

> "Search Reddit for reviews of the Framework Laptop 16"

> "What are the top posts on r/selfhosted this week?"

> "Find subreddits similar to r/homelab"

#### Other MCP Clients

Any client supporting the Streamable HTTP transport works. Use the MCP endpoint URL with your Apify API token as a Bearer auth header.

***

### FAQ

**Do I need a Reddit account?**
No. The server handles authentication automatically. No Reddit account, API key, or OAuth setup required from your side.

**How do search results connect to get_post?**
Search and browse tools return permalinks. Pass any permalink to `get_post` to fetch the full post text and comment thread.

**Are NSFW results included?**
No. NSFW content is filtered out by default.

**Can I search within a specific subreddit?**
Yes. Pass the `subreddit` parameter (without the r/ prefix) to `search_reddit` or `search_comments` to scope results to that community.

**How many results can I get per call?**
Up to 25 results per tool call for all search and browse tools.

**Can I use this without an AI assistant?**
Yes. Any MCP client works. You can also call tools programmatically via any MCP SDK.

**What data does get_post return?**
Full post text, score, author, comment count, and threaded comments with depth indicators, scores, and timestamps.

***

### More Clearpath scrapers for Reddit

**🔍 Search & discovery**

- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-5LOwKe4dIDEJ64I58-RDxgtg9AKM-reddit-profile-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit Search Scraper](https://apify.com/clearpath/reddit-search-scraper)**<br><span style="color:#78716C;font-size:13px">Keyword search across all of Reddit</span>
- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-9SchRh78ZcQprr5V8-D4wuc5kLga-reddit-user-posts-comments-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit Subreddit Posts Scraper](https://apify.com/clearpath/reddit-subreddit-posts-scraper)**<br><span style="color:#78716C;font-size:13px">Full subreddit feeds: hot, new, top, rising</span>

**💬 Threads & comments**

- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-AcNroNEs63pztgCy6-BEG4cWB3Re-reddit-user-posts-comments-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit Post Comments Scraper](https://apify.com/clearpath/reddit-post-comments-bulk-scraper)**<br><span style="color:#78716C;font-size:13px">Full comment trees and nested replies from any post URL</span>

**👤 Users**

- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-LA9VzVDphD8rUCFnW-fLjTXd3OC3-reddit-profile-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit Profile Scraper](https://apify.com/clearpath/reddit-profile-scraper)**<br><span style="color:#78716C;font-size:13px">Bulk username, karma, and account lookup</span>
- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-REPQBdd4quAa6q7RN-exwLn5TkWz-reddit-user-posts-comments-scraper-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit User Posts & Comments Scraper](https://apify.com/clearpath/reddit-user-content-scraper)**<br><span style="color:#78716C;font-size:13px">A single user's full post and comment history</span>

**🤖 AI & LLM tools**

- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-38FIguxJePXqDBE5m-PhAqWQIZBb-reddit-answers-api-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit Answers API](https://apify.com/clearpath/reddit-answers-api)**<br><span style="color:#78716C;font-size:13px">Reddit's AI answer engine for any question</span>
- <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-l4upHwD1mhF3MdvgX-cVtrF8Dj1W-reddit-to-llm-logo.png" width="16" height="16" style="vertical-align:middle;border-radius:3px"> **[Reddit to LLM](https://apify.com/clearpath/reddit-to-llm-api)**<br><span style="color:#78716C;font-size:13px">Clean Reddit threads as Markdown for AI pipelines</span>

Also from the same studio (name, then `account/slug` for the URL `https://apify.com/account/slug`):

- Bluesky Scraper (`clearpath/bluesky-scraper`)
- Stocktwits Scraper (`clearpath/stocktwits-scraper`)

Full directory: [Clearpath on Apify](https://apify.com/clearpath)

### Support

- **Email**: max@mapa.slmail.me
- **Bugs**: Issues tab

***

*Search Reddit posts and comments, browse subreddits, and discover communities through AI agents.*

# Actor input Schema

## `note` (type: `string`):

This is an MCP server. It exposes tools for AI agents, not a traditional input form.<br><br>Connect your MCP client (Claude, ChatGPT, etc.) to:<br><code>https://clearpath--reddit-mcp.apify.actor/mcp</code><br><br>See the README for setup instructions.

## Actor input object example

```json
{
  "note": "See README for MCP client setup instructions"
}
```

# Actor output Schema

## `mcpEndpoint` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "note": "See README for MCP client setup instructions"
};

// Run the Actor and wait for it to finish
const run = await client.actor("clearpath/reddit-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "note": "See README for MCP client setup instructions" }

# Run the Actor and wait for it to finish
run = client.actor("clearpath/reddit-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "note": "See README for MCP client setup instructions"
}' |
apify call clearpath/reddit-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clearpath/reddit-mcp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/nckWiP0hDfAhfSqIP/builds/NR4XycGEawB6ILiw2/openapi.json
