Zudoku
Example apps

MCP Servers: ArXiv MCP Server

MCP (Model Context Protocol) servers are the bridge between AI assistants and real-world resources such as file systems, databases, APIs, and search engines. AI interactions are bursty, so a server that scales to zero when unused and wakes in milliseconds only costs you for the queries it answers.

This example demonstrates how to deploy the ArXiv MCP server on Unikraft Cloud.

The ArXiv MCP Server is a third-party library that provides stdio-based MCP tools for accessing arXiv research papers. This example uses FastMCP 2.0 to create a proxy MCP server that exposes these tools over streamable HTTP.

The server gives AI agents and assistants the ability to:

  • Search for papers with filters for date ranges and categories
  • Download and read paper content
  • List downloaded papers
  • Analyze papers using specialized prompts.

Running on Unikraft Cloud

To run this MCP server on Unikraft Cloud:

  1. Install the unikraft CLI. You need a BuildKit builder. The easiest way to get one is via Docker. Alternatively, you can also directly set up and use BuildKit, see the quick start.

  2. Clone the examples repository and cd into the examples/mcp-server-arxiv/ directory:

    TerminalCode
    git clone https://github.com/unikraft-cloud/examples cd examples/mcp-server-arxiv/

Make sure to log into Unikraft Cloud and pick a metro close to you. This guide uses fra (Frankfurt, 🇩🇪):

TerminalCode
unikraft login

When done, invoke the following command to deploy this app on Unikraft Cloud:

TerminalCode
unikraft build . --output <my-org>/mcp-server-arxiv:latest unikraft run --metro fra \ -m 2G \ -p 443:8080/tls+http \ --scale-to-zero policy=on,cooldown-time=1000,stateful=true \ --image <my-org>/mcp-server-arxiv:latest

The output shows your instance details:

TerminalCode
metro: fra name: mcp-server-arxiv-l7l24 uuid: 1a721bb8-4472-4149-9870-789b1df5f80a state: starting image: <my-org>/mcp-server-arxiv resources: memory: 2048MiB vcpus: 1 service: uuid: 94b10356-3df8-b2fa-cd17-60ca8193c86c name: billowing-breeze-nuusy7l2 domains: - fqdn: billowing-breeze-nuusy7l2.fra.unikraft.app networks: - uuid: e6754486-5398-bb06-420e-de23ed73da3f private-ip: 10.0.1.149 mac: 12:b0:26:13:a0:89 timestamps: created: just now

In this case, the instance name is mcp-server-arxiv-l7l24 and the service billowing-breeze-nuusy7l2. They're different for each run.

For testing, you can use the example client included in this directory. First, install uv if you haven't already, then run:

TerminalCode
export MCP_SERVER_URL=https://billowing-breeze-nuusy7l2.fra.unikraft.app/mcp uv run client.py
TerminalCode
Connecting to https://billowing-breeze-nuusy7l2.fra.unikraft.app/mcp... --- Listing Tools --- Name: search_papers Description: Search for papers on arXiv with advanced filtering and query optimization. ...

You can list information about the instance by running:

TerminalCode
unikraft instances list
TerminalCode
METRO NAME STATE IMAGE ARGS MEMORY VCPUS FQDN CREATED fra mcp-server-arxiv-l7l24 standby <my-org>/mcp-server-arxiv 2.0GiB 1 billowing-breeze-nuusy7l2.fra.unikraf… 2 minutes ago

When done, you can delete the instance with:

TerminalCode
unikraft instances delete mcp-server-arxiv-l7l24

Using volumes

You can use volumes for data persistence. For that you would first create a volume:

TerminalCode
unikraft volume create --set metro=fra --set name=mcp-server-arxiv-data --set size=500M

Then start the MCP server instance and mount that volume (while specifying the storage path):

TerminalCode
unikraft build . --output <my-org>/mcp-server-arxiv:latest unikraft run --metro fra \ -m 2G \ -p 443:8080/tls+http \ --scale-to-zero policy=on,cooldown-time=1000,stateful=true \ -v mcp-server-arxiv-data:/volume \ --image <my-org>/mcp-server-arxiv:latest \ -- "/usr/local/bin/python /src/server.py --storage-path /volume"

Available tools

The ArXiv MCP Server provides the following tools:

  • search_papers: Query arXiv papers with filters for date ranges and categories
  • download_paper: Download a paper by its arXiv ID
  • list_papers: View all downloaded papers
  • read_paper: Access the content of a downloaded paper

Learn more

Use the --help option for detailed information on using Unikraft Cloud:

TerminalCode
unikraft --help

Or visit the CLI Reference.

Last modified on