JNews MCP server

Lightweight Python FastAPI server implementation for streamlined server-side interactions, using modern tooling like uv for dependency management and GitHub Actions for automated testing and deployment.
Back to servers
Provider
juhemcp
Release date
Mar 17, 2025
Language
Python
Package
Stats
1.3K downloads

Juhe News MCP Server provides large language models (LLMs) with access to the latest trending news headlines and their detailed content across various categories including recommended, domestic, technology, sports, and more.

Installation

Requirements

This server requires Python 3.10 or higher.

Using uv (Recommended)

When using uv, no specific installation is needed. You can directly run the server using uvx:

uvx jnews-mcp-server

Using PIP

Alternatively, you can install the server via pip:

pip install jnews-mcp-server

After installation, run it as a script using:

python -m jnews_mcp_server

Configuration

API Key Setup

You'll need to get a news headlines API key from Juhe Data:

  1. Visit https://www.juhe.cn/docs/api/id/235 to obtain your API key
  2. Set the environment variable:
JUHE_NEWS_API_KEY=your_api_key

Claude Desktop Integration

Integrate the MCP server with Claude Desktop by modifying the configuration file:

On MacOS:

~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows:

%APPDATA%/Claude/claude_desktop_config.json

Configuration Examples

Using uvx:

"mcpServers": {
  "jnews-mcp-server": {
    "command": "uvx",
    "args": [
      "jnews-mcp-server"
    ],
    "env": {
      "JUHE_NEWS_API_KEY": "your_api_key"
    }
  }
}

Using pip installation:

"mcpServers": {
  "jnews-mcp-server": {
    "command": "python",
    "args": [
      "-m",
      "jnews_mcp_server"
    ],
    "env": {
      "JUHE_NEWS_API_KEY": "your_api_key"
    }
  }
}

Using the Server

Available Tools

The server provides two main tools:

1. get_news_list: Retrieve today's hot news headlines by category

  • Parameters:
    • type: News category (default: "top")
    • page: Page number (default: 1)
    • page_size: Number of results per page (default: 20)

2. get_news_content: Get detailed content for a specific news article

  • Parameters:
    • uniquekey: The news ID (required)

News Categories

You can retrieve different types of news by specifying the category:

  • top (recommended)
  • guonei (domestic)
  • keji (technology)
  • tiyu (sports)
  • and more

Example Queries

You can ask Claude questions like:

  1. "今日有哪些热点新闻?" (What are today's hot news?)
  2. "当前体育热点头条?" (Current sports headlines?)
  3. "第5条新闻的详细内容" (Detailed content of the 5th news item)

Debugging

Use the MCP inspector to debug the server:

npx @modelcontextprotocol/inspector uvx jnews-mcp-server

Or if you've installed the package in a specific directory:

cd path/to/servers/src/jnews-mcp-server
npx @modelcontextprotocol/inspector uv run jnews-mcp-server

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later