even-more-effective/ea-forum-mcp-server
If you are the rightful owner of ea-forum-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The EA Forum MCP Server provides access to the EA Forum's content through a Model Context Protocol server, enabling efficient search and retrieval of posts and metadata.
search_posts
Search EA Forum posts using full-text search.
get_post
Get full content of a specific EA Forum post by ID.
search_by_tag
Search posts by a specific EA-related tag.
EA Forum MCP Server
An MCP (Model Context Protocol) server that provides access to the EA Forum's content.
Features
- Full-text search - Search EA Forum posts using Algolia's powerful search engine
- Post retrieval - Get complete post content including HTML and metadata
- Tag-based search - Search posts by specific EA-related tags
- Caching - Built-in TTL cache to reduce API calls
- Retry logic - Automatic retry with exponential backoff for failed requests
- Type safety - Full type hints for better development experience
Installation
- Clone the repository:
git clone https://github.com/yourusername/ea-forum-mcp-server.git
cd ea-forum-mcp-server
- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Configuration
- Copy the example environment file:
cp .env.example .env
- Edit
.env
if needed (default values should work fine)
Usage Examples
Basic Usage: AI Safety Research Summary
The EA Forum MCP Server can help you quickly gather and summarize content on specific topics. Here's an example of searching for AI Safety posts from the last month:
The server uses multiple tools to search, filter by date, and retrieve full post content to generate comprehensive summaries:
Advanced Usage 1: Creating Content Based on EA Forum Research
You can use the server to research existing content and create new posts inspired by successful formats. This example shows creating an "Animal Welfare 2024" review based on the LessWrong AI safety review format:
The result is a well-structured post with insights gathered from multiple EA Forum sources:
Advanced Usage 2: Hackathon Proposal Enhancement
The server can help strengthen project proposals by finding relevant research and evidence from the EA Forum. Here's an example of enhancing a mental health chatbot red teaming proposal:
The server finds relevant posts about AI safety evaluation, mental health interventions, and regulatory frameworks to create a comprehensive proposal:
Advanced Usage 3: Consuming the Service via HTTP
To consume the service via an HTTP connection, run the following command from the project's root directory:
python -m src.httpServer
Once the service is running, you can use any tool you prefer to create a client for the MCP. Here is an example using LangChain and LangGraph:
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
# Initialize the client to connect to the running MCP service
client = MultiServerMCPClient(
{"EA Forum MCP": {"url": "http://localhost:8010/mcp/", "transport": "streamable_http"}}
)
# Your preferred LLM service
llm = ...
# Get the tools from the MCP and create an agent that can use them
tools = await client.get_tools()
agent = create_react_agent(llm, tools)
# Invoke the agent with your question
await agent.ainvoke(
{"messages": [{"role": "user", "content": "Is there any post at the EA Forum about an MCP?"}]}
)
Usage
Running the Server
python -m src.stdioServer
Available Tools
1. search_posts
Search EA Forum posts using full-text search.
Parameters:
query
(required): Search query stringdate_range
(optional): Filter by time period ('day', 'week', 'month', 'year')limit
(optional): Number of results (default: 10, max: 100)page
(optional): Page number for pagination (0-based)curated_only
(optional): Only return curated posts (default: false)exclude_events
(optional): Exclude event posts (default: true)
Example:
{
"tool": "search_posts",
"arguments": {
"query": "AI safety research",
"date_range": "week",
"limit": 20
}
}
2. get_post
Get full content of a specific EA Forum post by ID.
Parameters:
post_id
(required): The post ID to retrieve
Example:
{
"tool": "get_post",
"arguments": {
"post_id": "o8zS7cLN5j3XviMFe"
}
}
3. search_by_tag
Search posts by a specific EA-related tag.
Parameters:
tag
(required): Tag name from predefined listlimit
(optional): Number of results (default: 30)
Available tags:
ai_safety
- AI safetycommunity
- Communityglobal_health
- Global health & developmentbiosecurity
- Biosecuritycareer_choice
- Career choicepolicy
- Policyfunding
- Funding opportunitiesmalaria
- Malariaresearch
- Researchvaccines
- Vaccines
Example:
{
"tool": "search_by_tag",
"arguments": {
"tag": "ai_safety",
"limit": 10
}
}
MCP Client Configuration
To use this server with an MCP client, add it to your client's configuration:
{
"mcpServers": {
"ea-forum": {
"command": "python",
"args": ["-m", "src.stdioServer"],
"cwd": "/path/to/ea-forum-mcp-server",
"env": {
"PYTHONPATH": "/path/to/ea-forum-mcp-server"
}
}
}
}
Note: The PYTHONPATH
environment variable is required to help Python find the src
module.
Development
Testing
The project includes two test scripts for verifying functionality:
1. Automated Test Suite (tests/test_server.py
)
Runs comprehensive tests on all server components:
# From project root
python tests/test_server.py
# Or from tests directory
cd tests
python test_server.py
This script tests:
- Search functionality with various filters
- Post content retrieval
- Tag-based searching
- Cache operations
- Error handling
2. Interactive Test Client (tests/interactive_test.py
)
Provides a menu-driven interface for manual testing:
# From project root
python tests/interactive_test.py
# Or from tests directory
cd tests
python interactive_test.py
Features:
- Interactive menu for testing each tool
- Custom query inputs
- Real-time results display
- Useful for exploring API capabilities before MCP integration
Architecture
The server is structured as follows:
src/server.py
- Main MCP server implementationsrc/clients/
- API client implementationsalgolia_client.py
- Algolia search API clientgraphql_client.py
- GraphQL API client for post content
src/models/
- Type definitionstypes.py
- TypedDict definitions for API responses
src/utils/
- Utility modulescache.py
- TTL cache implementationretry.py
- Retry decorator with exponential backoff
src/config/
- Configuration managementsettings.py
- Environment-based settings
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- EA Forum
- Max from the Even More Effective Team ❤️