Skip to content

Commit 89c9e04

Browse files
authored
Merge pull request #1 from CheckPointSW/management-api-mcp
mcp server for management api
2 parents d31497e + 4887280 commit 89c9e04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+10023
-1
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ARG FROM_BRANCH=latest
2+
FROM node:18
3+
4+
WORKDIR /home/jenkins/app
5+
6+
COPY package.json ./
7+
8+
RUN npm install
9+
10+
COPY . .
11+
12+
EXPOSE 3000
13+
14+
HEALTHCHECK CMD true

Dockerfile_base

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# build it with command
2+
# docker build -f ./Dockerfile_base -t gitlab.locsec.net:4567/mtp-dev/console-one-frontend/base:master -t gitlab.locsec.net:4567/mtp-dev/console-one-frontend/base:latest --platform linux/amd64 .
3+
#
4+
FROM node:18
5+
6+
WORKDIR /home/jenkins/app
7+
8+
COPY package.json /home/jenkins/app/
9+
10+
RUN npm install
11+

README.md

Lines changed: 181 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,181 @@
1-
# mpc-quantum
1+
2+
3+
# Check Point Quantum Management MCP Server
4+
5+
## What is MCP?
6+
7+
The Model Context Protocol (MCP) is a standardized interface that allows AI agents and automation tools to interact programmatically with Check Point Quantum Management servers. Using MCP, you can:
8+
9+
- Query and visualize installed policies, rulebases, and network topology
10+
- Retrieve and analyze access, NAT, and threat prevention rules
11+
- List and inspect objects such as hosts, networks, services, VPN communities, and more
12+
13+
14+
## Demo
15+
16+
<!-- Place a link or embed for a demo video here -->
17+
18+
## Use Cases
19+
20+
### Helps ensure regulatory compliance with industry standards.
21+
Prompt: Check if my gateway configuration meets PCI-DSS/HIPAA/GDPR requirements.
22+
23+
### Find broad-definition rules
24+
Prompt: List all firewall rules that allow traffic from any source to any destination on any port. Highlight rules that are disabled or unused.
25+
26+
### Source -> Destination Path Analysis
27+
Prompt: Can you check in my policy if HOST/Network can access the internet?
28+
29+
### Recommendation for rulebase optimization
30+
Prompt: Take a look at the internet facing rules in my policy and suggest improvements. Are there any rules that you think I should strengthen or loosen. Consider both security risks and time wasting. In your recommendations, only refer to specific rules that you think can be changed, or offer to add new rules.
31+
32+
### Custom policy visualizations
33+
Prompt: Please create a visual report that shows which services are allowed in my network, under which conditions, and which services are strictly blocked.
34+
35+
36+
## Configuration Options
37+
38+
This server supports two main modes of authentication:
39+
40+
### 1. Smart-1 Cloud (API Key)
41+
42+
Authenticate to Check Point Smart-1 Cloud using an API key.
43+
44+
- **How to generate an API key:**
45+
In your SmartOne Cloud dashboard, go to Settings -> API & SmartConsole and genrate an API Key.
46+
Copy the key and the server login URL (without the "login" suffix) to your client settings.
47+
![alt text](s1c_api_key.png)
48+
49+
50+
Set the following environment variables for Smart-1 Cloud:
51+
52+
- `API_KEY`: Your Smart-1 Cloud API key
53+
- `S1C_URL`: Your Smart-1 Cloud Tenant "Web-API" URL
54+
55+
---
56+
57+
### 2. On-Prem Management (API Key or Username/Password)
58+
59+
60+
Authenticate to an on-premises Security Management Server using either an API key or username/password.
61+
62+
- **How to create an administrator and credentials:**
63+
- Follow the official instructions here: [Managing Administrator Accounts (Check Point R81+)](https://sc1.checkpoint.com/documents/R81/WebAdminGuides/EN/CP_R81_SecurityManagement_AdminGuide/Topics-SECMG/Managing_Administrator_Accounts.htm)
64+
- When creating the administrator, set the desired permissions for API access and management operations.
65+
- You can authenticate using either an API key (recommended for automation) or username/password credentials.
66+
67+
Set the following environment variables:
68+
69+
- `API_KEY`: Your management API key (if using API key authentication)
70+
- `MANAGEMENT_HOST`: The IP or hostname of your management server
71+
- `PORT`: (Optional) Management server port (default: 443)
72+
- `USERNAME`: (Optional) Username for authentication
73+
- `PASSWORD`: (Optional) Password for authentication
74+
75+
---
76+
## Client Configuration
77+
78+
This server can be used with Claude Desktop, Cursor, GitHub Copilot MCP integrations or any other MCP. Use the appropriate configuration for your environment:
79+
80+
### Smart-1 Cloud Example
81+
82+
```json
83+
{
84+
"mcpServers": {
85+
"quantum-management": {
86+
"command": "npx",
87+
"args": ["@chkp/quantum_management_mcp"],
88+
"env": {
89+
"API_KEY": "YOUR_API_KEY",
90+
"S1C_URL": "YOUR_S1C_URL" //https://xxxxxxxx.maas.checkpoint.com/yyyyyyy/web_api
91+
}
92+
}
93+
}
94+
}
95+
```
96+
97+
### On-Prem Management Example
98+
99+
```json
100+
{
101+
"mcpServers": {
102+
"quantum-management": {
103+
"command": "npx",
104+
"args": ["@chkp/quantum_management_mcp"],
105+
"env": {
106+
"MANAGEMENT_HOST": "YOUR_MANAGEMENT_IP_OR_HOST_NAME",
107+
"MANAGEMENT_PORT": "443", // optional, default is 443
108+
"API_KEY": "YOUR_API_KEY", // or use USERNAME and PASSWORD
109+
"USERNAME": "YOUR_USERNAME", // optional
110+
"PASSWORD": "YOUR_PASSWORD" // optional
111+
}
112+
}
113+
}
114+
}
115+
```
116+
117+
> Set only the environment variables required for your authentication method (see above for details).
118+
119+
### Configuring the Claude Desktop app
120+
For macOS:
121+
### Create the config file if it doesn't exist
122+
touch "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
123+
124+
### Opens the config file in TextEdit
125+
open -e "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
126+
127+
### For Windows:
128+
code %APPDATA%\Claude\claude_desktop_config.json
129+
130+
### Add the server configuration:
131+
132+
```json
133+
{
134+
"mcpServers": {
135+
"quantum-management": {
136+
"command": "npx",
137+
"args": ["@chkp/quantum_management_mcp"],
138+
"env": {
139+
Add the configuration from the above instructions
140+
}
141+
}
142+
}
143+
}
144+
```
145+
## Development
146+
147+
### Prerequisites
148+
149+
- Node.js 18+
150+
- npm 8+
151+
152+
### Setup
153+
154+
```bash
155+
# Install all dependencies
156+
npm install
157+
```
158+
159+
### Build
160+
161+
```bash
162+
# Build all packages
163+
npm run build
164+
```
165+
166+
### Running Locally
167+
168+
You can run the server locally for development:
169+
170+
```bash
171+
npm run start
172+
# or
173+
npx ts-node src/index.ts
174+
```
175+
176+
---
177+
## ⚠️ Security Notice
178+
179+
1. **Authentication keys and credentials are never shared with the model.** They are only used by the MCP server to authenticate with your Check Point management system.
180+
2. **Only use client implementations you trust.** Malicious or untrusted clients could misuse your credentials or data.
181+
3. **Management data will be exposed to the model.** Ensure you only use models and providers that comply with your organization's policies regarding PII and sensitive information exposure.

debug-api.ts

Whitespace-only changes.

package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@chkp/genai-mcp-root",
3+
"version": "1.0.0",
4+
"description": "Monorepo for Check Point MCP servers",
5+
"private": true,
6+
"type": "module",
7+
"workspaces": [
8+
"packages/*"
9+
],
10+
"scripts": {
11+
"clean": "find ./packages -type d -name dist -exec rm -rf {} + && rm -rf ./dist && find . -name 'tsconfig.tsbuildinfo' -delete",
12+
"build": "tsc --build",
13+
"dev": "npm run dev --workspaces --if-present",
14+
"test": "npm run test --workspaces --if-present",
15+
"build:all": "npm run clean && tsc --build",
16+
"build-debug": "tsc -p tsconfig.debug.json",
17+
"debug-api": "node scripts/debug-api.js",
18+
"debug-harmony": "node scripts/debug-harmony.js"
19+
},
20+
"keywords": [
21+
"mcp",
22+
"model-context-protocol"
23+
],
24+
"author": "",
25+
"license": "MIT",
26+
"dependencies": {
27+
"@modelcontextprotocol/sdk": "^1.11.4",
28+
"body-parser": "^1.20.2",
29+
"commander": "^13.1.0",
30+
"express": "^4.18.2",
31+
"zod": "^3.24.4"
32+
},
33+
"devDependencies": {
34+
"@types/body-parser": "^1.19.2",
35+
"@types/express": "^4.17.17",
36+
"@types/node": "^18.15.11",
37+
"ts-node": "^10.9.1",
38+
"typescript": "^5.0.4"
39+
}
40+
}

packages/infra/README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# MCP Server Infrastructure
2+
3+
Shared infrastructure code for Check Point MCP servers. This package provides common utilities, API clients, and server helpers used across all MCP server implementations.
4+
5+
## Installation
6+
7+
```bash
8+
npm install @cp-mcp/infra
9+
```
10+
11+
## Features
12+
13+
- API client for Check Point products
14+
- Smart One Cloud
15+
- On-premise Management Server
16+
- Harmony SASE
17+
- Async logging with MCP context
18+
- Settings management
19+
- Server utility functions
20+
- Server runner CLI
21+
22+
## Usage
23+
24+
### Creating a new MCP server
25+
26+
```typescript
27+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
28+
import * as z from 'zod';
29+
import { startServer } from '@cp-mcp/infra';
30+
31+
// Create a new MCP server instance
32+
const server = new McpServer({
33+
name: "my-server",
34+
description: "My MCP server",
35+
version: "1.0.0"
36+
});
37+
38+
// Add tools
39+
server.tool(
40+
"my-tool",
41+
"Description of my tool",
42+
{
43+
param1: z.string().describe("Parameter description"),
44+
},
45+
async ({ param1 }) => {
46+
// Tool implementation
47+
return {
48+
content: [
49+
{
50+
type: "text",
51+
text: "Response text"
52+
},
53+
],
54+
};
55+
}
56+
);
57+
58+
// Start the server
59+
async function main() {
60+
await startServer(server);
61+
}
62+
63+
main().catch(error => {
64+
console.error("Fatal error in main():", error);
65+
process.exit(1);
66+
});
67+
```
68+
69+
### Using the API client
70+
71+
```typescript
72+
import { getApiManager, ServerType, callManagementApi } from '@cp-mcp/infra';
73+
74+
// Get an API manager
75+
const apiManager = await getApiManager(ServerType.MANAGEMENT);
76+
77+
// Call the API
78+
const response = await apiManager.callApi('post', 'show-hosts', {
79+
limit: 10,
80+
offset: 0
81+
});
82+
83+
// Or use the convenience function
84+
const hosts = await callManagementApi('POST', 'show-hosts', {
85+
limit: 10,
86+
offset: 0
87+
});
88+
```
89+
90+
## CLI Usage
91+
92+
The package includes a CLI for running MCP servers:
93+
94+
```bash
95+
npx cp-mcp-run <server-name>
96+
```
97+
98+
Where `<server-name>` is one of the registered servers in the monorepo.

0 commit comments

Comments
 (0)