Supports environment variable configuration through .env files for storing authentication credentials and other configuration parameters.
Provides access to Baidu Cloud's AI content security services, allowing for text analysis to detect unsafe content such as criminal-related material with risk scoring and action recommendations.
Provides installation via GitHub repository cloning, with source code hosted on GitHub for deployment and updates.
百度云大模型内容安全MCP Server
本代码仓库包含一个 MCP 服务器,它提供对百度云大模型内容安全功能的访问。
前提条件
在使用百度云大模型内容安全MCP Server之前,请确保你具备以下条件:
- Python 3.10 或更高版本
- 已安装uv用于运行MCP Server
使用方式
使用百度云大模型内容安全MCP Server的推荐方式是通过uv
运行,而无需进行安装。
克隆代码仓库,执行以下命令:
随后,你可以直接通过uv
运行,其中BAIDU_CLOUD_ACCESS_KEY_ID
和BAIDU_CLOUD_SECRET_ACCESS_KEY
根据实际需要修改:
或者,在src/mcp_server_safe_content_check/
目录中修改.env
文件来设置环境变量,再使用以下命令运行服务器:
支持的应用程序
百度云大模型内容安全MCP Server可以与各种支持模型上下文协议的大语言模型应用程序配合使用:
- Cursor:支持 MCP 的人工智能代码编辑器
- 自定义 MCP 客户端:任何实现 MCP 客户端规范的应用程序
在 Cursor 中的使用方法
Cursor 也支持 MCP工具。你可以通过两种方式将百度MCP Server添加到Cursor中:
依次打开Cursor设置
>功能
>MCP
,点击+添加新的MCP服务器
按钮,在mcp.json
中添加以下配置:
重启 Cursor 或重新加载窗口。
可用工具
百度云大模型内容安全MCP Server提供以下工具:
输入检测操作
input_analyze
: 创建一个新的Database- 参数:
text
: 输入的文本内容
- 参数:
环境变量
百度云IAM创建 权限选择 AFDFullControlAccessPolicy
BAIDU_CLOUD_ACCESS_KEY_ID
: 百度云授权ACCESS_KEYBAIDU_CLOUD_SECRET_ACCESS_KEY
: 百度云授权SECRET_KEY
使用样例
使用Cursor
Example : 检查文件内容是否存在不安全信息
Cursor将使用百度云大模型内容安全MCP Server提供的input_analyze来检测输入内容是否安全.
You must be authenticated.
Tools
A server that provides access to Baidu Cloud's content moderation capabilities for detecting unsafe content, allowing applications like Cursor to check text for security risks.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityThis server facilitates interaction with cosense/Scrapbox projects, enabling users to retrieve, list, search, and create pages while supporting various query operations and secure access to private projects.Last updated -412TypeScriptMIT License
- -securityFlicense-qualityA server that enables executing and validating SQL queries against Google BigQuery with safety features that prevent data modifications and excessive processing.Last updated -TypeScript
- AsecurityAlicenseAqualityProvides web search capabilities through Baidu with content fetching and parsing features, allowing LLMs to search the web and extract webpage content.Last updated -11PythonMIT License
- -security-license-qualityA server that enables web scraping of difficult-to-access websites affected by bot detection, captchas, or geolocation restrictions, returning results in either HTML or Markdown format.Last updated -1JavaScript