MCP Blog Search Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Blog Search Server
A Model Context Protocol (MCP) server that allows AI assistants like Claude to search through your blog posts using SerpApi and retrieve content via llms.txt indexing. Built with Python and designed for seamless integration with Claude Desktop.
Features
๐ Smart blog search using SerpApi for reliable, Google-powered search results
๐ Full content retrieval via llms.txt indexing and GitHub raw content
โก Fast and lightweight with minimal dependencies
๐ง Simple configuration with just a few required settings
๐งช Comprehensive testing with unit, integration, and fixture-based tests
๐ค Claude Desktop ready with easy MCP configuration
Related MCP server: Blog RSS MCP Server
Architecture
Our server uses a modern, reliable architecture:
SerpApi for site-specific blog post search (no complex GitHub API setup)
llms.txt standard for AI-optimized content indexing
GitHub raw content for fast markdown retrieval
FastMCP framework for clean tool definitions
Quick Start
Clone and setup:
git clone https://github.com/jtemporal/blog-search-mcp-in-python.git cd blog-search-mcp-in-python uv syncConfigure your blog:
cp .config.example .config # Edit .config with your blog URL and SerpApi keyTest the setup:
uv run pytest tests/test_config.py -vInspect the server with MCP Inspector:
npx @modelcontextprotocol/inspector uv run src/server.py
Configuration
Copy .config.example to .config and update with your blog details:
[MCP_SERVER]
blog_base_url = https://yourblog.com
serpapi_key = your-serpapi-key-here
server_name = Blog Search Server
log_level = INFOGetting a SerpApi Key
Sign up for free at SerpApi
Get your API key from the dashboard
Add it to your
.configfile
Note: SerpApi provides 100 free searches per month, which is usually sufficient for personal blog searching.
Testing
Unit Tests (Fast, Mock Data)
# Run all unit tests (default)
uv run pytest
# Verbose output
uv run pytest -v
# Run specific test file
uv run pytest tests/test_server.py -vIntegration Tests (Real API Calls)
# Run integration tests (requires SerpApi key)
uv run pytest tests/test_integration.py -v -m integration
# Or run manually for detailed output
uv run python tests/test_integration.pyTest Structure
Unit tests: Fast tests with mocked SerpApi responses and fixtures
Integration tests: Real API calls to SerpApi and GitHub (requires valid API key)
Fixtures: Test data stored in
tests/fixtures/for better maintainability
Test Markers
pytest- Runs unit tests only (default, integration tests excluded)pytest -m integration- Runs integration tests onlypytest -m ""- Runs all tests (unit + integration)
Development
Project Structure
mcp-with-python-blog/
โโโ src/
โ โโโ server.py # Main MCP server with tools
โ โโโ config.py # Configuration management
โโโ tests/
โ โโโ fixtures/ # Test data in JSON files
โ โโโ conftest.py # Pytest fixtures (loads from fixtures/)
โ โโโ test_server.py # Unit tests with mocked responses
โ โโโ test_config.py # Configuration loading tests
โ โโโ test_integration.py # Integration tests (real API calls)
โโโ blog-post/ # Blog post about this project
โโโ .config # Your blog configuration
โโโ .config.example # Configuration template
โโโ pyproject.toml # Project configuration and dependencies
โโโ uv.lock # Dependency lock fileRunning the MCP Server
# Run locally for testing
uv run mcp src/server.pyAvailable Tools
The MCP server provides two main tools:
search_posts(query: str)- Search through blog posts using SerpApiPerforms site-specific Google search
Returns titles, URLs, and excerpts
Example: "Search for posts about Python"
get_post_content(title: str)- Get full content of a specific postUses llms.txt index to find posts
Fetches raw markdown from GitHub
Supports partial title matching
Example: "Get content for 'Python Tips'"
Claude Desktop Setup
To use this MCP server with Claude Desktop:
Run the install command:
uv run mcp install "src/server.py" --with google-search-resultsThis will create the server configuration within Claude automatically.
Restart Claude Desktop completely
Test the integration:
Start a new conversation
Ask: "Search my blog for posts about Python"
Claude should offer to use the
search_poststool
Cursor Desktop Setup
To use this MCP server with Cursor Desktop:
Locate your Cursor MCP config file:
macOS:
~/.cursor/mcp.jsonWindows:
%APPDATA%\Cursor\mcp.jsonLinux:
~/.config/Cursor/mcp.json
Add the MCP server configuration:
{ "mcpServers": { "blog-search": { "command": "/path/to/uv", "args": [ "run", "--python", "3.12.11", "--with", "mcp[cli]", "--with", "google-search-results", "--with", "python-dotenv", "mcp", "run", "/absolute/path/to/your/project/src/server.py" ], "cwd": "/absolute/path/to/your/project" } } }Update the paths:
Replace
/path/to/uvwith your uv executable path (find withwhich uv)Replace
/absolute/path/to/your/projectwith your project directory
Restart Cursor completely and test the integration
Usage Examples
Once configured with Claude Desktop, you can:
Search for Posts
"Search my blog for posts about Python"
"Find articles related to web development"
"Look for tutorials on data science"
Get Full Content
"Get the content of the Python tips post"
"Show me the full article about Django"
"Retrieve the content for 'Introduction to Data Science'"
Workflow Integration
"Search for my post about JWT handling, then summarize the key points"
"Find my Django tutorial and explain the main concepts"
"Look up my Python posts and create a learning roadmap"
Requirements
For Your Blog
Your blog needs to provide an llms.txt file at https://yourblog.com/llms.txt that follows this format:
# LLM Feed for yourblog.com
This file contains links to blog posts in markdown format for easy LLM consumption.
- [Post Title 1](https://raw.githubusercontent.com/username/repo/main/_posts/post1.md)
- [Post Title 2](https://raw.githubusercontent.com/username/repo/main/_posts/post2.md)
...This file serves as an index that links to the raw markdown content of your posts on GitHub.
If you don't have a blog or llms.txt file feel free to use mine: https://jtemporal.com.
Dependencies
Python 3.12+
SerpApiaccount (free tier available, sign up here)Blog with llms.txt index (or you can use mine if you prefer:
https://jtemporal.com)uvpackage manager
Contributing
Setup development environment:
git clone https://github.com/jtemporal/mcp-with-python-blog.git cd mcp-with-python-blog uv syncRun tests:
uv run pytest -vAdd tests for new features in appropriate test files
Update fixtures in
tests/fixtures/when adding new test dataFollow the existing code style and add proper docstrings
Adding New Fixtures
Test data is stored in tests/fixtures/ as JSON files:
blog_posts.json- Sample blog post dataconfig.json- Test configurationserpapi_*.json- Mock SerpApi responses
To add new test data, create a JSON file and load it in conftest.py using the load_fixture() function.
Troubleshooting
Common Issues
SerpApi key not working: Verify your key at SerpApi dashboard
No search results: Check that your blog URL is correct and publicly accessible
llms.txt not found: Ensure your blog serves the llms.txt file at the root
Claude Desktop not recognizing server: Check file paths and restart Claude completely
Debug Mode
Run the server manually to see detailed logs:
uv run python src/server.pyRun integration tests to verify API connectivity:
uv run python tests/test_integration.pyLicense
MIT License - see LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Run your company blog for SEO and AI search from your AI assistant.
Search indexed websites, read raw page markdown, and score AI visibility for any site.
AI agents that research, write and publish SEO articles on your website, from your AI assistant.
Search the web, fetch any URL and map a site as clean, LLM-ready Markdown.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides semantic search and access to Contraption Company blog posts and essays. Uses AI-powered embeddings to find relevant content and supports real-time updates via webhooks.31MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with blog RSS/Atom feeds to list posts, fetch content, get recent posts, retrieve blog metadata, and perform full-text search across post content. Supports any blog with an RSS/Atom feed through natural language queries.-
- AlicenseNot gradedqualityDmaintenanceIndexes and searches Jekyll blog content, enabling AI assistants to search posts by keyword/category/tags, retrieve full post content, compare drafts against published posts, and analyze blog categories and tags.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI to search, retrieve, list notes, and get backlinks from a published Markdown vault (Obsidian) via GitHub Pages.MIT