Skip to main content
Glama
enisze

Reddit MCP Server

by enisze

Reddit MCP Server

This MCP server allows Clients to interact with Reddit using OAuth2 authentication, enabling read-only access to search for posts within subreddits.

Features

  • Search posts: Search for posts within specific subreddits with various sorting options (relevance, hot, top, new, comments)

  • OAuth2 authentication: Secure authentication using Reddit's OAuth2 client credentials flow

  • Read-only access: Safe, read-only access to Reddit data without requiring user credentials

Related MCP server: Reddit MCP Server

Quick Start

  1. Create a Reddit application to get your API credentials:

  2. Add this configuration to your Claude Desktop config file:

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

{
  "mcpServers": {
    "reddit-mcp": {
      "command": "npx",
      "args": ["-y", "@enisze/reddit-mcp"],
      "env": {
        "REDDIT_CLIENT_ID": "your_client_id_here",
        "REDDIT_CLIENT_SECRET": "your_client_secret_here",
        "REDDIT_USER_AGENT": "reddit-mcp-server/1.0.0"
      }
    }
  }
}
  1. Restart Claude Desktop

That's it! Claude can now search Reddit through the search_posts tool.

Example Usage

Try asking Claude:

  • "Can you search for posts about 'artificial intelligence' in the MachineLearning subreddit?"

  • "Search for the top 10 posts about 'Claude AI' in the artificial subreddit"

  • "Find recent discussions about 'programming best practices' in the programming subreddit"

Environment Variables

  • REDDIT_CLIENT_ID: Your Reddit app's client ID

  • REDDIT_CLIENT_SECRET: Your Reddit app's client secret

  • REDDIT_USER_AGENT: User agent string (optional, defaults to "reddit-mcp-server/1.0.0")

Development

If you want to contribute or run from source:

  1. Clone the repository:

git clone <repository-url>
cd reddit-mcp
  1. Install dependencies:

npm install
  1. Build:

npm run build
  1. Run:

npm start
  1. Test:

# Run unit tests (no API credentials needed)
npm test

# Run API integration tests (requires Reddit credentials)
npm run test:api

Running Evaluations

To test the functionality of the Reddit MCP server:

npm run eval

This will run a series of evaluations to ensure all tools are working correctly.

Running Evals

The evals package loads an MCP client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.

OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/index.ts

Docker Support

You can also run this MCP server using Docker:

# Build the Docker image
docker build -t reddit-mcp .

# Run the container with environment variables
docker run -e REDDIT_CLIENT_ID=your_client_id \
           -e REDDIT_CLIENT_SECRET=your_client_secret \
           reddit-mcp

API Documentation

search_posts

Searches for posts in a Reddit subreddit using OAuth2 authentication.

Parameters:

  • query (string, required): Search query

  • subreddit (string, required): The subreddit name (without r/ prefix)

  • count (number, optional): Number of posts to return (1-100, default: 25)

  • sort (string, optional): Sort order - 'relevance', 'hot', 'top', 'new', 'comments' (default: 'relevance')

Troubleshooting

Authentication Issues

  • Make sure your Reddit client ID and secret are correct

  • Ensure your Reddit app is configured as a "script" type

  • Check that your user agent string is descriptive and unique

Rate Limiting

  • The server implements basic rate limiting (2 seconds between requests)

  • Reddit has its own rate limits - if you hit them, wait before retrying

Common Errors

  • "Subreddit not found": Check the subreddit name spelling

  • "OAuth2 authentication failed": Verify your Reddit app credentials

  • "Invalid credentials": Make sure your client ID and secret are correct

Testing

The project includes comprehensive tests to verify functionality:

Unit Tests

Run basic functionality tests without requiring Reddit API credentials:

npm test

These tests verify:

  • Response formatting

  • Type definitions

  • Data structure handling

  • Error handling logic

API Integration Tests

Test actual Reddit API functionality (requires credentials):

npm run test:api

Set up your credentials in .env first (copy from .env.example).

These tests verify:

  • OAuth2 authentication flow

  • Search functionality

  • API response handling

  • Error handling for various scenarios

See TEST.md for detailed testing instructions.

License

MIT

Available Tools

1 tool
search_postsB

Search for posts in a Reddit subreddit

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
subredditYesThe subreddit name (without r/ prefix)
countNoNumber of posts to return (1-100)
sortNoSort order for search resultsrelevance

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden for behavioral transparency. It only states the basic action without disclosing what the tool returns, side effects, limitations, or authentication needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is concise and wastes no words. However, it is not front-loaded with critical details like return value, but it serves as a minimal introduction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite the tool having 4 parameters and no output schema, the description provides no context about return values, error scenarios, or expected behavior, leaving the agent with limited understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema; it does not elaborate on parameter usage or relationships.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Search for posts in a Reddit subreddit', clearly indicating the action (search) and resource (posts) in a specific scope. However, it does not differentiate from sibling tools, but none exist, so it remains clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool or when not to. Usage is implied by the description, but no alternatives or context are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedsearch_posts

TDQS

B3.1/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion between tools. The tool's purpose is clear and distinct.

Naming Consistency5/5

A single tool inherently has consistent naming since there are no other tools to compare against.

Tool Count1/5

One tool for a Reddit server is severely inadequate. Reddit functionality typically requires multiple tools for different resources (posts, comments, subreddits, users).

Completeness1/5

The server is missing essential operations for Reddit, such as retrieving posts, managing comments, or interacting with subreddits. It only supports searching, leaving obvious gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables browsing and searching Reddit content through read-only tools that access Reddit's official API. Supports searching posts, retrieving subreddit information, fetching hot posts, and getting detailed post information.
    5
    4
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides AI assistants with read-only access to Reddit's API for browsing subreddits, reading posts and comments, searching Reddit, and retrieving user/subreddit information. Enables safe exploration of Reddit content without posting capabilities through natural language interactions.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables interaction with Reddit through the Reddit API, allowing users to search posts, retrieve saved content, fetch comments, reply to comments, and access detailed post information with comment trees.
    4
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/enisze/reddit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server