Skip to main content

MCP Server for Jina AI APIs

Project description

Jina AI MCP Server

PyPI version

This project provides a Model Context Protocol (MCP) server that exposes the Jina AI Search Foundation APIs as a suite of tools for Large Language Models (LLMs). It allows AI agents and applications to easily leverage Jina's powerful search, reranking, and content-reading capabilities.

This server is built using mcp.py (specifically the FastMCP framework) and is designed to be lightweight, fast, and easy to deploy.

Features

The server exposes the following Jina AI APIs as MCP tools:

  • Embeddings: jina_embeddings - Convert text/images to vectors.
  • Reranker: jina_rerank - Refine search results for relevance.
  • Reader: jina_reader - Extract LLM-friendly content from URLs.
  • Search: jina_search - Perform web searches optimized for LLMs.
  • DeepSearch: jina_deepsearch - Combine search, reading, and reasoning.
  • Segmenter: jina_segmenter - Tokenize and chunk text.
  • Text Classifier: jina_classify_text - Classify text with zero-shot models.
  • Image Classifier: jina_classify_image - Classify images with zero-shot models.

⚙️ Configuration

Before running the server, you must obtain a Jina AI API key and set it as an environment variable.

  1. Get your API Key: You can get a free API key from jina.ai.
  2. Set the Environment Variable:
    export JINA_API_KEY="your_api_key_here"
    
    The server will fail to start if this variable is not set.

🚀 Running the Server

There are multiple ways to run the Jina AI MCP server, depending on your environment and preferences.

Using uvx (Recommended)

If you have uv installed, you can run the server directly from PyPI without cloning the repository using uvx. This is the quickest way to get started.

# Ensure JINA_API_KEY is set first
uvx jina-ai-mcp-server

This command will download the package into a temporary virtual environment and execute its entry point (main.py).

Using Docker

A Dockerfile is provided for containerized deployments. This is the recommended approach for production or isolated environments.

  1. Build the Docker Image: From the root of the project directory, run:

    docker build -t jina-ai-mcp-server .
    
  2. Run the Docker Container: You must pass the JINA_API_KEY environment variable to the container.

    docker run -e JINA_API_KEY="your_api_key_here" --rm -it jina-ai-mcp-server
    

    The server will start inside the container.

From Source

If you have cloned the repository, you can run it locally.

  1. Install Dependencies: It's recommended to use a virtual environment.

    # Using uv
    uv venv
    source .venv/bin/activate
    uv pip install -r requirements.txt # Or install from pyproject.toml
    
    # Using standard pip/venv
    python -m venv .venv
    source .venv/bin/activate
    pip install -e .
    
  2. Run the Server:

    # Ensure JINA_API_KEY is set first
    python main.py
    

🔌 Connecting with MCP Clients

To use this server with an MCP client (like the Claude extension), you need to add its configuration to your mcpServers.json file. You can choose the execution method that best suits your setup.

With uvx (Recommended)

This method runs the server directly from PyPI without needing Docker or a local checkout.

{
  "mcpServers": {
    "jina-ai": {
      "command": "uvx",
      "args": [
        "jina-ai-mcp-server"
      ],
      "env": {
        "JINA_API_KEY": "your_api_key_here"
      }
    }
  }
}

With Docker

This method requires you to have built the Docker image first (docker build -t jina-ai-mcp-server .).

{
  "mcpServers": {
    "jina-ai": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "jina-ai-mcp-server"
      ],
      "env": {
        "JINA_API_KEY": "your_api_key_here"
      }
    }
  }
}

📦 Publishing (For Developers)

To publish a new version to PyPI:

  1. Install build tools:
    pip install build twine
    
  2. Build the package:
    python -m build
    
  3. Upload to PyPI:
    twine upload dist/*
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jina_ai_mcp_server-0.2.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jina_ai_mcp_server-0.2.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file jina_ai_mcp_server-0.2.0.tar.gz.

File metadata

  • Download URL: jina_ai_mcp_server-0.2.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for jina_ai_mcp_server-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0bee00333e29759e21184df5638ecb6fc6423282410f60853dc07bb7f0eccd4a
MD5 365fe1ca8fd572635b4b41b4f3035391
BLAKE2b-256 f8d08870405cc21d649b1f6de5a2167f896927e48b8bfad5a38b930e1527357a

See more details on using hashes here.

File details

Details for the file jina_ai_mcp_server-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jina_ai_mcp_server-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c17a227554876a4a40f0f848722c546899953353284e325c88c2ee3601843c5
MD5 76acb170167a917ac277dfa33b1d81e8
BLAKE2b-256 7e3adf5675038cb587ee527a131bdc245d8564d08ef8b7d5594154208aaf7ec1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page