Content
# Tool List
A WeChat public article search tool based on Model Context Protocol (MCP), helping AI assistants quickly search and retrieve WeChat public article content.
> 🚀 **New User?** Check out [Claude Code User Guide.md](./Claude-Code-User-Guide.md) to get started quickly!
## 📚 Documentation Navigation
- **Getting Started**: [Quick Start.md](./Quick-Start.md) - Configuration and basic usage
- **Test Report**: [Test Report.md](./Test-Report.md) - Functional test results
- **Changelog**: [Changelog.md](./Changelog.md) - Version history and improvements
- **Full Documentation**: Continue reading this document
## ✨ Features
- 🔍 **Intelligent Search**: Supports keyword or natural language search for WeChat public articles
- 📄 **Complete Content**: Automatically crawls the full text of articles for LLM analysis
- ⚡ **Efficient Concurrency**: Asynchronous concurrent crawling of multiple articles, fast speed
- 🔗 **Real Link**: Automatically resolves Sogou jump links to obtain the real URL of the article
- 🤖 **AI Friendly**: Returns structured Markdown for intelligent summarization by the called LLM
- 🎯 **Clear Responsibilities**: MCP focuses on data acquisition, LLM focuses on content understanding
## 📋 System Requirements
- Python 3.8+
- macOS / Windows / Linux
- AI client supporting MCP (Claude Desktop, Continue, etc.)
## 🚀 Quick Start
### 1. Install Dependencies
```bash
# Clone the project
cd wechat-mcp-summarizer
# Create a virtual environment
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
```
### 2. Configure MCP Client
#### Claude Desktop
Edit the configuration file:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
Add the following configuration:
```json
{
"mcpServers": {
"wechat-search": {
"command": "python",
"args": ["/path/to/wechat-mcp-summarizer/mcp_server.py"]
}
}
}
```
#### Continue (VS Code)
Edit `~/.continue/config.json`:
```json
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "python",
"args": ["/path/to/wechat-mcp-summarizer/mcp_server.py"]
}
}
]
}
}
```
#### Claude Code (CLI) - Recommended Method
Use Claude Code's built-in MCP management command:
##### User-level Configuration (Recommended)
```bash
claude mcp add -s user wechat-search \
"/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP/.venv/bin/python" \
"/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP/mcp_server.py"
```
**Verify Configuration**:
```bash
claude mcp list
# Should see: wechat-search: /path/to/python /path/to/mcp_server.py
```
**Note**:
- User-level configuration takes effect in all projects
- Use the Python virtual environment to ensure dependencies are installed
- Must use absolute paths
##### Project-level Configuration
If you want to use it in a specific project, in the project directory:
```bash
cd ~/my-project
claude mcp add -s project wechat-search \
"/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP/.venv/bin/python" \
"/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP/mcp_server.py"
```
##### Other Useful Commands
```bash
# List all MCP servers
claude mcp list
# View details of a specific server
claude mcp get wechat-search
# Remove an MCP server
claude mcp remove -s user wechat-search
```
### 3. Start Claude Code
Open a terminal in any directory:
```bash
# Start Claude Code directly
claude
# Or specify the working directory
claude /path/to/your/project
```
When Claude Code starts, it will automatically load the MCP configuration, and you will see:
```
✓ Connected to MCP server wechat-search
```
### 4. Verify MCP is Loaded
Enter in Claude Code:
```
> List available tools
```
Or directly test:
```
> Search for WeChat articles about AI
```
If MCP is working normally, Claude will automatically call the `search_wechat_articles` tool.
## 💡 Usage Examples
### Using in Claude Code
#### Step 1: Start Claude Code
```bash
# Start in terminal
claude
# Or start in a specific directory
cd ~/my-project
claude
```
#### Step 2: Natural Language Call
Claude Code will automatically identify when to call the MCP tool, and you only need to describe your needs in natural language:
##### Example 1: Basic Search
```
> Search for WeChat articles about artificial intelligence
```
Claude will:
1. Automatically call `search_wechat_articles("artificial intelligence", count=3)`
2. Get the full content of 3 articles
3. Analyze and return a summary
##### Example 2: Specify the Number of Articles
```
> Search for WeChat articles about "large model applications" and get 5 articles
```
Claude will search for 5 articles and analyze them.
##### Example 3: With Analysis Angle
```
> Search for WeChat articles about blockchain technology and analyze from a regulatory perspective
```
Claude will get the articles and then analyze them from a regulatory perspective.
##### Example 4: Multi-turn Dialogue
```
> Search for WeChat articles about Claude MCP
[Claude returns search results and analysis]
> What are the main application scenarios discussed in these articles?
[Claude deeply analyzes based on the obtained content]
> What is the public account of the second article?
[Claude directly extracts information]
```
#### Step 3: View Results
Claude will return content like this:
```markdown
Based on the 3 WeChat articles searched, I summarize as follows:
## Main Points
1. [Summary point 1]
2. [Summary point 2]
...
## Article Sources
1. **Title**: XXX
- Public Account: XXX
- Link: https://mp.weixin.qq.com/...
2. **Title**: YYY
- Public Account: YYY
- Link: https://mp.weixin.qq.com/...
```
You can:
- Click the link to view the original text
- Continue to ask for details
- Request analysis from different perspectives
### Using in Claude Desktop
```
User: Help me search for WeChat articles about AI applications in medical care and summarize them
```
**Workflow**:
1. Claude calls the MCP tool: `search_wechat_articles("AI medical care", count=3)`
2. MCP returns the full content of 3 articles
3. Claude automatically analyzes and generates a comprehensive summary
4. The user can ask for details or view the original link
### Specify the Number of Articles
```
User: Search for 5 WeChat articles about "blockchain technology" and analyze them from a regulatory perspective
```
MCP will get 5 articles, and Claude will analyze them from a regulatory perspective.
### Multi-turn Dialogue
```
User: Search for articles about large model applications
Claude: [Returns search results and summary]
User: What specific application cases are mentioned in these articles?
Claude: [Deeply analyzes based on the obtained content, no need to search again]
User: What is the author's view of the second article?
Claude: [Directly extracts information from the existing content]
```
## 🛠️ Tool Description
### `search_wechat_articles`
Search for WeChat public articles and return the full content.
**Parameters**:
- `query` (required): Search keyword or natural language description
- `count` (optional): Number of articles to obtain, default 3, range 1-10
**Return Format**:
```markdown
# WeChat Article Search Results
**Search Keyword**: Artificial Intelligence Medical Care
**Number of Articles Found**: 3
---
## Article 1: AI Empowers Medical Care: From Image Diagnosis to Precise Treatment
**Public Account**: Health Technology Frontier
**Link**: https://mp.weixin.qq.com/s/xxxxx
### Full Text
[Full article text...]
---
## Article 2: ...
```
## ⚙️ Configuration Description
Edit `config.py` to customize configurations:
```python
# Default number of articles to obtain
DEFAULT_ARTICLE_COUNT = 3
# Maximum number of articles to obtain
MAX_ARTICLE_COUNT = 10
# Maximum characters per article (avoid exceeding the LLM context window)
MAX_ARTICLE_LENGTH = 10000
# Maximum number of concurrent crawls
MAX_CONCURRENT_FETCHES = 3
# Request timeout (seconds)
REQUEST_TIMEOUT = 30
```
## 📁 Project Structure
```
wechat-mcp-summarizer/
├── mcp_server.py # MCP server main program
├── modules/
│ ├── __init__.py
│ ├── weixin_search.py # WeChat search module
│ └── article_processor.py # Article crawl and parsing module
├── config.py # Configuration file
├── requirements.txt # Dependency list
└── README.md # This document
```
## 🔧 Troubleshooting
### MCP Tool Not Displayed
#### Check Configuration File
1. **Verify configuration file location**
Project-level configuration:
```bash
# Check if CLAUDE.md exists in the current directory
ls -la CLAUDE.md
```
Global configuration:
```bash
# Check the global configuration file
cat ~/.config/claude/settings.json
```
2. **Verify if the path is correct**
```bash
# Test Python path
/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP/.venv/bin/python --version
# Test script path
ls -la "/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP/mcp_server.py"
```
3. **Check if dependencies are installed**
```bash
cd "/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP"
.venv/bin/pip list | grep -E "mcp|httpx|lxml"
```
Should see:
```
httpx 0.28.1
lxml 6.0.2
mcp 1.20.0
```
#### View Claude Code Logs
Observe the output when starting Claude Code:
```bash
claude
# Normal situation should see:
# ✓ Connected to MCP server wechat-search
```
If an error message is displayed, repair according to the prompt.
#### Manually Test MCP Service
```bash
cd "/Users/rick/Documents/AI产品开发/微信文章搜索摘要MCP"
.venv/bin/python mcp_server.py
```
If there is an error, it will be displayed immediately. Press Ctrl+C to exit.
### No Search Results
- Try changing keywords
- Check network connection
- May be blocked by Sogou anti-crawling, try again later
### Article Content Crawling Failed
✅ **v1.1 update**: Improved URL extraction algorithm, article content crawling success rate significantly improved!
Referenced the implementation method of [fancyboi999/weixin_search_mcp](https://github.com/fancyboi999/weixin_search_mcp) project:
- Extract URL fragments from JavaScript code and concatenate
- Enhance HTTP request headers to simulate real browser
- Pass Referer link tracking
If crawling still fails:
- May be temporarily blocked by anti-crawling, try again later
- MCP will still return article title, public account, summary, and link
- Users can access the original text through the link
### Article Content Incomplete
- Adjust `MAX_ARTICLE_LENGTH` configuration
- Some articles may contain special formats, and the parser will try to extract
### Request Timeout
- Increase `REQUEST_TIMEOUT` value
- Reduce `count` parameter, search in batches
- Check network status
## 🎯 Usage Scenarios
### Content Research
Quickly research the discussion of specific topics in the WeChat ecosystem and obtain multi-dimensional perspectives.
### Public Opinion Monitoring
Track industry keywords and understand the latest dynamics and public reactions.
### Comparative Analysis
Obtain multiple articles and let LLM perform comparative analysis, fact-checking, and in-depth analysis.
### Knowledge Organization
Collect high-quality articles in a certain field and organize them into structured notes by LLM.
## ⚠️ Precautions
### Usage Restrictions
- This tool is only for personal learning and research use
- Please do not use for commercial purposes or large-scale crawling
- Comply with Sogou and WeChat's service terms
### Copyright Statement
- All article content copyright belongs to the original author
- This tool only provides search and display functions
- Please access the full content through the original link
### Technical Risks
- Sogou may update the page structure, causing parsing failure
- Frequent requests may lead to IP blocking
- It is recommended to control the search frequency reasonably
## 🗺️ Development Route
### v1.0 (Current)
- ✅ Basic search function
- ✅ Article content crawling
- ✅ Real link parsing
- ✅ Concurrent processing optimization
### v1.1 (Planned)
- 🔲 Result caching mechanism
- 🔲 Automatic retry on request failure
- 🔲 Proxy IP support
### v2.0 (Future)
- 🔲 Time range filtering
- 🔲 Article quality scoring
- 🔲 Multi-source search for Zhihu, Weibo, etc.
## 🤝 Contribution
Welcome to submit issues and pull requests!
## 📄 License
MIT License
## 🙏 Acknowledgment
This project references the following open-source projects:
- [fancyboi999/weixin_search_mcp](https://github.com/fancyboi999/weixin_search_mcp) - WeChat search parsing implementation
- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP protocol official documentation
## 📞 Support
If you have questions or suggestions, please submit an [issue](https://github.com/yourusername/wechat-mcp-summarizer/issues).
---
**Warm reminder**: This tool hands over the article content to the called LLM for analysis, so the quality of the summary depends on the AI model you use. It is recommended to use Claude 3.5 Sonnet or higher for the best experience.
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
Agent-Reach
Give your AI agent eyes to see the entire internet. Read & search Twitter,...
context7-mcp
Context7 MCP Server provides natural language access to documentation for...
Context 7
Context7 MCP provides up-to-date code documentation for any prompt.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.