Skip to main content

Add your description here

Project description

Social Media Scraper - Custom MCP Server


Python FastMCP RapidAPI LinkedIn API Facebook API Instagram API Google Serper API


A comprehensive Model Context Protocol (MCP) server that provides social media scraping capabilities for LinkedIn, Facebook, Instagram, and Google search functionality.

What is MCP?

Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect with external data sources and tools. MCP servers act as bridges between AI models and various services, allowing for enhanced capabilities like real-time data access, API integrations, and custom tool execution.

Features

This server exposes the following tools for an AI assistant to use:

  • LinkedIn Profile Scraping: Extract personal and company profile data
  • Facebook Profile Scraping: Fetch public profile information
  • Instagram Profile Scraping: Get profile data and basic information
  • Google Search: Perform web searches using Google Serper API

Installation

Step 1: Adding MCP to your Python project

We recommend using uv to manage your Python projects.

If you haven't created a uv-managed project yet, create one:

uv init custom-mcp-server
cd custom-mcp-server

Step 2: Install MCP Dependencies

Then add MCP to your project dependencies:

uv add "mcp[cli]"

This will auto-generate files and folders similar to the project structure mentioned below, also create a .env file to securely store the API keys.

Step 3: Add Project Code

In the files generated look for main.py and copy paste the code given in main.py (repo).

Step 4: Install Additional Dependencies

uv add httpx python-dotenv fastmcp

Environment Configuration

Step 1: API Keys Setup

  1. RapidAPI Key:

    • Sign up at RapidAPI
    • Subscribe to the following APIs (Most Important):
      • Fresh LinkedIn Profile Data
      • Facebook Scraper3
      • Instagram Scraper Stable API
  2. Google Serper API Key:

    • Sign up at Serper.dev
    • Get your API key from the dashboard

Step 2: Environment Variables

Create .env file in your project root with the following variables:

RAPIDAPI_KEY=your_rapidapi_key_here
SERPER_API_KEY=your_serper_api_key_here

Usage

Running with Claude Desktop

Step 1: Install the Server

You can install this server in Claude Desktop and interact with it right away by running:

uv run mcp install main.py

Step 2: Verify Installation

Later, go to Claude AI (desktop version) and you will see changes in the platform similar to the screenshot shown.

Step 3: Start Using the Tools

Paste the URLs of required platform and ask the AI to provide information of the mentioned URLs.

Example Usage

Please scrape this LinkedIn profile: https://linkedin.com/in/example-profile
Get company information for: https://linkedin.com/company/example-company

Troubleshooting

If the MCP tools don't appear in Claude Desktop:

Step 1: End Claude Processes

  • Windows: Open Task Manager (Ctrl+Shift+Esc)
  • Mac: Open Activity Monitor
  • End all Claude-related processes

Step 2: Reinstall the Server

uv run mcp install main.py

Step 3: Restart Claude Desktop

Paste the URLs of required platform and ask the AI to provide information of the mentioned URLs.

Testing with MCP Inspector

Alternatively, you can test it with the MCP Inspector:

uv run mcp dev main.py

Project Structure

custom-mcp-server/
├── __pycache__/          # Python bytecode cache (auto-generated)
├── .venv/                # Virtual environment directory
├── .env                  # Environment variables (API keys)
├── .python-version       # Python version specification
├── main.py               # Main MCP server implementation
├── pyproject.toml        # Project configuration and dependencies
├── README.md             # Project documentation
└── uv.lock               # UV lock file for reproducible builds

Response Format

All tools return JSON-formatted strings containing the scraped data. Example response structure:

{
  "success": true,
  "data": {
    "profile": {
      "name": "John Doe",
      "title": "Software Engineer",
      "location": "San Francisco, CA",
      "bio": "Passionate about technology..."
    }
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

But using these tools via Claudes makes it readable.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

In case of any queries, please leave a message or contact me via the email provided in my profile.

Star this repository if you found it helpful!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_sharan_kumar_r_custom_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_sharan_kumar_r_custom_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_sharan_kumar_r_custom_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6df1914b97d57df712fc466ec1a821e8ed2bfb30dda6e40d1ad6564750af4b58
MD5 88a52f96a7f7b0de9f087cf7dccfaa5d
BLAKE2b-256 724a7353d221fad4da56720902569b73ad5543ae083da54b74517ba69018a4d5

See more details on using hashes here.

File details

Details for the file iflow_mcp_sharan_kumar_r_custom_mcp_server-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_sharan_kumar_r_custom_mcp_server-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_sharan_kumar_r_custom_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 291c58704df303d840e13f49cf186ea185aabf04a9e0d5462bb3d858c415b8c8
MD5 5dc59ab8a6a5b63a3ef6e1c2cca03f61
BLAKE2b-256 3e95a37459b13028092a75e00fcb692678bd746e0244ae01e46e8a4d17cde970

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page