liangjunyu2010
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"safe-content-check": {
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"/PATH/mcp_server_safe_content_check/src/mcp_server_safe_content_check/server.py"
],
"command": "uv",
"env": {
"BAIDU_CLOUD_ACCESS_KEY_ID": "****",
"BAIDU_CLOUD_SECRET_ACCESS_KEY": "****"
}
}
}
}
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
input_analyze 1 个参数 需填 1 项
n Name:n 检测文本安全nn Description:n 将文本进行检测,判断是否存在风险内容nn Args:n text: 待检测文本n
必填参数:text
服务介绍
Baidu Cloud Large Model Content Security MCP Server
This code repository contains an MCP server that provides access to the Baidu Cloud Large Model Content Security functionality.
Prerequisites
Before using the Baidu Cloud Large Model Content Security MCP Server, ensure you have the following:
- Python 3.10 or higher
- uv installed for running the MCP Server
Usage
The recommended way to use the Baidu Cloud Large Model Content Security MCP Server is by running it with uv without installation.
Clone the repository and execute the following commands:
git clone https://github.com/liangjunyu2010/mcp_server_safe_content_check.git
cd mcp_server_safe_content_check
Then, you can run it directly using uv, where BAIDU_CLOUD_ACCESS_KEY_ID and BAIDU_CLOUD_SECRET_ACCESS_KEY should be modified according to your actual needs:
uv run src/mcp_server_safe_content_check/server.py
uv run src/mcp_server_safe_content_check/server.py --BAIDU_CLOUD_ACCESS_KEY_ID ACCESS_KEY --BAIDU_CLOUD_SECRET_ACCESS_KEY SECRET_KEY
Alternatively, you can set environment variables by modifying the .env file in the src/mcp_server_safe_content_check/ directory, and then run the server using the following command:
uv run src/mcp_server_safe_content_check/server.py
Supported Applications
The Baidu Cloud Large Model Content Security MCP Server can be used with a variety of large language model applications that support the Model Context Protocol (MCP):
- Cursor: An AI code editor that supports MCP
- Custom MCP Clients: Any application that implements the MCP client specification
Usage in Cursor
Cursor also supports the MCP tool. You can add the Baidu MCP Server to Cursor in two ways:
Open Cursor Settings > Features > MCP, click the + Add New MCP Server button, and add the following configuration in mcp.json:
JSON
{
"mcpServers": {
"safe-content-check": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"/PATH/mcp_server_safe_content_check/src/mcp_server_safe_content_check/server.py"
],
"env": {
"BAIDU_CLOUD_ACCESS_KEY_ID": "",
"BAIDU_CLOUD_SECRET_ACCESS_KEY": ""
}
}
}
}
Restart Cursor or reload the window.
Available Tools
The Baidu Cloud Large Model Content Security MCP Server provides the following tools:
Input Detection Operations
-
input_analyze: Detects input content- Parameters:
text: The text content to be analyzed
- Parameters:
Environment Variables
Create Baidu Cloud IAM and select AFDFullControlAccessPolicy for permissions.
BAIDU_CLOUD_ACCESS_KEY_ID: Baidu Cloud Access Key IDBAIDU_CLOUD_SECRET_ACCESS_KEY: Baidu Cloud Secret Access Key
Usage Examples
Using Cursor
Example: Check if a file contains unsafe information
Help check for risks
Cursor will use the input_analyze provided by the Baidu Cloud Large Model Content Security MCP Server to detect whether the input content is safe.
The detection result shows that the text content has extremely high risk:
Risk Type: Crime-related content (hitType: crime)
Risk Score: 0.998 (out of 1)
Action Suggestion: Prohibit dissemination (action: 2)
Safety Assessment: Content is unsafe (isSafe: 0)