JP

jonathan-politzki/mcp-writer-substack

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

34 stars 4 forks 质量 53 趋势 0

建模上下文协议(Model Context Protocol)用来将Substack写入桥接到Claude。

概览

开源模型上下文协议(MCP)实现,将Claude连接到您的Substack和Medium编写。 Writer Context Tool是一个MCP服务器,允许Claude访问和分析你来自Substack和Medium等平台的写作。借助该工具,Claude可以理解你已发布内容的背景,为你的写作提供更个性化的帮助。 - 🔍 从Substack和Medium检索并永久缓存你的博客文章 - 🔎 使用嵌入技术根据你的查询找到最相关的论文 - 📚 将单个论文作为Claude的独立资源提供 - 🧠 在你的写作中进行语义搜索 - ⚡ 启动时预加载所有内容并生成嵌入 该工具通过 Substack/Medium 的 RSS 订阅连接博客,获取你的文章,并将其永久缓存到本地。它还为每篇文章生成嵌入,支持语义搜索,根据你的查询找到最相关的论文。

概述(AI 翻译)

开源模型上下文协议(MCP)实现,将Claude连接到您的Substack和Medium编写。

这是什么?

Writer Context Tool是一个MCP服务器,允许Claude访问和分析你来自Substack和Medium等平台的写作。借助该工具,Claude可以理解你已发布内容的背景,为你的写作提供更个性化的帮助。

特色

  • 🔍 从Substack和Medium检索并永久缓存您的博客文章
  • 🔎 利用嵌入根据你的查询找到最相关的论文
  • 📚 将单独的论文作为Claude的独立资源提供
  • 🧠 在你的写作中进行语义搜索
  • ⚡ 启动时预加载所有内容并生成嵌入

工作原理

该工具通过 Substack/Medium 的 RSS 订阅连接博客,获取你的文章,并将其永久缓存到本地。它还为每篇文章生成嵌入,支持语义搜索,根据你的查询找到最相关的论文。

当你询问克劳德关于你的写作时,它会利用这些个人论文资源提供见解,或帮助你基于现有内容发展新想法。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Writer Context Tool for Claude

Open-Sourced Model Context Protocol (MCP) implementation that connects Claude to your Substack and Medium writing.

What is this?

Writer Context Tool is an MCP server that allows Claude to access and analyze your writing from platforms like Substack and Medium. With this tool, Claude can understand the context of your published content, providing more personalized assistance with your writing.

Features

  • 🔍 Retrieves and permanently caches your blog posts from Substack and Medium
  • 🔎 Uses embeddings to find the most relevant essays based on your queries
  • 📚 Makes individual essays available as separate resources for Claude
  • 🧠 Performs semantic searches across your writing
  • ⚡ Preloads all content and generates embeddings at startup

How It Works

The tool connects to your Substack/Medium blogs via their RSS feeds, fetches your posts, and permanently caches them locally. It also generates embeddings for each post, enabling semantic search to find the most relevant essays based on your queries.

When you ask Claude about your writing, it can use these individual essay resources to provide insights or help you develop new ideas based on your existing content.

Setup Instructions (Step by Step)

Prerequisites

  • Python 3.10 or higher
  • Claude Desktop (latest version)
  • A Substack or Medium account with published content

1. Clone this Repository

git clone https://github.com/yourusername/writer-context-tool.git
cd writer-context-tool

2. Set up Python Environment

Using uv (recommended):

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt

Or using standard pip:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

3. Configure Your Blogs

  1. Copy the example configuration file:

    cp config.example.json config.json
    
  2. Edit config.json with your Substack/Medium URLs:

    {
      "platforms": [
        {
          "type": "substack",
          "url": "https://yourusername.substack.com",
          "name": "My Substack Blog"
        },
        {
          "type": "medium",
          "url": "https://medium.com/@yourusername",
          "name": "My Medium Blog"
        }
      ],
      "max_posts": 100,
      "cache_duration_minutes": 10080,
      "similar_posts_count": 10
    }
    
    • max_posts: Maximum number of posts to fetch from each platform (default: 100)
    • cache_duration_minutes: How long to cache content before refreshing (default: 1 week or 10080 minutes)
    • similar_posts_count: Number of most relevant posts to return when searching (default: 10)
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

# Get the absolute path to your uv command UV_PATH=$(which uv) # Create the configuration cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << EOF { "mcpServers": { "writer-tool": { "command": "${UV_PATH}", "args": [ "--directory", "$(pwd)", "run", "writer_tool.py" ] } } } EOF