use-reddit-api — how to use use-reddit-api how to use use-reddit-api, use-reddit-api setup guide, reddit api for ai agents, use-reddit-api alternative, use-reddit-api vs praw, what is use-reddit-api, use-reddit-api install, use-reddit-api documentation

v1.0.0
GitHub

About this Skill

Perfect for Social Media Agents needing to leverage Reddit API interactions for enhanced community engagement. use-reddit-api is a skill that allows AI agents to utilize the Reddit API, providing access to context variables and functional imports for modular development.

Features

Imports reddit and context from @devvit/web/server
Utilizes context variables like userId, postId, and subredditId
Follows Coding Principles for functional, minimal, and readable code
Supports modular development with available imports
Accesses subredditId context variable always

# Core Topics

vigneshksaithal vigneshksaithal
[0]
[0]
Updated: 3/5/2026

Quality Score

Top 5%
33
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
> npx killer-skills add vigneshksaithal/decept/use-reddit-api
Supports 18+ Platforms
Cursor
Windsurf
VS Code
Trae
Claude
OpenClaw
+12 more

Agent Capability Analysis

The use-reddit-api MCP Server by vigneshksaithal is an open-source Community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use use-reddit-api, use-reddit-api setup guide, reddit api for ai agents.

Ideal Agent Persona

Perfect for Social Media Agents needing to leverage Reddit API interactions for enhanced community engagement.

Core Value

Empowers agents to interact with the Reddit API, utilizing context variables like userId, postId, and subredditId, enabling seamless integration with Reddit-integrated applications through libraries like @devvit/web/server.

Capabilities Granted for use-reddit-api MCP Server

Automating subreddit post monitoring using context.subredditId
Generating user-specific content recommendations based on context.userId
Debugging post engagement metrics with context.postId

! Prerequisites & Limits

  • Requires user login for access to context.userId
  • Dependent on @devvit/web/server library
  • Context variables may be undefined in certain scenarios
Project
SKILL.md
2.5 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Use Reddit API

All code must follow the Coding Principles in AGENTS.md (functional, minimal, readable, modular).

Available imports

typescript
1import { reddit, context } from '@devvit/web/server'

Context variables

VariableTypeAvailable when
context.userIdstring | undefinedUser is logged in
context.postIdstring | undefinedInside a post
context.subredditIdstringAlways
context.subredditNamestringAlways

Always guard optional context before use (see api-route skill for guard helpers).

Common operations

Get current user

typescript
1const user = await reddit.getCurrentUser() 2if (!user) { 3 return c.json({ status: 'error', message: 'Not logged in' }, 400) 4} 5const username = user.username

Get current subreddit

typescript
1const subreddit = await reddit.getCurrentSubreddit()

Submit a custom post

typescript
1const post = await reddit.submitCustomPost({ 2 subredditName: context.subredditName!, 3 title: 'My Post Title', 4 entry: 'default', // matches entrypoint key in devvit.json 5}) 6// post.id is the new post ID (e.g. "t3_abc")

Submit a comment

typescript
1await reddit.submitComment({ 2 postId: context.postId!, 3 text: 'Great job! 🎉', 4})

Set user flair

typescript
1await reddit.setUserFlair({ 2 subredditName: context.subredditName!, 3 username: user.username, 4 text: 'Champion 🏆', 5})

Navigation response (menu items)

When a menu item handler needs to redirect the user to a post:

typescript
1app.post('/internal/menu/create-game', async (c) => { 2 const post = await reddit.submitCustomPost({ 3 subredditName: context.subredditName!, 4 title: 'New Game', 5 entry: 'default', 6 }) 7 return c.json({ 8 navigateTo: `https://reddit.com/r/${context.subredditName}/comments/${post.id}`, 9 }) 10})

Constraints

  • Reddit API calls are server-side only — never from client Svelte code
  • 30-second request timeout applies to all operations
  • Error handling follows the api-route skill pattern (try/catch, instanceof Error)

Checklist before finishing

  • Tests written FIRST in src/server/__tests__/ using bun:test and devvit-mocks
  • All Reddit API calls are in server code (src/server/)
  • context.userId and context.postId guarded before use
  • Response uses standard shape from api-route skill
  • Menu item handlers return { navigateTo: url } when redirecting
  • bun run test passes with zero failures

Related Skills

Looking for an alternative to use-reddit-api or building a Community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

testing

Logo of lobehub
lobehub

Testing is a process for verifying AI agent functionality using commands like bunx vitest run and optimizing workflows with targeted test runs.

73.3k
0
Communication

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication