Agntic AI for Research Papers
Search and extract information about research papers from arXiv.
MCP Agntic AI for Research Papers
This project implements a chatbot using the Model Context Protocol (MCP) to search and retrieve information about research papers from arXiv. The chatbot allows you to query papers by topic and extract detailed information about specific papers.
Overview
The system consists of two main components:
- Server: A FastMCP server that provides tools for searching arXiv papers and extracting paper information.
- Client: An MCP client that integrates with OpenAI's GPT model to process user queries and interact with the server.
The server stores paper information in JSON files organized by topic, while the client provides an interactive chat interface for users to input queries.
Features
- Search Papers: Search for papers on arXiv by topic, with configurable maximum results.
- Extract Paper Info: Retrieve detailed information (title, authors, summary, PDF URL, publication date) for a specific paper using its arXiv ID.
- Persistent Storage: Paper information is saved in JSON files under a
papers
directory, organized by topic. - Interactive Chatbot: Users can interact with the chatbot via a command-line interface, with support for natural language queries powered by OpenAI's GPT model.
Requirements
- Python 3.12+
- Dependencies (install via
uv
orpip
):arxiv
mcp
openai
nest-asyncio
python-dotenv
- OpenAI API key (stored in
src/keys.json
) uv
(recommended, for running the server and client)
Installation
- Clone the repository:
git clone
cd - Install dependencies using
uv
(recommended):
uv pip install -r pyproject.toml
Or withpip
:
pip install -r pyproject.toml - Create a
src/keys.json
file with your OpenAI API key:
{
"open_ai_api": "your-openai-api-key"
} - Ensure the MCP server configuration in
src/server_config.json
is set up correctly:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"."
]
},
"research": {
"command": "uv",
"args": ["run", "research_server.py"]
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
}
Usage
- Start the MCP server:
uv run src/research_server.py
This runs the server with theresearch
configuration, providing tools for paper search and extraction. - Run the client in a separate terminal:
uv run main.py
The client connects to the server, initializes the chatbot, and starts the interactive chat loop. - Interact with the chatbot:
- Enter a query like "Search for papers on quantum computing" or "Get info for paper 1234.56789".
- Type 'quit' to exit.
Project Structure
├── papers/ # Directory for storing paper information (auto-created)
├── src/
│ ├── mcp_chatbot.py # MCP client with chatbot implementation
│ ├── research_server.py # FastMCP server with arXiv search tools
│ ├── keys.json # API keys (not tracked in git)
│ ├── server_config.json # MCP server configuration
├── README.md
├── main.py # Entry point
Example Queries
- Search for papers:
Query: Find 3 papers on machine learning
Output: List of paper IDs, with details saved in papers/machine_learning/papers_info.json
.
- Extract paper information:
Query: Get info for paper 2103.12345
Output: JSON-formatted paper details (title, authors, summary, etc.) if found.
Notes
- The server creates a
papers
directory to store JSON files containing paper information, organized by topic (e.g.,papers/quantum_computing/papers_info.json
). - The client uses
gpt-4o-mini
by default. Update the model insrc/mcp_chatbot.py
if needed. - The system assumes
uv
is installed for running scripts. Modify thecommand
inserver_config.json
if using a different tool (e.g.,python
).
Future Improvements
- Add support for filtering papers by date, author, or category.
- Implement paper PDF download and storage.
- Enhance the chatbot with more natural language understanding for complex queries.
- Add a web-based UI for better user interaction.
License
This project is licensed under the MIT License. See the LICENSE
file for details.
Related Servers
arXiv MCP Server
Search and analyze academic papers on arXiv.
Geocoding
Provides geocoding services by integrating with the Nominatim API.
Amazon Product Advertising API
Integrate with the Amazon Product Advertising API to search for products and access product information.
Scryfall
Search for Magic: The Gathering cards and get details, rulings, and prices using the Scryfall API.
Rakuten Travel
Search for hotels and check their availability using the Rakuten Travel API.
MCP NIF.PT
Query and analyze Portuguese companies using the NIF.PT public API. Supports search by NIF, company name, and city.
Ferryhopper MCP Server
The Ferryhopper MCP Server exposes ferry routes, schedules and booking redirects so an AI assistant can discover connections across Europe and the Mediterranean and send users to Ferryhopper to complete bookings.
Jina AI Search
Perform semantic, image, and cross-modal searches using Jina AI's neural search capabilities.
Finviz MCP Server
Provides stock screening and fundamental analysis using Finviz data. Requires a Finviz Elite subscription.
Tavily
A comprehensive search API for real-time web search, data extraction, and crawling, requiring a Tavily API key.