A Model Context Protocol (MCP) server for scraping and analyzing Substack newsletters. Enables LLMs to fetch posts from any public Substack publication.
- Get Posts: Fetch recent or top posts from any Substack
- Get Post Content: Retrieve full text of individual posts
- Search Posts: Search within a newsletter
- Batch Fetch: Scrape multiple newsletters at once
- Newsletter Info: Get author and recommendation data
pip install -r requirements.txtOr manually:
pip install mcp substack-api pydantic httpxpython server.pyFor Claude Desktop or similar MCP clients, add to your config:
{
"mcpServers": {
"substack": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
}Fetch posts from a newsletter.
{
"publication_url": "lenny", # or "https://lenny.substack.com"
"limit": 20,
"sorting": "top", # or "new"
"response_format": "markdown" # or "json"
}Get full content of a specific post (free posts only).
{
"post_url": "https://example.substack.com/p/post-slug",
"response_format": "markdown"
}Search posts within a newsletter.
{
"publication_url": "stratechery",
"query": "AI",
"limit": 10
}Fetch from multiple newsletters at once.
{
"publication_urls": ["lenny", "stratechery", "platformer"],
"posts_per_publication": 5,
"sorting": "top"
}Get newsletter metadata and recommendations.
{
"publication_url": "lenny"
}- Paywalled content: Cannot access subscriber-only posts without authentication
- Rate limiting: Substack may rate-limit requests; includes 0.5s delays for batch operations
- Unofficial API: Uses reverse-engineered API that may change
- Network restrictions: Some environments (corporate proxies, certain cloud platforms) may block Substack API requests
Built on substack-api Python library.