Skip to main content
Glama
Ayesha0300

LinkedIn Profile Scraper MCP Server

by Ayesha0300

get_profile

Extract LinkedIn profile data from any public profile URL to retrieve professional information in structured JSON format.

Instructions

Get LinkedIn profile data for a given profile URL.

Args:
    linkedin_url: The LinkedIn profile URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkedin_urlYes

Implementation Reference

  • The handler function for the 'get_profile' tool, decorated with @mcp.tool() for registration. It calls the helper to fetch data and returns formatted JSON or error message.
    @mcp.tool()
    async def get_profile(linkedin_url: str) -> str:
        """Get LinkedIn profile data for a given profile URL.
    
        Args:
            linkedin_url: The LinkedIn profile URL.
        """
        data = await get_linkedin_data(linkedin_url)
        if not data:
            return "Unable to fetch LinkedIn profile data."
        return json.dumps(data, indent=2)
  • Helper utility that performs the actual HTTP request to the LinkedIn profile scraping API and returns the raw data or None on failure.
    async def get_linkedin_data(linkedin_url: str) -> dict[str, Any] | None:
        """Fetch LinkedIn profile data using the Fresh LinkedIn Profile Data API."""
        params = {
            "linkedin_url": linkedin_url,
            "include_skills": "true",
            "include_certifications": "false",
            "include_publications": "false",
            "include_honors": "false",
            "include_volunteers": "false",
            "include_projects": "false",
            "include_patents": "false",
            "include_courses": "false",
            "include_organizations": "false",
            "include_profile_status": "false",
            "include_company_public_url": "false"
        }
        headers = {
            "x-rapidapi-key": RAPIDAPI_KEY,
            "x-rapidapi-host": RAPIDAPI_HOST
        }
        async with httpx.AsyncClient() as client:
            try:
                response = await client.get(
                    f"{LINKEDIN_API_BASE}/get-linkedin-profile",
                    headers=headers,
                    params=params,
                    timeout=30.0
                )
                response.raise_for_status()
                return response.json()
            except Exception:
                return None
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ayesha0300/linkedin-profile-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server