Skip to main content
Glama

Reddit MCP Tool

test_search.py•1 kB
#!/usr/bin/env python3 """ Quick search test for Reddit MCP Tool. """ from reddit_mcp.config import RedditConfig from reddit_mcp.reddit_client import RedditClient def main(): """Test search functionality.""" try: print("šŸ” Testing Reddit Search...") config = RedditConfig.from_env() client = RedditClient(config) # Test search posts = client.search_posts("python", "machine learning", limit=3) print(f"āœ… Search successful! Found {len(posts)} posts:") for i, post in enumerate(posts, 1): print(f" {i}. {post['title'][:60]}...") print(f" Score: {post['score']}, Comments: {post['num_comments']}") print("\nšŸŽ‰ Your Reddit MCP Tool search is working!") except Exception as e: print(f"āŒ Search failed: {e}") print("šŸ’” Make sure your Reddit app is type 'script' and credentials are correct") if __name__ == "__main__": main()

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/GeLi2001/reddit-mcp'

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