Skip to main content

一个提供热点新闻头条信息功能的模型上下文协议(Model Context Protocol)服务器。

Project description

Juhe News MCP Server

一个提供新闻头条信息功能的模型上下文协议(Model Context Protocol)服务器。该服务器使大型语言模型(LLMs)能够获取当前最新的热点新闻头条(包括:推荐、国内、科技、体育等类型)及详细内容信息。

Components

Tools

服务器实现了两个工具:

  • get_news_list: 根据新闻类型获取今日热点新闻头条
    • 需要传入 "type"(新闻类型)作为选填的字符串参数。
async def get_news_list(type: str = "top", page: int = 1, page_size: int = 20) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
  • get_news_content: 根据新闻类型获取今日热点新闻头条
    • 需要传入 "uniquekey"(新闻id)作为必须的字符串参数。
async def get_news_content(uniquekey: str) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:

Install

This server requires Python 3.10 or higher. Install dependencies using uv (recommended) or pip

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run jnews-mcp-server.

uvx jnews-mcp-server

Using PIP

Alternatively you can install jnews-mcp-server via pip:

pip install jnews-mcp-server

After installation, you can run it as a script using:

python -m jnews_mcp_server

Configuration

Environment Variables

JUHE_NEWS_API_KEY: 聚合数据的新闻头条API密钥。获取:https://www.juhe.cn/docs/api/id/235

JUHE_NEWS_API_KEY=your_api_key

Claude Desktop

  • On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json
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"
    }
  }
}

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx jnews-mcp-server 

Or if you've installed the package in a specific directory or are developing on it:

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

Examples of Questions for Cline

  1. "今日有哪些热点新闻?"
  2. "当前体育热点头条?"
  3. "第5条新闻的详细内容"

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

mseep_jnews_mcp_server-0.1.4.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

mseep_jnews_mcp_server-0.1.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file mseep_jnews_mcp_server-0.1.4.tar.gz.

File metadata

  • Download URL: mseep_jnews_mcp_server-0.1.4.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for mseep_jnews_mcp_server-0.1.4.tar.gz
Algorithm Hash digest
SHA256 249027e3e6623e05b3aa7b1e4e010e8376bb01ebebe9765c4e7849aff2f41271
MD5 179e580ea1591bc371ae772de68545e3
BLAKE2b-256 2d5750d6f6e9f7cc6fce999f53313cb59b7d26a61b3b09283175e71707921eee

See more details on using hashes here.

File details

Details for the file mseep_jnews_mcp_server-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_jnews_mcp_server-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 94c03036d34802f2ea7a34cd7b024c1b315c0fcf3ca0c8078d02defab29b1070
MD5 aa9ed1bc5002b7701968cde5a33508b8
BLAKE2b-256 77cea2f4ebbf310274fe9529b50fce5b6dabfa33afeadbf37ceff790541510e0

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