feat: add x_read_article tool for reading full X Article content#14
Closed
nj-io wants to merge 1 commit intonirholas:mainfrom
Closed
feat: add x_read_article tool for reading full X Article content#14nj-io wants to merge 1 commit intonirholas:mainfrom
nj-io wants to merge 1 commit intonirholas:mainfrom
Conversation
New scrapeArticle() scraper and x_read_article MCP tool that reads the full content of X Articles (long-form posts). Accepts either: - Direct article URL (x.com/user/article/ID) - Tweet URL (x.com/user/status/ID) — discovers the article link For quote tweets where the article belongs to the quoted author, falls back to clicking the article-cover-image element to navigate to the real article page. Returns: title, author, handle, cleaned text (header/footer stripped), content images (profile pics filtered out), and article URL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@nj-io is attempting to deploy a commit to the kaivocmenirehtacgmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Superseded — resubmitting as clean PRs from current codebase. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
scrapeArticle()scraper andx_read_articleMCP tool for reading the full content of X Articles (long-form posts).What it does
/article/link from the pagearticle-cover-imageand following the navigationReturn shape
{ "title": "From Hierarchy to Intelligence", "author": "jack", "handle": "jack", "text": "At Sequoia, we see that speed is the best predictor...", "images": ["https://pbs.twimg.com/media/..."], "url": "https://x.com/jack/article/2039003879841362278" }Architecture
Follows the standard scraper pattern:
scrapeArticle()insrc/scrapers/twitter/index.jssrc/scrapers/index.jsx_read_article()insrc/mcp/local-tools.jssrc/mcp/server.js(Articles section)Pairs with
This tool pairs well with
x_get_likes(PR #13) — when liked tweets contain articles, the article metadata includes atweetUrlthat can be passed directly tox_read_articleto fetch the full content.Test plan
x_read_articlewith direct article URL returns full contentx_read_articlewith tweet URL discovers and reads the articlex_read_articlewith quote-tweet URL (article from quoted author) clicks through correctly🤖 Generated with Claude Code