Skip to content

Commit 9a5ba4a

Browse files
committed
1. Remove Harmony from infra
2. README 3. User Agent
1 parent a4d1391 commit 9a5ba4a

File tree

5 files changed

+79
-159
lines changed

5 files changed

+79
-159
lines changed

README.md

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
# Check Point Quantum Management MCP Server
42

53
## What is MCP?
@@ -10,28 +8,28 @@ The Model Context Protocol (MCP) is a standardized interface that allows AI agen
108
- Retrieve and analyze access, NAT, and threat prevention rules
119
- List and inspect objects such as hosts, networks, services, VPN communities, and more
1210

13-
1411
## Demo
1512

1613
<!-- Place a link or embed for a demo video here -->
1714

1815
## Use Cases
1916

20-
### Helps ensure regulatory compliance with industry standards.
17+
### Ensure regulatory compliance with industry standards
2118
Prompt: Check if my gateway configuration meets PCI-DSS/HIPAA/GDPR requirements.
22-
23-
### Find broad-definition rules
19+
20+
### Find broad-definition rules
2421
Prompt: List all firewall rules that allow traffic from any source to any destination on any port. Highlight rules that are disabled or unused.
2522

26-
### Source -> Destination Path Analysis
27-
Prompt: Can you check in my policy if HOST/Network can access the internet?
23+
### Source Destination Path Analysis
24+
Prompt: Can you check in my policy if a HOST or Network can access the internet?
2825

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.
26+
### Recommendation for rulebase optimization
27+
Prompt: Take a look at the internet-facing rules in my policy and suggest improvements. Identify if there are any rules that should be strengthened or loosened. Consider both security risks and administrative overhead. In your recommendations, refer only to specific rules that can be changed or suggest adding new ones.
3128

32-
### Custom policy visualizations
29+
### Custom policy visualizations
3330
Prompt: Please create a visual report that shows which services are allowed in my network, under which conditions, and which services are strictly blocked.
3431

32+
---
3533

3634
## Configuration Options
3735

@@ -41,41 +39,43 @@ This server supports two main modes of authentication:
4139

4240
Authenticate to Check Point Smart-1 Cloud using an API key.
4341

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.
42+
- **How to generate an API key:**
43+
In your Smart-1 Cloud dashboard, go to **Settings API & SmartConsole** and generate an API key.
44+
Copy the key and the server login URL (excluding the `/login` suffix) to your client settings.
4745
![alt text](s1c_api_key.png)
4846

47+
Set the following environment variables:
4948

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
49+
- `API_KEY`: Your Smart-1 Cloud API key
50+
- `S1C_URL`: Your Smart-1 Cloud tenant "Web-API" URL
5451

5552
---
5653

5754
### 2. On-Prem Management (API Key or Username/Password)
5855

56+
- **Configure your management server to allow API access:**
57+
To use this server with an on-premises Check Point management server, you must first enable API access.
58+
Follow the official instructions for [Managing Security through API](https://sc1.checkpoint.com/documents/R82/WebAdminGuides/EN/CP_R82_SmartProvisioning_AdminGuide/Content/Topics-SPROVG/Managing-Security-through-API.htm).
5959

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.
60+
- **Authenticate to the Security Management Server** using either an API key or username/password:
61+
- Follow the official instructions: [Managing Administrator Accounts (Check Point R81+)](https://sc1.checkpoint.com/documents/R81/WebAdminGuides/EN/CP_R81_SecurityManagement_AdminGuide/Topics-SECMG/Managing_Administrator_Accounts.htm)
62+
- When creating the administrator, assign appropriate permissions for API access and management operations.
63+
- You can authenticate using an API key (recommended for automation) or username/password credentials.
6664

6765
Set the following environment variables:
6866

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
67+
- `MANAGEMENT_HOST`: IP address or hostname of your management server
68+
- `PORT`: (Optional) Management server port (default: 443)
69+
- `API_KEY`: Your management API key (if using API key authentication)
70+
- `USERNAME`: Username for authentication (if using username/password authentication)
71+
- `PASSWORD`: Password for authentication (if using username/password authentication)
7472

7573
---
74+
7675
## Client Configuration
7776

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:
77+
This server can be used with Claude Desktop, Cursor, GitHub Copilot MCP integrations, or any other MCP client.
78+
> Note: Due to the nature of management API calls, using this server may require a paid subscription to the model provider to handle token limits and context windows.
7979
8080
### Smart-1 Cloud Example
8181

@@ -87,7 +87,7 @@ This server can be used with Claude Desktop, Cursor, GitHub Copilot MCP integrat
8787
"args": ["@chkp/quantum_management_mcp"],
8888
"env": {
8989
"API_KEY": "YOUR_API_KEY",
90-
"S1C_URL": "YOUR_S1C_URL" //https://xxxxxxxx.maas.checkpoint.com/yyyyyyy/web_api
90+
"S1C_URL": "YOUR_S1C_URL" // e.g., https://xxxxxxxx.maas.checkpoint.com/yyyyyyy/web_api
9191
}
9292
}
9393
}
@@ -103,7 +103,7 @@ This server can be used with Claude Desktop, Cursor, GitHub Copilot MCP integrat
103103
"command": "npx",
104104
"args": ["@chkp/quantum_management_mcp"],
105105
"env": {
106-
"MANAGEMENT_HOST": "YOUR_MANAGEMENT_IP_OR_HOST_NAME",
106+
"MANAGEMENT_HOST": "YOUR_MANAGEMENT_IP_OR_HOST_NAME",
107107
"MANAGEMENT_PORT": "443", // optional, default is 443
108108
"API_KEY": "YOUR_API_KEY", // or use USERNAME and PASSWORD
109109
"USERNAME": "YOUR_USERNAME", // optional
@@ -114,20 +114,27 @@ This server can be used with Claude Desktop, Cursor, GitHub Copilot MCP integrat
114114
}
115115
```
116116

117-
> Set only the environment variables required for your authentication method (see above for details).
117+
> Set only the environment variables required for your authentication method (see above).
118+
119+
### Configuring the Claude Desktop App
118120

119-
### Configuring the Claude Desktop app
120-
For macOS:
121-
### Create the config file if it doesn't exist
121+
#### For macOS:
122+
123+
```bash
124+
# Create the config file if it doesn't exist
122125
touch "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
123126

124-
### Opens the config file in TextEdit
127+
# Open the config file in TextEdit
125128
open -e "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
129+
```
126130

127-
### For Windows:
131+
#### For Windows:
132+
133+
```cmd
128134
code %APPDATA%\Claude\claude_desktop_config.json
135+
```
129136

130-
### Add the server configuration:
137+
Add the server configuration:
131138

132139
```json
133140
{
@@ -136,18 +143,21 @@ code %APPDATA%\Claude\claude_desktop_config.json
136143
"command": "npx",
137144
"args": ["@chkp/quantum_management_mcp"],
138145
"env": {
139-
Add the configuration from the above instructions
146+
// Add the configuration from the above instructions
140147
}
141148
}
142149
}
143150
}
144151
```
152+
153+
---
154+
145155
## Development
146156

147157
### Prerequisites
148158

149-
- Node.js 18+
150-
- npm 8+
159+
- Node.js 18+
160+
- npm 8+
151161

152162
### Setup
153163

@@ -165,17 +175,16 @@ npm run build
165175

166176
### Running Locally
167177

168-
You can run the server locally for development:
178+
Run the server locally for development using [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) or any MCP client.
169179

170180
```bash
171-
npm run start
172-
# or
173-
npx ts-node src/index.ts
181+
node FULL_PATH_TO_SERVER/packages/management/dist/index.js --s1c-url|--management-host --api-key|--username|--password
174182
```
175183

176184
---
185+
177186
## ⚠️ Security Notice
178187

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.
188+
1. **Authentication keys and credentials are never shared with the model.** They are used only by the MCP server to authenticate with your Check Point management system.
189+
2. **Only use client implementations you trust.** Malicious or untrusted clients could misuse your credentials or access data improperly.
190+
3. **Management data is exposed to the model.** Use models and providers that comply with your organizations policies on sensitive data and PII handling.

packages/infra/src/api-client.ts

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
import axios from 'axios';
33
import https from 'https';
44

5+
function getMainPackageUserAgent(): string {
6+
if (process.env.CP_MCP_MAIN_PKG) {
7+
return process.env.CP_MCP_MAIN_PKG;
8+
}
9+
return "Check Point MCP API Client/v1.0";
10+
}
11+
512
// Constants for API URLs
613
export const ON_PREM_CI_BASE_URL = "{}/{}/api/v2/environments/{}/web_api";
714

@@ -42,7 +49,8 @@ export abstract class APIClientBase {
4249
protected getHeaders(): Record<string, string> {
4350
return {
4451
"Content-Type": "application/json",
45-
"X-chkp-sid": this.sid || ""
52+
"X-chkp-sid": this.sid || "",
53+
"User-Agent": getMainPackageUserAgent(),
4654
};
4755
}
4856

@@ -266,54 +274,3 @@ export class OnPremAPIClient extends APIClientBase {
266274
return loginResp.response.sid;
267275
}
268276
}
269-
270-
/**
271-
* API client for Harmony SASE
272-
*/
273-
export class HarmonySaseAPIClient extends APIClientBase {
274-
constructor(
275-
apiKey: string,
276-
private readonly managementHost: string,
277-
private readonly origin: string
278-
) {
279-
super(apiKey);
280-
}
281-
282-
getHost(): string {
283-
return this.managementHost;
284-
}
285-
286-
/**
287-
* Override the login method for Harmony SASE
288-
*/
289-
override async loginWithApiKey(): Promise<string> {
290-
console.error("Logging in to Harmony SASE with API key");
291-
292-
const loginResp = await APIClientBase.makeRequest(
293-
this.getHost(),
294-
"POST",
295-
"v1/auth/authorize",
296-
{
297-
apiKey: this.apiKey,
298-
grantType: "api_key"
299-
},
300-
{
301-
"Content-Type": "application/json",
302-
"accept": "application/json"
303-
}
304-
);
305-
306-
return loginResp.response.data.accessToken;
307-
}
308-
309-
/**
310-
* Override the headers method for Harmony SASE
311-
*/
312-
protected override getHeaders(): Record<string, string> {
313-
return {
314-
"Content-Type": "application/json",
315-
"Authorization": `Bearer ${this.sid}`,
316-
"Origin": this.origin
317-
};
318-
}
319-
}

packages/infra/src/api-manager.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// API manager implementation for Check Point MCP servers
2-
import { APIClientBase, ClientResponse, SmartOneCloudAPIClient, OnPremAPIClient, HarmonySaseAPIClient } from './api-client.js';
2+
import { APIClientBase, SmartOneCloudAPIClient, OnPremAPIClient } from './api-client.js';
33

44
/**
55
* Base class for API managers
@@ -127,19 +127,3 @@ export class APIManagerForAPIKey extends APIManagerBase {
127127
}
128128
}
129129

130-
/**
131-
* API manager for Harmony SASE
132-
*/
133-
export class APIManagerForHarmonySASE extends APIManagerBase {
134-
static override create(args: {
135-
api_key: string;
136-
management_host: string;
137-
origin: string;
138-
}): APIManagerForHarmonySASE {
139-
return new this(HarmonySaseAPIClient.create(
140-
args.api_key,
141-
args.management_host,
142-
args.origin
143-
));
144-
}
145-
}

packages/infra/src/utils.ts

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,12 @@
11
// Utility functions for MCP servers
2-
import { APIManagerBase, APIManagerForAPIKey, APIManagerForHarmonySASE } from './api-manager.js';
2+
import { APIManagerBase, APIManagerForAPIKey } from './api-manager.js';
33
import { Settings } from './settings.js';
44

55
/**
6-
* Server types for API connections
6+
* Get an API manager according to the management settings
77
*/
8-
export enum ServerType {
9-
MANAGEMENT = 'management',
10-
HARMONY_SASE = 'harmony_sase'
11-
}
12-
13-
/**
14-
* Get an API manager for the specified server type
15-
*/
16-
export async function getApiManager(
17-
serverType: ServerType = ServerType.MANAGEMENT
18-
): Promise<APIManagerBase> {
8+
export async function getApiManager(): Promise<APIManagerBase> {
199
const settings = Settings.getSettings();
20-
if (serverType === ServerType.HARMONY_SASE) {
21-
// HarmonySASE requires an API key
22-
if (!settings.apiKey) {
23-
throw new Error('API key is required for Harmony SASE');
24-
}
25-
26-
return APIManagerForHarmonySASE.create({
27-
api_key: settings.apiKey,
28-
management_host: settings.managementHost!,
29-
origin: settings.origin!,
30-
});
31-
}
3210

3311
if (settings.s1cUrl) {
3412
console.error('Using S1C With API Key from settings');

packages/management/src/index.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
66
import { callManagementApi } from '@chkp/genai-mcp-server-infra';
77
import { Settings } from '@chkp/genai-mcp-server-infra';
88
import { Command } from 'commander';
9+
import { readFileSync } from 'fs';
10+
import { join, dirname } from 'path';
11+
import { fileURLToPath } from 'url';
912

13+
const pkg = JSON.parse(
14+
readFileSync(join(dirname(fileURLToPath(import.meta.url)), '../package.json'), 'utf-8')
15+
);
16+
17+
process.env.CP_MCP_MAIN_PKG = `${pkg.name} v${pkg.version}`;
1018

1119
const server = new McpServer({ name: 'Check Point Quantum Management' ,
1220
description:
@@ -1330,18 +1338,6 @@ server.tool(
13301338
}
13311339
);
13321340

1333-
server.tool(
1334-
"show_time_objects",
1335-
"Show all time objects",
1336-
{},
1337-
async () => {
1338-
const result = await callManagementApi("GET", "/web_api/show-times", {});
1339-
return {
1340-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
1341-
};
1342-
}
1343-
);
1344-
13451341
export { server };
13461342

13471343
// Access entrypoint
@@ -1372,7 +1368,3 @@ main().catch((error) => {
13721368
console.error('Fatal error in main():', error);
13731369
process.exit(1);
13741370
});
1375-
// }
1376-
// else {
1377-
// console.error('This module is not intended to be run directly. Please use the provided entrypoint.');
1378-
// }

0 commit comments

Comments
 (0)