Content
# Baidu Cloud Large Model Content Security MCP Server
This code repository contains an MCP server that provides access to [Baidu Cloud Large Model Content Security](https://cloud.baidu.com/doc/AIGC_SEC/s/qlxblhd5j) features.
## Prerequisites
Before using the Baidu Cloud Large Model Content Security MCP Server, ensure you have the following:
1. Python 3.10 or higher
2. [uv](https://github.com/astral-sh/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 code repository and execute the following commands:
```
git clone https://github.com/liangjunyu2010/mcp_server_safe_content_check.git
cd mcp_server_safe_content_check
```
Subsequently, you can directly run it with `uv`, where `BAIDU_CLOUD_ACCESS_KEY_ID` and `BAIDU_CLOUD_SECRET_ACCESS_KEY` are 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, modify the `.env` file in the `src/mcp_server_safe_content_check/` directory to set environment variables, and then use the following command to run the server:
```
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 various large language model applications that support the Model Context Protocol:
- **Cursor**: AI code editor that supports MCP
- **Custom MCP Clients**: Any application that implements the MCP client specification
## Usage in Cursor
[Cursor also supports MCP](https://docs.cursor.com/context/model-context-protocol) tools. You can add the Baidu MCP Server to Cursor in two ways:
Open `Cursor Settings` > `Features` > `MCP`, and click the `+ Add New MCP Server` button. Add the following configuration to `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`: Detect input content
- Parameters:
- `text`: Input text content
## Environment Variables
[Baidu Cloud IAM Creation](https://console.bce.baidu.com/iam/#/iam/accesslist) Permission selection `AFDFullControlAccessPolicy`
- `BAIDU_CLOUD_ACCESS_KEY_ID`: Baidu Cloud authorized ACCESS_KEY
- `BAIDU_CLOUD_SECRET_ACCESS_KEY`: Baidu Cloud authorized SECRET_KEY
## Usage Examples
### Using Cursor
#### Example: Check if the file content contains unsafe information
```
帮忙检测下风险
```
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.
```
检测结果显示,该文本内容存在极高风险:
风险类型:犯罪相关内容(hitType: crime)
风险评分:0.998(满分1分)
处理建议:严禁传播(action: 2)
安全评估:内容不安全(isSafe: 0)
```
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
linggen-memory
A local-first memory layer for AI (Cursor, Zed, Claude). Persistent...
everything-claude-code-zh
everything-claude-code Chinese Translation Project: A complete collection of...
mcp-on-rails
A Rails template integrating Model Context Protocol for AI interactions.