Content
# 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](https://cloud.baidu.com/doc/AIGC_SEC/s/qlxblhd5j) features.
## Prerequisites
Before using the Baidu Cloud Large Model Content Security MCP Server, please ensure you meet the following requirements:
1. Python 3.10 or higher
2. [uv](https://github.com/astral-sh/uv) installed to run the MCP Server
## Usage
The recommended way to use the Baidu Cloud Large Model Content Security MCP Server is to run it via `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
```
Then, you can run it directly using `uv`, modifying `BAIDU_CLOUD_ACCESS_KEY_ID` and `BAIDU_CLOUD_SECRET_ACCESS_KEY` as needed:
```
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 modify the `.env` file in the `src/mcp_server_safe_content_check/` directory to set environment variables, 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 various large language model applications that support model context protocols:
- **Cursor**: An AI code editor that supports MCP
- **Custom MCP Client**: Any application that implements the MCP client specification
## How to Use 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`, 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 Operation
- `input_analyze`: Create a new Database
- Parameters:
- `text`: The input text content
## Environment Variables
[Create Baidu Cloud IAM](https://console.bce.baidu.com/iam/#/iam/accesslist) and select the permission `AFDFullControlAccessPolicy`
- `BAIDU_CLOUD_ACCESS_KEY_ID`: Baidu Cloud authorized ACCESS_KEY
- `BAIDU_CLOUD_SECRET_ACCESS_KEY`: Baidu Cloud authorized SECRET_KEY
## Usage Example
### Using Cursor
#### Example: Check if the file content contains unsafe information
```
Please help check for risks
```
Cursor will use the `input_analyze` provided by the Baidu Cloud Large Model Content Security MCP Server to check if the input content is safe.
```
The detection result shows that the text content has a very high risk:
Risk Type: Crime-related content (hitType: crime)
Risk Score: 0.998 (out of 1)
Recommended Action: Prohibit dissemination (action: 2)
Safety Assessment: Content is unsafe (isSafe: 0)
```
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.
experiments-with-mcp
A collection of practical experiments with MCP using various libraries.
guidance-for-deploying-model-context-protocol-servers-on-aws
Guidance for deploying Model Context Protocol servers on AWS with secure...
mcp-hubspot
MCP server for AI assistants to access HubSpot CRM data efficiently.