Skip to content

Deploy and Connect the MCP Server

Read MCP Contract before you start.

Prerequisites

  1. Make sure that Python 3.8+ exists on the host.
  2. Clone cis_benchmarks_tools or install cis-benchmarks-tools.
  3. Store database passwords in a local vault.

Safety Instructions

CAUTION: Never pass -p, --password, or --db-password in client arguments. Command arguments expose plaintext passwords in process tables and logs.

CAUTION: Never commit client config files with live CIS_DB_PASSWORD values. Committed secrets grant unauthorized database access.

Procedure

  1. Validate the MCP server installation:
python3 mcp_server.py --version
python3 mcp_server.py --check
python3 mcp_server.py --print-client-config
  1. Open the MCP config file for your client:

  2. Claude Desktop: claude_desktop_config.json

  3. Cursor: .cursor/mcp.json
  4. Antigravity: mcp_config.json

  5. Register cis-benchmarks under mcpServers:

{
  "mcpServers": {
    "cis-benchmarks": {
      "command": "cis-mcp-server",
      "args": [],
      "env": {"CIS_DB_PASSWORD": "<vault-secret>"}
    }
  }
}
  1. If you run from source, set "command": "python3" and "args": ["/abs/path/to/mcp_server.py"].

  2. Inject CIS_DB_PASSWORD from your vault and restart the MCP client.

NOTE: The server exposes 5 read-only tools and 3 resources on stdio.

NOTE: SecretSanitizer masks passwords with *** in outputs and traces.

Verification

  1. Send initialize and tools/list on stdio:
printf '%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"verify","version":"1.0"}}}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
  | python3 mcp_server.py
  1. Confirm 5 tools with readOnlyHint: true and destructiveHint: false.
  2. Call cis_list_targets from the client and confirm 18 targets appear.
  3. Run the MCP test suite:
python3 -m unittest tests/test_mcp_server.py tests/test_mcp_contract.py -v

Rollback

  1. Remove cis-benchmarks from the MCP client config file.
  2. Unset CIS_DB_PASSWORD in your shell and vault session.
  3. Restart the MCP client and confirm zero CIS tools appear.
  4. If a secret leaked into logs or config files, rotate that secret now.