arXiv MCP Server
Enables searching and retrieving arXiv papers by topic, fetching abstracts by paper ID, and saving markdown content to files. Includes examples of integrating MCP tools with Google Gemini for AI-powered paper research.
README
MCP Tutorial
Overview
This repository demonstrates a small MCP (Model Context Protocol) ecosystem built around FastMCP. It contains a sample MCP server exposing tools (arXiv fetch, abstract retrieval, save-markdown) and example clients: a simple FastMCP client and a Google Gemini-integrated agent. The code is intended as a practical tutorial and reference for running and testing an MCP server locally, integrating it with LLMs (Gemini), and using the MCP Inspector for interactive exploration.
Key points:
- Server uses the
fastmcplibrary to define and expose tools. - Client examples show how to call tools programmatically and how to attach an LLM (Gemini) to MCP tools.
- Includes Docker-ready server and agent examples for containerized testing.
Quick start
-
Clone and install dependencies:
git clone https://github.com/kmkarakaya/mcp_tutorial.git; cd mcp_tutorial pip install -r requirements.txt -
Start the MCP server (local):
python 4_mcp_server.pyThe server exposes tools and listens for client connections (default behavior provided by FastMCP).
Usage and examples
-
Inspect available tools with the official MCP Inspector (requires Node.js and npm or Corepack installed):
npx @modelcontextprotocol/inspectorNote:
npxcomes with npm (or use Corepack on newer Node versions). Install Node.js from https://nodejs.org/ if you don't havenode/npmon your system. -
Run the example client to call a tool programmatically:
python 5_mcp_client.py -
Start an interactive Gemini-based agent that can call MCP tools (requires Google GenAI credentials):
python 6_mcp_gemini_agent.pyWhen using the Gemini agent, set your environment variables per
google-genaidocs (e.g.,GOOGLE_API_KEYor equivalent) before running.
Docker
Dockerfiles/examples are included. Example build/run:
docker build -t mcp_server .
docker run -p 8000:8000 mcp_server
Tools implemented in the server
fetch_arxiv_papers(topic: str, number_of_papers: int = 3)— fetches recent arXiv papers for a topic.get_arxiv_abstract(arxiv_id: str)— retrieves an arXiv paper abstract.save_md_to_file(text: str, filename: str)— saves given markdown to./reports.
Dependencies
See requirements.txt. Important packages:
- fastmcp
- google-genai (for Gemini integration)
- uvicorn (if you run the server via ASGI)
Notes
- The server file (
4_mcp_server.py) prints helpful messages when functions are called and includes amcp.run()entry point. - Use the MCP Inspector to verify tool metadata and try calls interactively.
A full video tutorial and repository walkthrough is available on the Murat Karakaya Akademi YouTube channel (live recording): https://youtube.com/live/c7yl0GS2mJQ?feature=share
Author
Murat Karakaya
Website
LinkedIn
YouTube
Acknowledgments
Based on MCP work and examples; thanks to Anthropic, OpenAI, and contributors to the MCP ecosystem.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Neon Database
MCP server for interacting with Neon Management API and databases