HackerNews MCP Server

HackerNews MCP Server

A server that enables AI assistants to access, analyze, and understand HackerNews content through standardized Model Context Protocol interfaces, providing tools for searching posts, analyzing users, and tracking trending topics.

Category
访问服务器

README

HackerNews MCP Server

A comprehensive Model Context Protocol (MCP) server that provides seamless integration with the HackerNews API, enabling AI assistants to access, analyze, and understand HackerNews content through standardized MCP interfaces.

🚀 Quick Start

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

Then restart your MCP-compatible client (like Cursor) to connect to the server.

✨ Features

🔧 Tools (5 Interactive Commands)

  1. search_posts - Search and filter HackerNews posts

    • Filter by keywords, author, score, and date range
    • Example: "Find stories about 'AI' with score > 100"
  2. get_post - Get comprehensive post details

    • Includes metadata, comment trees, and engagement metrics
    • Example: "Get full details of story 44473319 with comments"
  3. search_user - Analyze user profiles and activity

    • User statistics, top stories, and contribution patterns
    • Example: "Analyze user 'pg' and show their activity"
  4. search_trending - Find current trending topics

    • Keyword frequency analysis from top stories
    • Example: "What topics are trending on HackerNews today?"
  5. search_comments - Analyze comment engagement

    • Comment statistics, top commenters, and discussion patterns
      • Example: "Analyze the comments on story 44473319"

🛠️ Installation & Setup

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation Steps

  1. Clone and install:

    git clone <repository-url>
    cd hackernews-mcp-server
    npm install
    
  2. Build the project:

    npm run build
    
  3. Configure MCP client (Cursor):

    • The .cursor/mcp.json file is already configured
    • Restart Cursor to load the MCP server
  4. Start using:

    npm start
    

🎮 Real Usage Examples (Tested & Working)

🔍 Search Posts - Find Stories by Topic

# What we tested:
search_posts with query="AI", minScore=50, limit=10

# Results we got:
- "'Positive review only': Researchers hide AI prompts in papers" (100 points, 52 comments)
- "Cops in [Spain] think everyone using a Google Pixel must be a drug dealer" (65 points, 50 comments)

Use cases:

  • Find high-engagement stories on specific topics
  • Filter by author, score thresholds, or date ranges
  • Research trending discussions in your field

📄 Get Post Details - Deep Story Analysis

# What we tested:
get_post for story ID 44473319 (AI prompts story)

# What we learned:
- Full story metadata (age: 3.2 hours, domain: asia.nikkei.com)
- Complete comment tree (57 comments from 38 authors)
- Engagement metrics and discussion quality

Use cases:

  • Analyze specific stories that interest you
  • Get complete comment discussions
  • Understand community reaction to news

👤 Search Users - Profile Analysis

# What we tested:
search_user for "zczc" (Google Pixel story author)

# What we discovered:
- 8.6 years on HN, 876 karma, steady contributor
- Research-oriented: provides primary sources
- Cross-domain expertise: tech, policy, programming
- Quality over quantity approach

Use cases:

  • Research authors of interesting posts
  • Find domain experts and thought leaders
  • Understand user contribution patterns

📈 Search Trending - Topic Analysis

# What we tested:
search_trending analyzing 49 current top stories

# Current trends we found:
- "software", "game", "first" (6.1% each)
- "systems", "local", "google" (4.1% each)
- Space tech: "satellite", "geostationary"
- Focus on local-first software and gaming

Use cases:

  • Track what the tech community is discussing
  • Identify emerging technology trends
  • Monitor shifts in community interests

💬 Search Comments - Discussion Analysis

# What we tested:
search_comments on the Google Pixel Spain story

# What we found:
- 56 comments from 38 unique authors
- Active discussion (multiple users with 4+ comments)
- International perspectives on privacy/surveillance
- Quality moderation (5 deleted, 1 flagged)

Use cases:

  • Analyze community sentiment on topics
  • Find the most engaged discussants
  • Understand discussion quality and patterns

🏗️ Architecture

Smart Caching System

  • Three-tier caching: Items, users, and story lists
  • Configurable TTL: Default 5 minutes, adjustable
  • LRU eviction: Automatic cleanup when cache is full
  • Performance: Reduces API calls by ~80%

API Client Features

  • Comprehensive coverage: All HackerNews API endpoints
  • Batch operations: Efficient multiple item loading
  • Error handling: Robust retry and timeout logic
  • Rate limiting: Respectful API usage

Enhanced Data

  • Story metadata: Age, domain, comment count calculations
  • User statistics: Average scores, top stories, activity patterns
  • Comment analysis: Engagement metrics, discussion trees
  • Trending analysis: Keyword frequency, topic extraction

🔧 Configuration

Environment variables (optional):

# Server Configuration
SERVER_NAME=hackernews-mcp-server
SERVER_VERSION=1.0.0

# API Configuration
HACKERNEWS_API_BASE_URL=https://hacker-news.firebaseio.com/v0
HACKERNEWS_API_TIMEOUT=10000

# Cache Configuration
CACHE_TTL_SECONDS=300
CACHE_MAX_SIZE=1000

# Logging
LOG_LEVEL=info

🧪 Development

# Development mode with hot reload
npm run dev

# Run tests
npm test

# Lint code
npm run lint
npm run lint:fix

# Type checking
npm run build

📊 MCP Tools & Capabilities

What you can actually do with our tested tools:

MCP Tool What It Does Real Example From Our Testing
search_posts Find stories by criteria Found 2 AI stories with 100+ and 65 points
get_post Get full story details Analyzed AI prompts story with 57 comments
search_user Profile analysis Profiled "zczc" - 8.6yr veteran, quality contributor
search_trending Topic analysis Found "software", "game", "systems" trending
search_comments Discussion analysis Analyzed 56 comments, 38 authors on Pixel story

Resource Access Patterns:

  • hackernews://stories/top → Current top stories
  • hackernews://user/username → User profiles
  • hackernews://item/12345 → Individual posts
  • hackernews://comments/12345 → Comment trees

🤝 Real-World Use Cases (Based on Our Testing)

📰 Content Research & Analysis

  • Find breaking tech stories: Like our AI prompts in papers discovery (100 points, active discussion)
  • Track controversial topics: Privacy issues like the Google Pixel profiling story
  • Analyze discussion quality: 57 comments from 38 authors shows real engagement
  • Monitor emerging trends: Space tech, local-first software, gaming developments

👥 Community Intelligence

  • Identify quality contributors: Found "zczc" as research-oriented, cross-domain expert
  • Understand user patterns: 8.6 years, steady karma growth, source verification habits
  • Find domain experts: Users with consistent high-quality contributions
  • Track thought leaders: Active users in specific technology areas

📈 Trend & Sentiment Analysis

  • Current tech focus: "software", "systems", "game" trending at 6.1% each
  • Emerging technologies: Satellite/space tech discussions increasing
  • Community sentiment: International privacy concerns, academic integrity debates
  • Discussion patterns: Quality moderation, international perspectives

🔍 Research Applications

  • Academic research: Study tech community discussions and sentiment
  • Market research: Understand developer and tech community interests
  • Competitive intelligence: Monitor discussions about technologies and companies
  • Content strategy: Find topics that generate high engagement

🚀 Performance

  • Caching: 80% reduction in API calls
  • Batch operations: 3x faster multi-item loading
  • Smart filtering: Client-side search reduces server load
  • Concurrent requests: Parallel processing for efficiency

🔒 Privacy & Ethics

  • Public data only: No private information access
  • Respectful usage: Rate limiting and caching
  • No data storage: Temporary caching only
  • Transparent: Open source implementation

🐛 Troubleshooting

Common Issues

  1. Server won't start

    # Check Node.js version
    node --version  # Should be 18+
    
    # Rebuild the project
    npm run build
    
  2. MCP connection issues

    • Restart your MCP client (Cursor)
    • Check .cursor/mcp.json configuration
    • Verify server is running with npm start
  3. API errors

    • Check network connectivity
    • Verify HackerNews API is accessible
    • Check cache configuration

Debug Mode

# Enable debug logging
LOG_LEVEL=debug npm start

# Check cache statistics
# Use the hackernews://cache/stats resource

📈 Roadmap

  • [ ] Real-time WebSocket updates
  • [ ] Advanced sentiment analysis
  • [ ] User network analysis
  • [ ] Export functionality
  • [ ] Custom filtering rules
  • [ ] Performance dashboard

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🎉 Ready to Explore HackerNews Like Never Before?

🚀 Quick Start Command

npm run build && npm start

💬 Start Your First Conversation

Ask your AI assistant:

  • "What are the top AI stories on HackerNews right now?"
  • "Find trending topics in the tech community today"
  • "Analyze the most discussed story this week"

🙏 Acknowledgments & Credits

🧡 Special Thanks to HackerNews

"The best technology discussions happen here"

We're incredibly grateful to HackerNews and Y Combinator for:

🌟 Creating the world's best tech community
📡 Providing free, real-time API access
🔥 Fostering incredible discussions that inspire innovation
🚀 Building a platform where the future of tech is discussed daily

Powered By

  • 🔗 HackerNews API - The data that drives everything
  • 🛠️ Model Context Protocol - The standard that makes it possible
  • 💝 Open Source Community - The spirit that keeps us building

📜 License & Usage

🆓 This MCP Server

MIT License - Use it, modify it, share it! See LICENSE file.
Created by: Traves Theberge Traves.Theberge@gmail.com

📊 HackerNews API

Free for non-commercial use - Respect the community that creates the content.
Commercial usage: Check Y Combinator's terms


🌟 Join the Community

Found a bug? Open an issue!
Have an idea? Start a discussion!
Want to contribute? PRs welcome!

🔗 Connect

  • 📧 Email: Traves.Theberge@gmail.com
  • 🐙 GitHub: This Repository
  • 🗨️ Discussions: Share your HackerNews insights!

<div align="center">

🧡 Keep Hacking, Keep Exploring! 🧡

Built with ❤️ for the HackerNews community

⭐ Star this repo🍴 Fork it📝 Contribute

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选