JinaAI MCP Server
Enables LLMs to read and extract clean, markdown-formatted content from any webpage using the Jina AI Reader API.
README
<div align="center">
JinaAI MCP Server
An intelligent web reader tool powered by the Jina.ai Reader API, delivered as a production-grade Model Context Protocol (MCP) server.
</div>
Model Context Protocol (MCP) Server providing a robust, developer-friendly interface to the Jina.ai Reader API. Enables LLMs and AI agents to read, process, and understand content from any webpage programmatically.
Built on the cyanheads/mcp-ts-template, this server follows a modular architecture with robust error handling, logging, and security features.
🚀 Core Capabilities: Jina AI Tools 🛠️
This server equips your AI with a specialized tool to interact with web content:
| Tool Name | Description | Example |
|---|---|---|
jinaai_read_webpage |
Extracts and processes the main content from a given URL using Jina AI's ReaderLM engine. It returns a clean, markdown-formatted text representation of the content. | View Example |
Table of Contents
| Overview | Features | Installation |
|---|---|---|
| Configuration | Project Structure | Development & Testing |
| License |
Overview
The JinaAI MCP Server acts as a bridge, allowing applications that understand the Model Context Protocol (MCP)—like advanced AI assistants, IDE extensions, or custom research tools—to interact directly and efficiently with web content.
Instead of dealing with raw HTML or complex scraping logic, your agents can leverage this server to:
- Automate Information Gathering: Read articles, documentation, and other web content programmatically.
- Gain Deeper Understanding: Access clean, LLM-ready text from any URL without leaving the host application.
- Integrate Web Content into AI Workflows: Enable LLMs to perform research, summarize articles, and incorporate real-time web data into their responses.
Developer Note: This repository includes a .clinerules file that serves as a developer cheat sheet for your LLM coding agent with quick reference for the codebase patterns, file locations, and code snippets.
Features
Core Utilities
Leverages the robust utilities provided by the mcp-ts-template:
- Logging: Structured, configurable logging with sensitive data redaction.
- Error Handling: Centralized error processing and standardized error types (
McpError). - Configuration: Environment variable loading (
dotenv) with validation using Zod. - Input Validation: Uses
zodfor all tool input schemas. - Request Context: End-to-end operation tracking via unique request IDs.
- Type Safety: Enforced by TypeScript and Zod schemas.
- HTTP Transport: High-performance HTTP server using Hono, featuring session management and authentication support.
- Authentication: Robust authentication layer supporting JWT and OAuth 2.1.
- Observability: Integrated OpenTelemetry for distributed tracing and metrics.
Jina AI Integration
- Intelligent Content Extraction: Utilizes Jina's
readerlm-v2engine to parse main content and remove boilerplate. - Multiple Formats: Supports output in Markdown, HTML, or plain text.
- Flexible Options: Control over including links, images, and using the cache.
Installation
Prerequisites
- Node.js (>=18.0.0)
- npm (comes with Node.js)
MCP Client Settings
Add the following to your MCP client's configuration file (e.g., cline_mcp_settings.json).
This configuration uses npx to run the server, which will automatically install the package if not already present.
The JINA_API_KEY is required for the server to function.
{
"mcpServers": {
"jinaai-mcp-server": {
"command": "npx",
"args": ["@cyanheads/jinaai-mcp-server"],
"env": {
"MCP_TRANSPORT_TYPE": "http",
"MCP_HTTP_PORT": "3018",
"JINA_API_KEY": "YOUR_JINA_API_KEY_HERE"
}
}
}
}
From Source
- Clone the repository:
git clone https://github.com/cyanheads/jinaai-mcp-server.git cd jinaai-mcp-server - Install dependencies:
npm install - Build the project:
npm run build
Configuration
Environment Variables
Configure the server using environment variables. For local development, create a .env file at the project root.
| Variable | Description | Default |
|---|---|---|
JINA_API_KEY |
Required. Your API key for the Jina AI service. | (none) |
MCP_TRANSPORT_TYPE |
Transport mechanism: stdio or http. |
stdio |
MCP_HTTP_PORT |
Port for the HTTP server (if MCP_TRANSPORT_TYPE=http). |
3018 |
LOGS_DIR |
Directory for log file storage. | logs/ |
NODE_ENV |
Runtime environment (development, production). |
development |
Project Structure
The codebase follows a modular structure within the src/ directory:
src/
├── index.ts # Entry point: Initializes and starts the server
├── config/ # Configuration loading (env vars)
│ └── index.ts
├── mcp-server/ # Core MCP server logic and capability registration
│ ├── server.ts # Server setup, tool registration
│ └── tools/ # MCP Tool implementations
│ └── jinaReader/ # The Jina AI Reader tool
└── utils/ # Common utility functions (logger, error handler, etc.)
For a detailed file tree, run npm run tree or see docs/tree.md.
Development & Testing
Development Scripts
# Build the project (compile TS to JS in dist/)
npm run build
# Clean build artifacts and then rebuild the project
npm run rebuild
# Format code with Prettier
npm run format
Testing
This project uses Vitest for unit and integration testing.
# Run all tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests and generate a coverage report
npm run test:coverage
Running the Server
# Start the server using stdio (default)
npm run start:server
# Start the server using HTTP transport
npm run start:server:http
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
<div align="center"> Built with the <a href="https://modelcontextprotocol.io/">Model Context Protocol</a> </div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。