substack-saved-mcp
A local MCP server for managing saved Substack posts. Enables offline reading, searching, bookmarking, and unbookmarking of Substack content via CLI or MCP clients.
README
Substack Saved Posts MCP & CLI
A local, stdio-based Model Context Protocol (MCP) server and sync engine for your saved/bookmarked Substack posts.
Features
- Read & Search: Full-text search (SQLite FTS5) across saved post titles, excerpts, authors, and publications. Filter by publication, audience tier (e.g.
everyone,only_paid), and date ranges (published_atvssaved_at). Search also covers a post's full body text, but only for posts whose content has already been fetched once viaget-content/ theget_post_contenttool — a normalsyncstores metadata and excerpts, not full bodies, so posts you haven't opened yet are matched on their title/excerpt/metadata only, not their full text. - Full Content for LLMs: Fetch a saved post's full content and get it back cleaned and formatted (headings, lists, links) for feeding directly to an LLM, with the result cached locally for next time.
- Save & Unsave: Bookmark new Substack posts or unbookmark existing ones via authenticated browser sessions.
- Offline First: Fast, offline queries directly from local SQLite cache.
- Privacy & Security: Keeps session credentials local, redacting tokens from logs.
- FastMCP Protocol: Stdio MCP interface with rich tool suite and resources.
Installation with uv
uv is the recommended fast Python package manager for installing and running substack-saved-mcp.
Option A: Install System-wide as a Tool (uv tool install)
Install directly from your local repository folder:
# Navigate to the repository
cd /path/to/substack-saved-mcp
# Install system-wide into an isolated uv environment
uv tool install .
# Or install directly from a remote Git repository:
# uv tool install git+https://github.com/your-username/substack-saved-mcp.git
After installation, substack-saved-mcp is immediately available in your PATH:
# Verify installation
substack-saved-mcp --help
To update or uninstall:
# Upgrade installed tool
uv tool upgrade substack-saved-mcp
# Uninstall tool
uv tool uninstall substack-saved-mcp
Option B: Local Development / Development Environment (uv sync)
If you are developing or modifying the codebase:
# Clone and enter directory
cd substack-saved-mcp
# Install dependencies and dev tools (pytest)
uv sync --extra dev
# Run CLI commands using uv run
uv run substack-saved-mcp --help
# Run tests
uv run pytest
Quick Start
# 1. Initialize local database
substack-saved-mcp init
# 2. Authenticate with Substack (opens interactive browser window once)
substack-saved-mcp login
# 3. Sync saved posts into local cache
substack-saved-mcp sync
# 4. Search saved posts via CLI
substack-saved-mcp search "artificial intelligence"
# 4b. Filter by publication or audience tier (see which tiers are cached with `audiences`)
substack-saved-mcp audiences
substack-saved-mcp list --audience only_paid
substack-saved-mcp search "artificial intelligence" --audience everyone
# 5. Save or unsave a post
substack-saved-mcp save "https://example.substack.com/p/post-slug"
substack-saved-mcp unsave "https://example.substack.com/p/post-slug"
# 6. Get a saved post's full content, cleaned up and ready for an LLM
substack-saved-mcp get-content "https://example.substack.com/p/post-slug"
# 7. Launch stdio MCP server
substack-saved-mcp serve
Configuring MCP Clients (Claude Desktop, Goose, Cursor, etc.)
Add substack-saved-mcp to your MCP client's configuration file (e.g. claude_desktop_config.json).
Using System-Wide Installed Tool (uv tool or global binary)
{
"mcpServers": {
"substack-saved": {
"command": "substack-saved-mcp",
"args": ["serve"]
}
}
}
Using uv directly from the Repository Path
If you prefer running directly from your repository path without installing system-wide:
{
"mcpServers": {
"substack-saved": {
"command": "uv",
"args": [
"--directory",
"/path/to/substack-saved-mcp",
"run",
"substack-saved-mcp",
"serve"
]
}
}
}
Frequently Asked Questions (FAQ)
Where is the database saved?
By default, the SQLite database is saved in your OS application data directory:
- Linux / macOS:
~/.local/share/substack-saved-mcp/saved_posts.sqlite
(or$XDG_DATA_HOME/substack-saved-mcp/saved_posts.sqliteifXDG_DATA_HOMEis set)
You can specify a custom database path or directory using environment variables:
export SUBSTACK_SAVED_DB_PATH="/path/to/my/custom_database.sqlite"
# or
export SUBSTACK_SAVED_DATA_DIR="/path/to/my/data_dir"
Will a browser window pop up when running as an MCP server?
No, a visible browser window will not open during normal MCP operations.
- Read & Search Tools (
search_saved_posts,list_saved_posts,get_saved_post,list_publications,saved_posts_status):
Operate 100% offline using the local SQLite database. Zero browser activity. - Sync & Write Tools (
sync_saved_posts,save_post,unsave_post,get_post_content):
Run in headless background mode using the pre-authenticated session stored instorage_state.json. - Interactive Login:
A visible browser window opens only when you manually runsubstack-saved-mcp loginfrom your terminal. If your session expires while using an MCP client, the tool will return a clear error message instructing you to re-authenticate viasubstack-saved-mcp logininstead of popping open a browser window unexpectedly.
What if I get a Playwright "Executable doesn't exist" error?
If you encounter an error like BrowserType.launch: Executable doesn't exist when running commands (especially login), it means Playwright hasn't installed its required browsers in the isolated environment.
To fix this, you need to run the playwright install command inside the environment where the tool is installed.
For a system-wide tool installation (via uv tool install), run:
~/.local/share/uv/tools/substack-saved-mcp/bin/playwright install
If you are using a local development environment (via uv sync), run:
uv run playwright install
I edited the source code, but the installed substack-saved-mcp command still behaves like the old version. Why?
uv tool install copies the package into its own isolated environment at install time — it does not track your working tree. If you edited files under src/ (or pulled new commits) after installing the tool system-wide, the globally installed copy is stale and keeps running the old code, even though uv run substack-saved-mcp ... from the repo would use the latest source.
Reinstall from your current working tree to pick up the changes:
uv tool install . --no-cache --force
--forcereplaces the existing installed version instead of skipping the install because a version is already present.--no-cacheensures a fresh build rather than reusing a cached wheel/build artifact from before your edits.
Do this any time after modifying the codebase and before relying on the globally installed substack-saved-mcp binary (as opposed to uv run substack-saved-mcp, which always reflects the working tree).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。