> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anysite.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server Examples

> Practical examples and use cases for the Anysite MCP Server

## Overview

This page provides practical examples of using the Anysite MCP Server with various AI tools and IDEs. Each example demonstrates real-world use cases and expected outputs.

## Claude Desktop Examples

### LinkedIn Lead Generation

**Prompt:**

> Find marketing managers at tech companies in San Francisco, get their profiles and recent posts

**MCP Server Response:**
The server will use multiple tools to fulfill this request:

1. **linkedin\_search\_users** - Find marketing managers in SF tech companies
2. **linkedin\_user\_profile** - Get detailed profiles for each person
3. **linkedin\_user\_posts** - Retrieve recent posts and activity

**Expected Output:**

```
Found 15 marketing managers at tech companies in San Francisco:

1. Sarah Chen - Senior Marketing Manager at Stripe
   - 8+ years experience in B2B SaaS marketing
   - Recent post: "The future of payment technology in 2024"
   - Profile: https://linkedin.com/in/sarahchen-marketing
   
2. Michael Rodriguez - VP Marketing at Airbnb
   - Expert in growth marketing and user acquisition
   - Recent post: "Building community-driven marketing campaigns"
   - Profile: https://linkedin.com/in/mrodriguez-growth

[... additional results ...]
```

### Competitive Analysis

**Prompt:**

> Analyze what our competitors are posting on LinkedIn and Instagram this week

**MCP Server Response:**

```
Competitive Analysis - Week of [Date]

LinkedIn Activity:
• Competitor A (TechCorp): 12 posts, avg 240 engagements
  - Top post: "AI transformation in enterprise" (450 likes)
  - Content themes: Product updates (40%), Thought leadership (60%)

• Competitor B (DataFlow): 8 posts, avg 180 engagements  
  - Top post: "New partnership announcement" (320 likes)
  - Content themes: Partnerships (50%), Case studies (50%)

Instagram Activity:
• Competitor A: 6 posts, avg 890 likes
  - Behind-the-scenes content performing well
  - Story highlights: Product demos, Team culture

• Competitor B: 4 posts, avg 650 likes
  - Customer success stories driving engagement
  - Heavy use of carousel posts
```

## Cursor IDE Examples

### Code Documentation Enhancement

**Prompt:**

> Research how similar APIs handle rate limiting and suggest improvements for our documentation

**MCP Server Response:**
The MCP server will search for rate limiting best practices and analyze competitor APIs:

```typescript theme={null}
// Suggested improvements based on research:

interface RateLimitConfig {
  // Standard headers (found in 85% of APIs researched)
  headers: {
    'X-RateLimit-Limit': number;
    'X-RateLimit-Remaining': number;
    'X-RateLimit-Reset': number;
    'X-RateLimit-Window': string; // e.g., "1hour", "15min"
  };
  
  // Progressive backoff (used by Stripe, GitHub, Twitter)
  backoffStrategy: {
    initial: number;    // 1000ms
    multiplier: number; // 2.0
    maximum: number;    // 30000ms
  };
  
  // Burst allowance (found in LinkedIn, Reddit APIs)
  burst: {
    enabled: boolean;
    limit: number;
    window: string;
  };
}
```

### Market Research Automation

**Prompt:**

> Find recent discussions about AI coding assistants on Reddit and Twitter

**MCP Server Response:**

```
AI Coding Assistant Discussions - Last 7 Days

Reddit Analysis:
• r/programming (234 mentions)
  - Top thread: "GitHub Copilot vs ChatGPT for coding" (1.2k upvotes)
  - Sentiment: 60% positive, 25% neutral, 15% negative
  - Key concerns: Code quality, learning impact, pricing

• r/MachineLearning (89 mentions)  
  - Focus on code generation models
  - Discussion about fine-tuning for specific languages

Twitter Analysis:
• 1,247 tweets mentioning "AI coding assistant"
• Top influencers: @programmer_dev, @ml_engineer, @tech_lead
• Trending topics: #CodeGeneration, #DeveloperProductivity
• Sentiment trend: Increasingly positive over the week
```

## Integration Examples

### Automated Content Pipeline

Create an automated pipeline for content creation:

<CodeGroup>
  ```python Python Script theme={null}
  import asyncio
  from hdw_mcp_client import HDWMCPClient

  async def create_content_pipeline():
      client = HDWMCPClient()
      
      # Step 1: Research trending topics
      reddit_trends = await client.reddit_search_posts({
          "query": "artificial intelligence",
          "subreddit": "technology",
          "sort": "hot",
          "limit": 10
      })
      
      # Step 2: Find thought leaders discussing these topics
      linkedin_leaders = await client.linkedin_search_users({
          "query": "AI executive OR AI researcher",
          "filters": {"industry": "Technology"},
          "limit": 20
      })
      
      # Step 3: Analyze their recent content
      content_analysis = []
      for leader in linkedin_leaders:
          posts = await client.linkedin_user_posts({
              "user_id": leader["id"],
              "limit": 5
          })
          content_analysis.append({
              "leader": leader["name"],
              "posts": posts,
              "engagement": sum(p["reactions"] for p in posts)
          })
      
      return {
          "trending_topics": reddit_trends,
          "thought_leaders": content_analysis,
          "content_opportunities": analyze_gaps(reddit_trends, content_analysis)
      }

  # Run the pipeline
  results = asyncio.run(create_content_pipeline())
  ```

  ```javascript Node.js theme={null}
  const { HDWMCPClient } = require('@horizondatawave/mcp-client');

  async function socialMediaMonitoring() {
    const client = new HDWMCPClient({
      apiKey: process.env.HDW_API_KEY
    });
    
    // Monitor brand mentions across platforms
    const [linkedinMentions, twitterMentions, redditMentions] = await Promise.all([
      client.linkedinSearchPosts({
        query: "YourBrandName OR @YourHandle",
        limit: 50
      }),
      client.twitterSearchPosts({
        query: "YourBrandName OR @YourHandle",
        resultType: "recent",
        limit: 100
      }),
      client.redditSearchPosts({
        query: "YourBrandName",
        sort: "new",
        limit: 25
      })
    ]);
    
    // Analyze sentiment and engagement
    const analysis = {
      totalMentions: linkedinMentions.length + twitterMentions.length + redditMentions.length,
      platforms: {
        linkedin: { count: linkedinMentions.length, avgEngagement: calculateEngagement(linkedinMentions) },
        twitter: { count: twitterMentions.length, avgEngagement: calculateEngagement(twitterMentions) },
        reddit: { count: redditMentions.length, avgEngagement: calculateEngagement(redditMentions) }
      },
      topMentions: getTopMentions([...linkedinMentions, ...twitterMentions, ...redditMentions])
    };
    
    return analysis;
  }
  ```
</CodeGroup>

### Lead Qualification Workflow

Automate lead research and qualification:

```bash CLI Usage theme={null}
# Research a potential client
hdw-mcp research-company "Acme Corp" \
  --include-employees \
  --include-recent-posts \
  --include-company-updates \
  --output leads/acme-corp-research.json

# Find decision makers
hdw-mcp find-decision-makers "Acme Corp" \
  --roles "CTO,VP Engineering,Head of Product" \
  --seniority senior \
  --location "San Francisco Bay Area"

# Analyze their content for warm intro opportunities  
hdw-mcp analyze-content leads/acme-corp-research.json \
  --find-connection-opportunities \
  --suggest-conversation-starters
```

## Advanced Use Cases

### Recruitment Pipeline

**Scenario:** Find and research potential job candidates

<Tabs>
  <Tab title="Claude Conversation">
    ```
    User: Find senior Python developers in NYC who are posting about machine learning

    MCP Server: I'll search for senior Python developers in NYC with ML interests...

    Found 25 qualified candidates:

    1. Alex Thompson - Senior ML Engineer at Meta
       • 6+ years Python, specializes in NLP
       • Recent post: "Building production ML pipelines with FastAPI"
       • Open to opportunities (LinkedIn status: #OpenToWork)
       
    2. Maria Gonzalez - Principal Data Scientist at Spotify  
       • Expert in recommendation systems
       • Recent post: "Why feature stores are game-changers"
       • Active in ML community, speaks at conferences

    [Additional candidates...]

    Would you like me to:
    • Get detailed profiles for any specific candidates?
    • Find their contact information?
    • Analyze their skill overlap with your job requirements?
    ```
  </Tab>

  <Tab title="Automated Script">
    ```python theme={null}
    # recruitment_pipeline.py
    async def find_candidates(job_requirements):
        # Search across multiple platforms
        candidates = []
        
        # LinkedIn search
        linkedin_candidates = await client.linkedin_search_users({
            "query": f"{job_requirements.skills} {job_requirements.location}",
            "filters": {
                "current_company": "exclude_competitors",
                "experience_level": job_requirements.seniority
            }
        })
        
        # GitHub activity analysis  
        for candidate in linkedin_candidates:
            if candidate.get("github_username"):
                github_activity = await client.github_user_activity(
                    candidate["github_username"]
                )
                candidate["github_score"] = score_github_activity(github_activity)
        
        return rank_candidates(linkedin_candidates, job_requirements)
    ```
  </Tab>
</Tabs>

### Market Intelligence Dashboard

Create a comprehensive market intelligence system:

```json theme={null}
{
  "dashboardConfig": {
    "updateFrequency": "daily",
    "sources": [
      "linkedin_company_updates",
      "twitter_competitor_mentions", 
      "reddit_industry_discussions",
      "google_news_alerts"
    ],
    "competitors": [
      "Competitor A",
      "Competitor B", 
      "Competitor C"
    ],
    "keywords": [
      "market trends",
      "product launches",
      "funding news",
      "partnership announcements"
    ]
  }
}
```

## Error Handling Examples

### Robust Request Handling

```typescript theme={null}
async function robustApiCall(toolName: string, params: any) {
  const maxRetries = 3;
  let attempt = 0;
  
  while (attempt < maxRetries) {
    try {
      const result = await mcpServer.call(toolName, params);
      return result;
    } catch (error) {
      attempt++;
      
      if (error.code === 'RATE_LIMIT_EXCEEDED') {
        // Wait and retry
        const waitTime = Math.pow(2, attempt) * 1000; // Exponential backoff
        await new Promise(resolve => setTimeout(resolve, waitTime));
        continue;
      }
      
      if (error.code === 'INVALID_CREDENTIALS') {
        throw new Error('API credentials need to be updated');
      }
      
      if (attempt === maxRetries) {
        throw error;
      }
    }
  }
}
```

## Performance Tips

### Batch Operations

Instead of individual calls, use batch operations when possible:

```javascript theme={null}
// ❌ Inefficient - Multiple individual calls
for (const user of users) {
  const profile = await client.linkedinUserProfile({ userId: user.id });
  profiles.push(profile);
}

// ✅ Efficient - Batch operation
const profiles = await client.linkedinBatchUserProfiles({
  userIds: users.map(u => u.id),
  batchSize: 10
});
```

### Caching Strategy

```javascript theme={null}
const cache = new Map();
const CACHE_TTL = 3600000; // 1 hour

async function cachedApiCall(toolName, params) {
  const cacheKey = `${toolName}:${JSON.stringify(params)}`;
  const cached = cache.get(cacheKey);
  
  if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
    return cached.data;
  }
  
  const result = await mcpServer.call(toolName, params);
  cache.set(cacheKey, { data: result, timestamp: Date.now() });
  
  return result;
}
```

## Next Steps

* [Installation Guide](/mcp-server/installation) - Get started with the MCP server
* [Available Tools](/mcp-server/tools) - Explore all 20+ available tools
* [Configuration](/mcp-server/configuration) - Detailed configuration options
