npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lucianaib/csdn-prohibited-word-check

v1.1.7

Published

CSDN违禁词检查工具,支持文本输入和文件读取,可作为MCP服务器集成到AI开发环境中

Readme

@lucianaib/csdn-prohibited-word-check

CSDN违禁词检查工具,支持对CSDN平台文章进行违禁词核查,可直接通过命令行使用或集成到MCP环境中。

功能特性

  • 支持直接输入文本进行违禁词检查
  • 支持从文件读取内容进行违禁词检查
  • 可以集成到Claude/Cursor等支持MCP的环境中
  • 处理中文编码,确保中文内容正确检查
  • 内置离线备用检查功能,即使API不可用也能工作

安装

全局安装

npm install -g @lucianaib/csdn-prohibited-word-check

项目内安装

npm install --save-dev @lucianaib/csdn-prohibited-word-check

命令行使用

直接输入文本进行检查

csdn-check --text "这是要检查的文章内容,包含可能的违禁词。"

从文件读取内容进行检查

csdn-check --file "path/to/your/article.txt"

MCP集成使用

1. 全局安装工具

npm install -g @lucianaib/csdn-prohibited-word-check

2. 配置MCP客户端

将以下内容添加到你的MCP客户端配置中(通常是MCP根目录下的mcp.json文件):

{
  "mcpServers": {
    "CSDN-Prohibited-Word-Check": {
      "command": "npx",
      "args": ["@lucianaib/csdn-prohibited-word-check"],
      "env": {
        "MCP_SERVER": "true"
      }
    }
  }
}

注意

  • 使用npx命令可以确保使用最新安装的全局版本
  • 添加"env": {"MCP_SERVER": "true"}确保以MCP模式运行
  • 如果已全局安装,也可以使用包名直接调用:"command": "csdn-check"

2. 重启MCP客户端

保存配置后,重启你的MCP客户端(如Claude、Cursor等)以加载新的服务器。

3. 使用MCP工具

在MCP客户端中,你现在可以使用以下两个工具:

check_text - 检查文本内容

检查输入文本中是否包含CSDN平台的违禁词。

参数

  • text(字符串,必需):要检查的文本内容

check_file - 检查文件内容

读取指定文件并检查其中是否包含CSDN平台的违禁词。

参数

  • file_path(字符串,必需):要检查的文件路径

技术特点

  • 标准MCP实现:使用官方MCP SDK,确保兼容性
  • 双模式支持:同时支持MCP模式和命令行模式
  • 离线备用功能:内置本地违禁词检查,API不可用时仍能工作
  • 流式API处理:正确处理Coze API的流式响应
  • 错误恢复机制:自动处理网络错误和API故障

错误处理

本工具具有强大的错误处理能力和离线备用功能:

  1. 网络连接问题处理:当遇到网络连接错误、超时或API不可用时,工具会自动切换到本地备用检查模式
  2. 友好的错误提示:针对不同类型的错误(网络错误、授权错误、文件读取错误等)提供详细的错误信息
  3. 本地备用检查:即使API完全不可用,工具也会使用内置的违禁词模式进行基础检查
  4. MCP环境适配:优化了在MCP环境中的运行方式,避免了"Connection closed"错误
  5. 完整日志记录:提供详细的操作日志,方便调试和排查问题

故障排除

"Connection closed"错误

如果遇到此错误:

  1. 确保已安装所有依赖:npm install
  2. 检查MCP配置中的路径是否正确
  3. 确保设置了"env": {"MCP_SERVER": "true"}
  4. 重启MCP客户端

文件路径错误

  1. 使用绝对路径
  2. 检查文件是否存在且可读
  3. 确保路径中的特殊字符已正确转义

更新日志

v1.0.4

  • 重构为标准MCP服务器实现
  • 修复"Connection closed"错误
  • 添加文件路径解析错误处理
  • 在一个MCP服务器中提供两个工具功能

许可证

ISC

作者

lucianaib