Open Threads MCP Server
Enables AI agents to interact with a signed-in Meta Threads account: browse feeds, search topics and users, inspect profiles and posts, publish threads and replies with media, like/repost/bookmark posts, follow profiles, and download media.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Open Threads π§΅
Your own Meta Threads account for AI agents: headless CLI, MCP server, and local API.
Open Threads is an open-source bridge that connects your signed-in Meta Threads account to autonomous AI agents (such as Claude Code, Codex, Cursor, Antigravity, and OpenCode).
By providing a headless CLI, an MCP Server, and a local REST API, it empowers AI agents to browse feeds, scrape user profiles, analyze discussion topics, check pinned posts, publish new threads, attach media, reply, like, repost, and bookmark without needing a graphical user interface.
π Key Capabilities
π Zero-Credential-Exposure Authentication: Log in once using a normal, visible browser session. Your cookies and profile are stored safely in
~/.open-threads/chrome-profileon your machine.π€ Built for AI Agents: Native Model Context Protocol (MCP) server so coding agents can invoke Threads tools directly from chat.
π Complete Profile & Pinned Post Scraping: Extract display names, handles, bios, follower counts, verified badges, avatars, profile links, and pinned threads.
π§΅ Full Thread & Reply Tree Inspection: Retrieve complete discussion threads, timestamps, view counts, like/reply/repost statistics, and nested replies.
π Topic & Community Search: Discover discussions in communities (e.g.
#study,#tech,#ai), with sorting by Top or Recent.βοΈ Publishing & Interactions:
Publish threads with text and image/video uploads.
Reply to any thread post.
React/like or unlike posts.
Repost or quote repost.
Save / bookmark posts.
Follow or unfollow profiles.
β‘ Background Daemon & Job Queue: Run
open-threads serveto maintain a persistent browser instance with sub-second command response times.
Related MCP server: threads-mcp
ποΈ Architecture
+-------------------------------------------------------------+
| AI Coding Agents |
| (Claude Code / Codex / Antigravity / Cursor) |
+-------------------------------------------------------------+
| |
MCP (stdio) CLI (--json)
| |
v v
+-------------------------------------------------------------+
| open-threads |
| - bin/cli.js (CLI entry point) |
| - src/tools.js (MCP Server: @modelcontextprotocol/sdk) |
| - src/server.js (Local REST API & Background Job Queue) |
| - src/threads.js (Playwright / Chrome Driver & Parser) |
+-------------------------------------------------------------+
|
CDP (127.0.0.1:9345)
v
+-------------------------------------------------------------+
| Google Chrome (Persistent Profile) |
| ~/.open-threads/chrome-profile/ |
+-------------------------------------------------------------+
|
v
https://threads.net/π Quick Start
1. Installation
Clone and install dependencies:
git clone https://github.com/mkshaonexe/open-threads.git
cd open-threads
npm install2. Initial Sign-in
Launch the sign-in window:
node bin/cli.js loginA visible Chrome window opens to https://www.threads.net/login. Log in using your Instagram / Threads credentials, security key, or QR code. Once signed in, Open Threads detects your authenticated state and closes the window. All future commands run headlessly.
Verify your session:
node bin/cli.js statusπ» CLI Usage
All CLI commands support the --json flag for machine-readable output.
Browsing & Feeds
# Fetch Home "For You" feed (default 10 posts)
node bin/cli.js feed --limit 10
# Fetch "Following" feed
node bin/cli.js feed --filter following --limit 15 --jsonProfile & Pinned Posts
# Fetch profile, bio, follower count, avatar, and pinned post
node bin/cli.js profile meta --json
# Fetch a user's recent threads
node bin/cli.js user-posts meta --limit 10
# Fetch a user's uploaded media
node bin/cli.js user-posts meta --tab media --limit 5Inspecting Specific Posts
# View post details, view count, author, and thread replies
node bin/cli.js post DfX2w6Tndjo --json
# You can also pass the full URL
node bin/cli.js post "https://www.threads.net/@meta/post/DfX2w6Tndjo"Communities, Topics & Search
# Explore study-related topics and communities
node bin/cli.js topic "study" --sort top --limit 10 --json
# Explore recent posts in a topic
node bin/cli.js topic "technology" --sort recent --limit 10
# Search posts by keyword
node bin/cli.js search "artificial intelligence" --type top --limit 10
# Search user accounts by name or handle
node bin/cli.js search "google" --type user --limit 10Creating Posts & Interactions
# Publish a new thread
node bin/cli.js create "Hello from Open Threads CLI! π"
# Publish with images or videos
node bin/cli.js create "Check out this visual architecture!" --media ./docs/architecture.png
# Reply to a thread post
node bin/cli.js reply DfX2w6Tndjo "This is very informative, thank you!"
# Like a post
node bin/cli.js like DfX2w6Tndjo
# Unlike a post
node bin/cli.js like DfX2w6Tndjo --unlike
# Repost a thread
node bin/cli.js repost DfX2w6Tndjo
# Quote a thread
node bin/cli.js repost DfX2w6Tndjo --quote "Fascinating update from the team!"
# Bookmark / save a post
node bin/cli.js save DfX2w6Tndjo
# Follow a user
node bin/cli.js follow metaπ€ MCP Server Setup for AI Agents
To connect Open Threads to your AI coding agents, add the server configuration:
Configuration (mcp.json / Claude Desktop / Antigravity)
{
"mcpServers": {
"open-threads": {
"command": "node",
"args": ["/absolute/path/to/open-threads/bin/cli.js", "mcp"]
}
}
}Available MCP Tools
threads_status: Check active sign-in status and account details.threads_feed: Fetch home feed (for_youorfollowing).threads_profile: Retrieve user profile, bio, follower count, avatar, and pinned post.threads_user_posts: Fetch timeline posts, replies, media, or reposts.threads_post: Retrieve post detail with metrics and thread replies.threads_create_post: Publish a thread with optional image/video files.threads_reply: Reply to an existing thread.threads_like: Like or unlike a post.threads_repost: Repost or quote a post.threads_save: Bookmark or unsave a post.threads_delete_post: Delete a user-owned post (confirm: true).threads_search: Search posts or user accounts.threads_topic: Explore community topics / hashtags.threads_follow: Follow or unfollow a profile.threads_download: Download photo/video media to local storage.
β‘ Background HTTP Server & Daemon
To keep a single browser session warm for instant responses, start the local server:
node bin/cli.js serve --port 2795When running, the server listens strictly on http://127.0.0.1:2795 and secures all calls with a local bearer token.
Print your local API key:
node bin/cli.js keyπ Repository Structure
open-threads/
βββ bin/
β βββ cli.js # CLI executable and MCP stdio launcher
βββ src/
β βββ chrome.js # Chrome lifecycle and CDP lock manager
β βββ client.js # Client for local HTTP daemon
β βββ config.js # Configuration and path resolution
β βββ errors.js # Standardized error definitions
β βββ schema.js # Zod validation schemas and method dictionary
β βββ server.js # Local loopback HTTP REST server and job queue
β βββ threads.js # Playwright automation driver and parser
β βββ tools.js # Model Context Protocol (MCP) server
βββ skills/
β βββ open-threads/
β βββ SKILL.md # Agent Skill specification
βββ test/
β βββ config.test.js # Config unit tests
β βββ mcp.test.js # MCP tools unit tests
β βββ schema.test.js # Schema and validation unit tests
βββ AGENTS.md # AI Agent guidance rules
βββ LICENSE # MIT License
βββ package.json
βββ README.md # Complete documentationπ‘οΈ Ethical Usage & Security Disclosure
Open Threads is designed for personal productivity, agent-assisted automation, ethical testing, and research under user authorization. It operates on your own authenticated web session without attempting to bypass platform protections or access control mechanisms.
Always adhere to Meta's Terms of Service and community standards.
Respect rate limits and avoid spammy or high-frequency automated behavior.
Never store or commit private credentials, browser profiles, or cookies to public repositories.
π License
MIT Β© 2026 mkshaonexe
This server cannot be deployed
Maintenance
Related MCP Connectors
Publish, reply, moderate, search and read insights on your Threads (threads.com) account.
Threads public posts, replies and profiles, with view counts, keyword and account search.
Threads scheduler for AI agents: write, schedule and publish posts, review replies, read insights.
Publish and schedule Threads posts from your AI assistant.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Instagram and Threads accounts β publish content, handle comments, view insights, search hashtags, and manage DMs through the Meta Graph API.5964 npm13MIT
- AlicenseBqualityBmaintenanceEnables posting and managing Threads content via Meta Threads API, including text, image, video, carousel, and replies.951 npmMIT
- FlicenseAqualityCmaintenanceEnables AI agents to interact with Meta Threads by fetching profile details, recent posts, post and account analytics, and conversation reply trees, as well as exporting posts as JSON for archiving or embedding.7-
- AlicenseAqualityBmaintenanceEnables AI agents to manage a Threads profile through Meta's API, including posting, threads, replies, reply moderation, and insights.3025 npm2MIT