xml-pipeline/examples/mcp-servers/reddit-sentiment
dullfig 986db2e79b Implement native tools and infrastructure
Tools (18 total):
- calculate: Safe AST-based math expression evaluator
- fetch: Async HTTP with SSRF protection
- files: Sandboxed read/write/list/delete
- shell: Command execution with blocklist
- search: Web search (SerpAPI, Google, Bing)
- keyvalue: In-memory key-value store
- librarian: exist-db XML database integration
- convert: XML↔JSON conversion + XPath extraction

Infrastructure:
- CLI with run/init/check/version commands
- Config loader for organism.yaml
- Feature detection for optional dependencies
- Optional extras in pyproject.toml

LLM:
- Fixed llm_connection.py to wrap working router

WASM:
- Documented WASM listener interface
- Stub implementation for future work

MCP:
- Reddit sentiment MCP server example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 20:25:48 -08:00
..
__init__.py Implement native tools and infrastructure 2026-01-17 20:25:48 -08:00
__main__.py Implement native tools and infrastructure 2026-01-17 20:25:48 -08:00
pyproject.toml Implement native tools and infrastructure 2026-01-17 20:25:48 -08:00
README.md Implement native tools and infrastructure 2026-01-17 20:25:48 -08:00
reddit_sentiment.py Implement native tools and infrastructure 2026-01-17 20:25:48 -08:00

Reddit Sentiment MCP Server

An MCP server that provides Reddit sentiment analysis for stock tickers.

Installation

cd examples/mcp-servers/reddit-sentiment
pip install -e .

Usage with Claude Code

Add to your Claude Code settings (~/.claude/settings.json):

{
  "mcpServers": {
    "reddit-sentiment": {
      "command": "python",
      "args": ["-m", "reddit_sentiment"],
      "cwd": "/path/to/reddit-sentiment"
    }
  }
}

Tools

Get the most mentioned stock tickers across Reddit finance subreddits.

Trending tickers from r/wallstreetbets, r/stocks, r/investing

reddit_ticker_sentiment

Get sentiment analysis for a specific ticker.

What's the Reddit sentiment on $TSLA?

reddit_wsb_summary

Get a summary of current WallStreetBets activity.

What's happening on WSB right now?

How It Works

  1. Fetches posts from Reddit's public JSON API (no auth required)
  2. Extracts ticker symbols using regex ($TSLA, TSLA, etc.)
  3. Analyzes sentiment using bullish/bearish word matching
  4. Returns structured JSON with mentions, scores, and sentiment

Limitations

  • Reddit rate limits (~60 requests/minute without auth)
  • Simple word-based sentiment (no ML)
  • Only scans post titles and selftext (not comments)
  • Ticker extraction may have false positives

Subreddits Scanned

  • r/wallstreetbets
  • r/stocks
  • r/investing
  • r/options
  • r/stockmarket
  • r/thetagang
  • r/smallstreetbets