LinkedIn MCP Server: Integration Guide
Integrating LinkedIn data into your application using the Model Context Protocol (MCP) allows your AI agents to interact with professional network data seamlessly. By using HAPI MCP, you can wrap LinkedIn's API into a standardized interface.
Follow these steps to set up your LinkedIn MCP Server:
Prerequisites
- LinkedIn Developer Account: Sign up at the LinkedIn Developer Portal and create a new application.
- API Credentials: Obtain your Client ID and Client Secret from the application dashboard.
- OpenAPI Specification: You will need an OAS file for LinkedIn. Since LinkedIn does not provide an official one, you can:
- Generate one using an LLM based on official docs.
- Download one from the HAPI MCP Community Repository.
Setup Steps
1. Configure the MCP Server
Create or edit your LinkedIn OpenAPI (.json or .yaml) file. Add the x-hapi extension to handle LinkedIn's OAuth2 authentication:
curl -o linkedin.yaml https://docs.mcp.com.ai/apis/openapi/linkedin.yaml
x-hapi:
security:
- oauth2_authorization_code:
client_id: "YOUR_CLIENT_ID" # Replace with your LinkedIn app's Client ID
client_secret: "YOUR_CLIENT_SECRET" # Replace with your LinkedIn app's Client Secret
2. Install HAPI MCP
If you haven't already, install the HAPI MCP CLI:
curl -fsSL https://get.mcp.com.ai/hapi.sh | bash
For more options, see the HAPI CLI documentation.
3. Start the MCP Server
Launch your server by pointing to your LinkedIn configuration:
hapi serve linkedin --headless --port 3030 --url https://api.linkedin.com
4. Test the Integration
Use an MCP-aware client or testing tool to verify the endpoints:
- chatMCP: Ideal for verifying tool execution.
- VS Code: Add the server to your GitHub Copilot configuration.
Using the MCP Inspector:
hapi serve linkedin --headless --port 3030 --url https://api.linkedin.com | bunx @modelcontextprotocol/inspector
Conclusion
By following these steps, you have successfully exposed LinkedIn as an MCP server. Your AI agents can now leverage professional insights and data through the standardized Model Context Protocol.