Skip to main content

Overview

The AnySite MCP Tool for Claude Code provides seamless CLI-based integration between Claude Code and the AnySite API through the Model Context Protocol (MCP). This allows you to access LinkedIn, Instagram, Reddit, and other social media data extraction tools directly in your Claude Code sessions using terminal commands.

Prerequisites

  • Claude Code installed (download here)
  • Terminal/Command line access
  • AnySite API account with active subscription
  • Basic familiarity with command line interfaces

Why Claude Code Integration?

CLI Control

Full command-line control for developers and power users

Scope Management

Configure per-project, per-user, or locally with flexible scopes

CI/CD Ready

Perfect for automation, scripts, and continuous integration pipelines

Version Control

Project-scoped configs can be committed and shared via .mcp.json

Installation Steps

Step 1: Get Connection URL

First, obtain your connection URL from the AnySite dashboard:
  1. Visit anysite.io and log in to your account
  2. Navigate to MCP Server Integration section
  3. You’ll see two connection options:
    • OAuth URL: https://mcp.anysite.io/mcp (for GUI clients)
    • Direct URL: Contains API key directly (recommended for Claude Code)
AnySite MCP Server Integration - Get Connection URL
  1. In the “Or add to your client” section, select Claude Code
  2. The “Auto” tab will display the complete terminal command
For Claude Code, use the Direct URL which includes your API key in the connection string.
Keep your connection URL secure - it contains your API key. Never share it publicly or commit it to version control.

Step 2: Install via Terminal

Copy and run the command in your terminal:
claude mcp add --transport sse anysite "https://api.anysite.io/mcp/direct?api_key=YOUR_KEY"
Command breakdown:
  • claude mcp add - Add a new MCP server
  • --transport sse - Use Server-Sent Events transport
  • anysite - Name for this server (you can customize)
  • "URL" - Your Direct URL with API key
Optional parameters:
# Add with specific scope
claude mcp add --transport sse --scope user anysite "URL"

# Add with environment variable (more secure)
export ANYSITE_API_KEY="your_key_here"
claude mcp add --transport sse anysite "https://mcp.anysite.io/mcp" \
  --env API_KEY=$ANYSITE_API_KEY
Understanding Scopes:
  • local (default)
  • project
  • user
Project-specific, private
  • Configuration stored in current directory
  • Not shared or version controlled
  • Best for: Personal API keys, temporary setups
claude mcp add --scope local anysite "URL"

Step 3: Verify Installation

After installation, verify the MCP server is working: List all configured servers:
claude mcp list
Expected output:
anysite (sse)
  ✔ connected
  https://api.anysite.io/mcp/direct?api_key=***
Test specific server:
claude mcp get anysite
This command:
  • Tests the connection to AnySite MCP server
  • Shows available tools
  • Displays server status and configuration
Check within Claude Code conversation: During a Claude Code session, use:
/mcp
This shows real-time MCP server status and available tools.
If you see ”✔ connected” status, the installation was successful!

Managing Your Connection

View Installed Servers

# List all MCP servers
claude mcp list

# Get details for specific server
claude mcp get anysite

Update Server Configuration

To update the server URL or configuration:
  1. Remove existing server:
    claude mcp remove anysite
    
  2. Re-add with new configuration:
    claude mcp add --transport sse anysite "NEW_URL"
    

Remove Server

claude mcp remove anysite
Known Issue: claude mcp remove may not properly remove project-scoped servers. If this happens, manually edit:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Debug Mode

For troubleshooting connection issues:
claude --mcp-debug
This runs Claude Code with detailed MCP debug output, showing:
  • Connection attempts
  • Tool discovery
  • Error messages
  • Transport details

Configuration Files

Claude Code stores MCP configurations in different locations based on scope:
ScopeLocationPurpose
local./.claude-local.jsonCurrent directory only
project./.mcp.jsonProject root, version control
user~/.claude.jsonUser’s home directory

Troubleshooting

Solutions:
  • Restart Claude Code completely
  • Verify the API key is valid and active
  • Check internet connectivity
  • Test the URL in browser (should return JSON)
  • Use debug mode: claude --mcp-debug
  • Check AnySite dashboard for API quota
Solutions:
  • Restart Claude Code application
  • Run claude mcp get anysite to test connection
  • Verify subscription includes the tools you need
  • Remove and re-add the server:
    claude mcp remove anysite
    claude mcp add --transport sse anysite "URL"
    
  • Check if API key has expired
Solutions:
  • Ensure Claude Code is properly installed
  • Add Claude Code to your PATH:
    • macOS: Add to ~/.zshrc or ~/.bashrc
    • Windows: Add to System Environment Variables
  • Restart terminal after installation
  • Try full path: /Applications/Claude.app/Contents/MacOS/claude (macOS)
Solutions:
  • Check your internet connection speed
  • Increase timeout with environment variable:
    MCP_TIMEOUT=30000 claude  # 30 seconds
    
  • Try during off-peak hours
  • Contact AnySite support if persistent
Issue: Same server configured at multiple scopesSolutions:
  • List all servers to identify duplicates:
    claude mcp list
    
  • Remove from specific scope:
    # Remove from local
    rm ./.claude-local.json
    
    # Remove from project
    rm ./.mcp.json
    
    # Remove from user
    claude mcp remove anysite
    
  • Re-add with desired scope only
Best practices:
  1. Use environment variables:
    export ANYSITE_API_KEY="your_key"
    claude mcp add --transport sse anysite \
      "https://mcp.anysite.io/mcp" \
      --env API_KEY=$ANYSITE_API_KEY
    
  2. Never commit keys to git:
    # Add to .gitignore
    echo ".claude-local.json" >> .gitignore
    echo ".mcp.json" >> .gitignore
    
  3. Use project scope with env vars:
    # Team can share config, but not keys
    claude mcp add --scope project --transport sse anysite \
      "https://mcp.anysite.io/mcp" \
      --env API_KEY=$ANYSITE_API_KEY
    
  4. Rotate keys regularly from AnySite dashboard

Advanced Configuration

Multiple Environments

Configure different servers for dev/staging/production:
# Development
claude mcp add --scope local anysite-dev "https://dev-api.anysite.io/mcp?api_key=DEV_KEY"

# Production
claude mcp add --scope user anysite-prod "https://api.anysite.io/mcp?api_key=PROD_KEY"

Custom Server Names

Use descriptive names for better organization:
# By team
claude mcp add --transport sse marketing-anysite "URL"

# By project
claude mcp add --transport sse project-alpha-anysite "URL"

# By environment
claude mcp add --transport sse anysite-staging "URL"

Using with Different Transports

While SSE is recommended, you can try other transports:
# HTTP transport (if supported)
claude mcp add --transport http anysite "https://api.anysite.io/mcp/http"

# With custom headers
claude mcp add --transport http anysite "https://api.anysite.io/mcp" \
  --header "Authorization: Bearer YOUR_TOKEN" \
  --header "X-Custom-Header: value"

Comparison: Claude Code vs Other Integrations

FeatureClaude Code (CLI)Claude Desktop (GUI)Local Server
InterfaceCommand lineGraphical settingsConfig files
SetupTerminal commandClick-through OAuthPython server
Best ForDevelopers, automationGeneral usersFull control
Scope Control✅ local/project/user❌ Global only✅ Per config
CI/CD Ready✅ Yes❌ No✅ Yes
Auto Updates❌ Manual✅ Automatic❌ Manual
Debugging--mcp-debug⚠️ Limited✅ Full logs
Team Sharing✅ Via .mcp.json❌ Per machine✅ Via git
Security⚠️ API key in config✅ OAuth tokens⚠️ API key in env

Environment Variables

Useful environment variables for Claude Code MCP:
# Connection timeout (milliseconds)
export MCP_TIMEOUT=15000

# Maximum output tokens from MCP tools
export MAX_MCP_OUTPUT_TOKENS=50000

# Warning threshold for large outputs
export MCP_OUTPUT_WARNING_THRESHOLD=10000

# Run with debug mode
export CLAUDE_MCP_DEBUG=1
Add to your shell profile (~/.zshrc, ~/.bashrc) for persistent settings.

Security Best Practices

Environment Variables

Store API keys in environment variables, never hardcode in commands

Scope Selection

Use local scope for sensitive keys, project for shared configs

Git Ignore

Always add .claude-local.json and .mcp.json to .gitignore

Key Rotation

Regularly regenerate API keys from AnySite dashboard

Audit Access

Review configured servers periodically with claude mcp list

Remove Unused

Clean up old server configs to reduce security surface

Next Steps

Need Help?

Get Support

Contact our support team for assistance with Claude Code MCP integration