MCP Server for AccuKnox¶
This guide provides step-by-step instructions for setting up and using the AccuKnox MCP Server with your favorite AI tools.
Quick Start¶
1. Prerequisites¶
Before you begin
Ensure you have the following ready:
- Python 3.10 or higher installed.
- An AccuKnox API Token (retrieve this from your CSPM dashboard).
2. Installation¶
Setup Instructions
Clone the repository and install the necessary dependencies:
git clone https://github.com/accuknox/mcp_server/
cd mcp_server # move into the project directory
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
3. Configuration¶
Important: Environment Variables
Currently, the server relies on a .env file for configuration. Do not configure environment variables directly in mcp.json at this time.
Create a .env file in the project root:
ACCUKNOX_BASE_URL=[https://cspm.demo.accuknox.com](https://cspm.demo.accuknox.com)
ACCUKNOX_API_TOKEN=your_token_here
🛠️ Client Configuration¶
1. VS Code (GitHub Copilot)¶
Prerequisite
You must have the GitHub Copilot Extension installed.
- Create a folder named
.vscodein your project root (if it doesn't exist). - Create a file named
mcp.jsoninside.vscode/. -
Add the following configuration (replace
/absolute/path/towith your actual path):.vscode/mcp.json{ "mcpServers": { "accuknox": { "command": "/absolute/path/to/MCP_server_Poc/venv/bin/python", "args": ["/absolute/path/to/MCP_server_Poc/MCP_server.py"] } } } -
Restart VS Code or reload the window.
- Open Copilot Chat and look for the "Tools" icon to verify
accuknoxis enabled.
2. Cursor¶
Cursor supports MCP servers via a configuration file similar to VS Code, but in a different directory.
- Create a folder named
.cursorin your project root (if it doesn't exist). - Create a file named
mcp.jsoninside.cursor/. -
Add the following configuration:
.cursor/mcp.json{ "mcpServers": { "accuknox": { "command": "/absolute/path/to/MCP_server_Poc/venv/bin/python", "args": ["/absolute/path/to/MCP_server_Poc/MCP_server.py"] } } }
Path Resolution Issues
Important: Ensure the .env file is in the project root. Cursor should pick up the environment variables from the .env file if opened in the project root.
If you encounter issues, use the wrapper script approach below.
Optional: Wrapper Script Approach
If Cursor fails to load the environment variables, create a start_server.sh script:
#!/bin/bash
# Navigate to the project directory to ensure .env is loaded
cd /absolute/path/to/MCP_server_Poc
source .env
./venv/bin/python MCP_server.py
Make it executable (chmod +x start_server.sh) and update mcp.json to point to this script.
3. Claude Desktop App¶
- Locate your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Edit the file to include the AccuKnox server:
claude_desktop_config.json{ "mcpServers": { "accuknox": { "command": "/absolute/path/to/MCP_server_Poc/venv/bin/python", "args": ["/absolute/path/to/MCP_server_Poc/MCP_server.py"] } } } -
Restart the Claude Desktop App.
- Look for the 🔌 icon to verify the server is connected.
4. Gemini CLI¶
- Install the Gemini CLI tools (if not already installed).
-
Add the MCP server using the
geminicommand:gemini mcp add accuknox \ /absolute/path/to/MCP_server_Poc/venv/bin/python \ /absolute/path/to/MCP_server_Poc/MCP_server.py
Note
Ensure you run the gemini command from the project directory where .env is located, or that the environment variables are exported in your shell.
5. HTTP Server Configuration (Advanced)¶
To use the fastmcp server in HTTP mode (SSE):
-
Activate Virtual Environment:
cd /absolute/path/to/MCP_server_Poc source venv/bin/activate -
Start the Server:
python3 fastmcp_server.pyThe server will start on
http://0.0.0.0:8000. -
Configure Client (e.g., VS Code/Cursor): Update your
mcp.jsonto use the SSE endpoint:{ "mcpServers": { "accuknox-http": { "url": "http://localhost:8000/mcp", "type": "sse" } } }
Usage Examples¶
Try these prompts
Once connected, you can ask questions like:
- "How many cloud assets do I have?"
- "Show me all AWS S3 buckets in us-east-1."
- "What are the critical vulnerabilities in my AI models?"
- "List deployed AI models discovered in the last 24 hours."
Troubleshooting¶
Common Issues
- Server not starting? Check the logs or try running the command manually in your terminal to see errors.
- Authentication failed? Verify your
ACCUKNOX_API_TOKENis correct in the.envfile. - Path issues? Always use absolute paths in configuration files.