home / mcp / cloud data loss prevention dlp api mcp server
MCP Server generated by mcp.ag2.ai
Configuration
View docs{
"mcpServers": {
"ag2-mcp-servers-cloud-data-loss-prevention-dlp-api": {
"command": "python",
"args": [
"mcp_server/main.py",
"stdio"
],
"env": {
"CONFIG": "{...}",
"SECURITY": "YOUR_API_KEY",
"CONFIG_PATH": "mcp_server/mcp_config.json"
}
}
}
}You run an MCP server that exposes the Google Cloud DLP API via its OpenAPI specification. This server implements the Model Context Protocol to let clients interact with the API in a structured, scalable way, enabling advanced tooling, context-aware requests, and consistent client-server communication.
Start the MCP server locally to expose the Google DLP v2 API as an MCP endpoint. You will run a Python command that launches the MCP runtime in stdio mode, which then accepts context-aware requests from your MCP client. Use the provided environment variables to point to a configuration file or inline configuration as needed.
To connect from an MCP client, start the server and point your client at the local stdio channel. The server will read configuration from a JSON file if specified, or from inline JSON provided via environment variables. Ensure your client uses the MCP protocol to initialize a session, negotiate capabilities, and perform API actions through the MCP interface rather than direct HTTP calls.
Prerequisites: Python 3.9 or newer, pip, and uv (optional for alternative running methods). Ensure your environment has these tools installed before proceeding.
# Prerequisites
python --version
pip --version
uv --version 2>/dev/null || echo 'uv not installed; an alternative runner may be used'
# Install dependencies (editable dev mode)
pip install -e ".[dev]"
# Alternative with uv if desired
uv pip install --editable ".[dev]"You can configure the MCP server using environment variables. The following are supported inputs.
CONFIG_PATH: Path to a JSON configuration file (for example, mcp_server/mcp_config.json). This file defines MCP-specific settings for the server.
CONFIG: A JSON string containing the configuration for the MCP server.
SECURITY: Environment variables that control security parameters such as API keys or access controls used by the MCP server.
This project uses several tools to maintain code quality and reliability.
Linting and formatting are performed with ruff. Static type checking is done with mypy, and tests run with pytest.
Check code quality and style using ruff to catch syntax and formatting issues.
Format code with ruff to ensure consistent style across the project.
Run static analysis tools (mypy, bandit, semgrep) to detect type issues and potential security problems.
Execute tests with pytest and generate coverage reports to validate changes.
Automatically run linting, formatting, and basic checks before committing changes.
Use Hatch to build and publish the MCP package.