vm799/REG_MCP_SERVER
If you are the rightful owner of REG_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 dayong@mcphub.com.
An intelligent MCP server that connects Claude AI with arXiv research papers, enabling search, analysis, and discussion of academic papers with AI assistance.
REG_MCP_SERVER 🤖📚
An intelligent MCP (Model Context Protocol) server that connects Claude AI with arXiv research papers. Search, analyze, and chat about academic papers with AI assistance.
🚨 Quick Fix for Access Token Error
Getting an "access token" error? This happens because the Anthropic API key is missing.
2-Minute Solution:
-
Get API Key 🔑
- Visit console.anthropic.com
- Sign up/login → API Keys → Create new key
- Copy your key (starts with
sk-ant-api03-...)
-
Configure API Key ⚙️
# Edit the .env file nano .env # Replace the placeholder with your key: ANTHROPIC_API_KEY=sk-ant-api03-your-actual-key-here -
Test & Run 🚀
python test_setup.py # Verify everything works python mcp_chatbot.py # Start chatting!
✨ Features
- 🔍 Smart Paper Search - Find relevant research papers on arXiv by topic
- 📄 Paper Analysis - Extract detailed information (authors, summary, citations)
- 💬 AI-Powered Chat - Discuss papers with Claude AI
- 💾 Auto Storage - Automatically saves paper metadata locally
- 🏗️ MCP Architecture - Built on Model Context Protocol for seamless AI integration
📦 Installation & Setup
Prerequisites
- Python 3.12+
- uv package manager (recommended)
- Anthropic API key
Step 1: Clone & Install
# Clone the repository
git clone https://github.com/vm799/REG_MCP_SERVER.git
cd REG_MCP_SERVER
# Install dependencies with uv (recommended)
uv sync
# OR install with pip
pip install anthropic arxiv mcp nest-asyncio python-dotenv
Step 2: Configure API Key
# Copy environment template
cp .env.example .env
# Edit with your API key
nano .env
Add your Anthropic API key:
ANTHROPIC_API_KEY=sk-ant-api03-your-actual-key-here
Step 3: Test Setup
# Verify everything is configured correctly
python test_setup.py
You should see:
🧪 Testing REG_MCP_SERVER setup...
==================================================
✅ All required modules imported successfully
✅ Papers directory accessible
✅ Research server module imported successfully
✅ MCP tools (search_papers, extract_info) are available
✅ Environment file configured correctly
==================================================
🎉 All tests passed! Your MCP server is ready to use.
🚀 Usage
Start the Interactive Chatbot
python mcp_chatbot.py
Example Conversations
Search for Papers:
Query: Find papers about machine learning in healthcare
🔍 Calling tool search_papers with args {'topic': 'machine learning healthcare', 'max_results': 5}
Found 5 papers on machine learning in healthcare...
Get Paper Details:
Query: Tell me more about paper 2301.00001
📄 Here's detailed information about the paper including authors, summary, and key findings...
Ask Research Questions:
Query: What are the main challenges in applying ML to medical diagnosis?
💬 Based on the papers I found, here are the key challenges...
🏗️ Architecture
REG_MCP_SERVER/
├── mcp_chatbot.py # Main chatbot interface
├── research_server.py # MCP server with research tools
├── main.py # Entry point
├── test_setup.py # Setup verification
├── papers/ # Local paper storage
├── .env # API key configuration
└── README.md # This file
Core Components
-
MCP Chatbot (
mcp_chatbot.py)- Handles user interactions
- Manages conversation flow with Claude
- Processes tool calls and responses
-
Research Server (
research_server.py)- Provides MCP tools for paper search and extraction
- Interfaces with arXiv API
- Manages local paper storage
-
Tools Available:
search_papers(topic, max_results)- Search arXiv by topicextract_info(paper_id)- Get detailed paper information
🛠️ Advanced Configuration
Custom Paper Storage
# Modify PAPER_DIR in research_server.py
PAPER_DIR = "custom_papers_directory"
Search Parameters
# Customize search behavior
search = arxiv.Search(
query=topic,
max_results=max_results,
sort_by=arxiv.SortCriterion.Relevance, # or SubmittedDate, LastUpdatedDate
sort_order=arxiv.SortOrder.Descending
)
Claude Model Configuration
# Modify model in mcp_chatbot.py
model='claude-3-7-sonnet-20250219' # Current model
# model='claude-3-haiku-20240307' # Faster, cheaper
# model='claude-3-opus-20240229' # Most capable
🔧 Troubleshooting
Common Issues
❌ "anthropic.AuthenticationError"
- Cause: Missing or invalid API key
- Fix: Check your
.envfile has the correctANTHROPIC_API_KEY
❌ "ImportError: No module named 'anthropic'"
- Cause: Dependencies not installed
- Fix: Run
uv syncorpip install -r requirements.txt
❌ "Permission denied writing to papers/"
- Cause: Insufficient write permissions
- Fix:
chmod 755 papers/or run with appropriate permissions
❌ "Connection timeout to arXiv"
- Cause: Network connectivity issues
- Fix: Check internet connection, try again later
Debug Mode
# Run with verbose output
python -v mcp_chatbot.py
# Check server logs
python research_server.py
Reset Paper Storage
# Clear all cached papers
rm -rf papers/
mkdir papers/
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
# Install development dependencies
uv add --dev pytest black flake8 mypy
# Run tests
python -m pytest
# Format code
black *.py
# Check typing
mypy *.py
📚 API Reference
MCP Tools
search_papers(topic: str, max_results: int = 5) -> List[str]
Search for papers on arXiv based on a topic.
Parameters:
topic: The research topic to search formax_results: Maximum number of papers to return (default: 5)
Returns:
- List of paper IDs found in the search
Example:
paper_ids = search_papers("neural networks", max_results=3)
# Returns: ['2301.00001', '2301.00002', '2301.00003']
extract_info(paper_id: str) -> str
Get detailed information about a specific paper.
Parameters:
paper_id: The arXiv paper ID (e.g., "2301.00001")
Returns:
- JSON string with paper information or error message
Example:
info = extract_info("2301.00001")
# Returns detailed paper metadata as JSON
🔗 Useful Links
- Anthropic Console - Get API keys
- arXiv API Documentation - arXiv search details
- MCP Documentation - Model Context Protocol
- Claude API Docs - Anthropic API reference
📝 License
This project is licensed under the MIT License - see the file for details.
⭐ Support
If this project helped you, please give it a star! ⭐
Questions? Open an issue or start a discussion.
Made with ❤️ for researchers and AI enthusiasts