# HackerNews MCP Server - Usage Examples
This document provides practical examples of using the HackerNews MCP server.
## Quick Start Examples
### 1. Get Current Front Page Stories
Ask Claude (or your MCP client):
```
What are the top stories on HackerNews right now?
```
This will use the `get-front-page` tool.
### 2. Search for Specific Topics
Ask Claude:
```
Find recent HackerNews posts about AI safety
```
This will use the `search-posts` tool with query "AI safety".
### 3. Find Posts by Popular Authors
Ask Claude:
```
What has pg (Paul Graham) posted recently?
```
This will use the `get-posts-by-author` tool.
### 4. Get User Information
Ask Claude:
```
Tell me about the HackerNews user 'dang'
```
This will use the `get-user` tool.
## Advanced Usage Examples
### 5. Find High-Quality Recent Posts
Ask Claude:
```
Show me HackerNews stories from the last week with at least 200 points
```
This will use the `search-by-time-range` tool with appropriate filters.
### 6. Explore Show HN Projects
Ask Claude:
```
What are the latest Show HN posts?
```
This will use the `get-show-hn` tool.
### 7. Track Discussions on Topics
Ask Claude:
```
Find all HackerNews discussions about rust programming language from the past month
```
This will use `search-posts-by-date` with filters.
### 8. Analyze a Story's Comments
Ask Claude:
```
Get all comments for HackerNews story ID 12345
```
This will use the `get-story-comments` tool.
### 9. Find Posts Linking to Specific URLs
Ask Claude:
```
Has anyone posted about https://example.com on HackerNews?
```
This will use the `search-by-url` tool.
### 10. Browse Ask HN Questions
Ask Claude:
```
What questions are people asking on HackerNews?
```
This will use the `get-ask-hn` tool.
## Combining Tools
Claude can use multiple tools in sequence. For example:
Ask Claude:
```
Find the top story on HackerNews right now, then show me all its comments
```
This will:
1. Use `get-front-page` to get the top story
2. Extract the story ID
3. Use `get-story-comments` to get all comments
## Analysis Use Cases
### Content Discovery
```
Find the most discussed AI-related posts on HackerNews this month
```
### User Analysis
```
Analyze the posting patterns of user 'pg' - what types of content do they share?
```
### Trend Identification
```
What topics are trending on HackerNews this week?
```
### Research
```
Find all HackerNews discussions about GraphQL over the past year
```
## Time Range Examples
### Get Posts from Last 24 Hours
```
Show me all stories posted to HackerNews in the last 24 hours with more than 50 points
```
### Find Historical Content
```
What were the top stories on HackerNews on January 1, 2023?
```
## Filter Combinations
### Stories by Author with Minimum Points
```
Find all stories by 'dang' that got more than 100 points
```
### Comments in Time Range
```
Get all comments from the past 7 days on stories about TypeScript
```
## Pagination
For large result sets, you can request specific pages:
```
Show me page 2 of the latest Show HN posts
```
Or request more results per page:
```
Get the first 50 results for stories about Python
```
## Tips for Best Results
1. **Be Specific**: More specific queries yield better results
- Good: "Find HackerNews posts about React performance optimization"
- Less Good: "Find posts about React"
2. **Use Time Ranges**: When looking for recent content, mention the time period
- "Show me this week's top posts"
- "Find posts from the last 3 days"
3. **Specify Content Type**: Mention if you want stories, comments, or specific types
- "Get the latest Ask HN questions"
- "Find Show HN posts from today"
4. **Combine Filters**: You can combine multiple criteria
- "Find stories about machine learning with at least 200 points from the last month"
## Common Queries
### Daily Briefing
```
Give me a summary of today's top HackerNews stories
```
### Topic Deep Dive
```
Find everything on HackerNews about WebAssembly
```
### Community Pulse
```
What are the most active Ask HN discussions right now?
```
### Author Following
```
Has [username] posted anything new recently?
```
### Project Discovery
```
Show me interesting Show HN projects from this week
```
## Error Handling
If you encounter issues:
1. **Too Many Results**: Add filters or pagination
```
Get the first 10 results for...
```
2. **No Results**: Try broader search terms
```
Try "machine learning" instead of "ML model optimization"
```
3. **Rate Limiting**: If you hit rate limits, wait a few minutes between requests
## Integration with Workflows
### Morning Routine
```
What are the top 5 HackerNews stories this morning?
```
### Research Workflow
```
Find all HackerNews discussions about [your research topic], then summarize the key points
```
### Competitive Analysis
```
Find all mentions of [competitor] on HackerNews
```
### Tech News Digest
```
Summarize the top tech news from HackerNews this week
```
## Next Steps
- Explore the full API documentation in README.md
- Try combining multiple tools for complex queries
- Experiment with different filters and search parameters
- Set up regular queries for topics you care about