Deploy and Connect the MCP Server¶
Read MCP Contract before you start.
Prerequisites¶
- Make sure that Python
3.8+exists on the host. - Clone
cis_benchmarks_toolsor installcis-benchmarks-tools. - 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¶
- Validate the MCP server installation:
python3 mcp_server.py --version
python3 mcp_server.py --check
python3 mcp_server.py --print-client-config
-
Open the MCP config file for your client:
-
Claude Desktop:
claude_desktop_config.json - Cursor:
.cursor/mcp.json -
Antigravity:
mcp_config.json -
Register
cis-benchmarksundermcpServers:
{
"mcpServers": {
"cis-benchmarks": {
"command": "cis-mcp-server",
"args": [],
"env": {"CIS_DB_PASSWORD": "<vault-secret>"}
}
}
}
-
If you run from source, set
"command": "python3"and"args": ["/abs/path/to/mcp_server.py"]. -
Inject
CIS_DB_PASSWORDfrom 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¶
- Send
initializeandtools/liston 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
- Confirm 5 tools with
readOnlyHint: trueanddestructiveHint: false. - Call
cis_list_targetsfrom the client and confirm 18 targets appear. - Run the MCP test suite:
Rollback¶
- Remove
cis-benchmarksfrom the MCP client config file. - Unset
CIS_DB_PASSWORDin your shell and vault session. - Restart the MCP client and confirm zero CIS tools appear.
- If a secret leaked into logs or config files, rotate that secret now.