Sponsored by Deepsite.site

Mcp_server_safe_content_check

Created By
baidu7 months ago
Baidu Cloud LLM Security MCP Server focuses on addressing security issues such as compliance with generative content for third-party big models, internal security improvements for big models, and risk convergence for normalized big model operations
Content

百度云大模型内容安全MCP Server

本代码仓库包含一个 MCP 服务器,它提供对百度云大模型内容安全功能的访问。

前提条件

在使用百度云大模型内容安全MCP Server之前,请确保你具备以下条件:

  1. Python 3.10 或更高版本
  2. 已安装uv用于运行MCP Server

使用方式

使用百度云大模型内容安全MCP Server的推荐方式是通过uv运行,而无需进行安装。

克隆代码仓库,执行以下命令:

git clone https://github.com/liangjunyu2010/mcp_server_safe_content_check.git
cd mcp_server_safe_content_check

随后,你可以直接通过uv运行,其中BAIDU_CLOUD_ACCESS_KEY_IDBAIDU_CLOUD_SECRET_ACCESS_KEY根据实际需要修改:

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

或者,在src/mcp_server_safe_content_check/目录中修改.env文件来设置环境变量,再使用以下命令运行服务器:

uv run src/mcp_server_safe_content_check/server.py 

支持的应用程序

百度云大模型内容安全MCP Server可以与各种支持模型上下文协议的大语言模型应用程序配合使用:

  • Cursor:支持 MCP 的人工智能代码编辑器

  • 自定义 MCP 客户端:任何实现 MCP 客户端规范的应用程序

在 Cursor 中的使用方法

Cursor 也支持 MCP工具。你可以通过两种方式将百度MCP Server添加到Cursor中:

依次打开Cursor设置>功能>MCP,点击+添加新的MCP服务器按钮,在mcp.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": "****"
            }
        }
    }
}

重启 Cursor 或重新加载窗口。

可用工具

百度云大模型内容安全MCP Server提供以下工具:

输入检测操作

  • input_analyze: 检测输入内容

    • 参数:
      • text: 输入的文本内容

环境变量

百度云IAM创建 权限选择 AFDFullControlAccessPolicy

  • BAIDU_CLOUD_ACCESS_KEY_ID: 百度云授权ACCESS_KEY
  • BAIDU_CLOUD_SECRET_ACCESS_KEY: 百度云授权SECRET_KEY

使用样例

使用Cursor

Example : 检查文件内容是否存在不安全信息

帮忙检测下风险

Cursor将使用百度云大模型内容安全MCP Server提供的input_analyze来检测输入内容是否安全.

检测结果显示,该文本内容存在极高风险:
风险类型:犯罪相关内容(hitType: crime)
风险评分:0.998(满分1分)
处理建议:严禁传播(action: 2)
安全评估:内容不安全(isSafe: 0)

Server Config

{
  "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": "****"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.