Pipedream LinkedIn
This example shows how to use the LinkedIn Pipedream MCP server with Kern Agents.
Code
1"""2�� Pipedream LinkedIn MCP34This example shows how to use Pipedream MCP servers (in this case the LinkedIn one) with Kern Agents.561. Connect your Pipedream and LinkedIn accounts: https://mcp.pipedream.com/app/linkedin72. Get your Pipedream MCP server url: https://mcp.pipedream.com/app/linkedin83. Set the MCP_SERVER_URL environment variable to the MCP server url you got above94. Install dependencies: uv pip install kern-ai mcp-sdk10"""1112import asyncio13import os1415from kern.agent import Agent16from kern.models.openai import OpenAIResponses17from kern.tools.mcp import MCPTools18from kern.utils.log import log_exception1920mcp_server_url = os.getenv("MCP_SERVER_URL")212223async def run_agent(task: str) -> None:24 try:25 async with MCPTools(26 url=mcp_server_url, transport="sse", timeout_seconds=2027 ) as mcp:28 agent = Agent(29 model=OpenAIResponses(id="gpt-5.2"),30 tools=[mcp],31 markdown=True,32 )33 await agent.aprint_response(34 message=task,35 stream=True,36 )37 except Exception as e:38 log_exception(f"Unexpected error: {e}")394041if __name__ == "__main__":42 asyncio.run(43 run_agent("Check the Pipedream organization on LinkedIn and tell me about it")44 )