/**
* LinkedIn MCP Server - Main Entry Point
*/
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { registerAllTools } from "./tools/index.js";
const SERVER_INSTRUCTIONS = `# LinkedIn MCP Server
This server provides access to LinkedIn data through the LinkedIn Voyager API.
## Authentication Flow
1. **First**, call \`linkedin_auth\` to authenticate using your Chrome browser cookies
2. **Then**, use the returned \`session_id\` with all other tools
## Available Tools
### linkedin_auth
Authenticates by extracting LinkedIn cookies from Chrome. Returns a session_id valid for 1 hour.
### linkedin_search
Search for PEOPLE, JOBS, COMPANIES, or GROUPS with various filters.
### linkedin_get
Get detailed information about a specific PROFILE, COMPANY, JOB, or GROUP by ID.
### view_my_profile
View your own LinkedIn profile details.
## Requirements
- You must be logged into LinkedIn in your Chrome browser
- macOS may require Keychain access permission
## Example Usage
1. Call \`linkedin_auth\` → get session_id
2. Call \`linkedin_search\` with session_id to find people/jobs
3. Call \`linkedin_get\` with session_id to get full details`;
async function main(): Promise<void> {
const server = new McpServer(
{
name: "linkedin-mcp-server",
version: "2.0.0",
description: "LinkedIn integration via Voyager API - search people, jobs, companies, groups and view profiles",
},
{
instructions: SERVER_INSTRUCTIONS,
}
);
// Register all tools
registerAllTools(server);
// Handle cleanup on exit
process.on("SIGINT", () => process.exit(0));
process.on("SIGTERM", () => process.exit(0));
// Connect transport
const transport = new StdioServerTransport();
await server.connect(transport);
}
main().catch((error) => {
console.error("Fatal error:", error);
process.exit(1);
});