Skip to main content
Glama
index.ts1.22 kB
#!/usr/bin/env node import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { IgApiClient } from 'instagram-private-api'; import { authenticateClient } from './instagram/auth.js'; import { InstagramClient } from './instagram/client.js'; import { createServer } from './server.js'; async function main() { try { // Initialize Instagram API client const ig = new IgApiClient(); // Authenticate (will use saved session or perform login) console.error('Initializing Instagram MCP Server...'); await authenticateClient(ig); // Create wrapper client with rate limiting const igClient = new InstagramClient(ig); // Create MCP server with tools const server = createServer(igClient); // Connect to stdio transport const transport = new StdioServerTransport(); await server.connect(transport); console.error('Instagram MCP Server started successfully'); console.error( 'Available tools: get_account_overview, get_recent_posts, get_followers, get_following, get_post_insights, compare_follow_lists' ); } catch (error) { console.error('Failed to start Instagram MCP Server:', error); process.exit(1); } } main();

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/arjun1194/insta-mcp'

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