eyalsec-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eyalsec_mcp-0.1.0/.gitignore +8 -0
- eyalsec_mcp-0.1.0/LICENSE +21 -0
- eyalsec_mcp-0.1.0/PKG-INFO +166 -0
- eyalsec_mcp-0.1.0/README.md +130 -0
- eyalsec_mcp-0.1.0/pyproject.toml +68 -0
- eyalsec_mcp-0.1.0/src/eyalsec_mcp/__init__.py +3 -0
- eyalsec_mcp-0.1.0/src/eyalsec_mcp/__main__.py +72 -0
- eyalsec_mcp-0.1.0/src/eyalsec_mcp/client.py +230 -0
- eyalsec_mcp-0.1.0/src/eyalsec_mcp/server.py +493 -0
- eyalsec_mcp-0.1.0/tests/__init__.py +0 -0
- eyalsec_mcp-0.1.0/tests/conftest.py +45 -0
- eyalsec_mcp-0.1.0/tests/test_client.py +136 -0
- eyalsec_mcp-0.1.0/tests/test_live.py +51 -0
- eyalsec_mcp-0.1.0/tests/test_server.py +288 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 EyalSec
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: eyalsec-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for reading your EyalSec security events, machines, runs and rules from an AI assistant.
|
|
5
|
+
Project-URL: Homepage, https://eyalsec.com
|
|
6
|
+
Project-URL: Documentation, https://eyalsec.com/docs/api
|
|
7
|
+
Project-URL: Source, https://github.com/EyalSec/eyalsec-mcp
|
|
8
|
+
Project-URL: Issues, https://github.com/EyalSec/eyalsec-mcp/issues
|
|
9
|
+
Project-URL: Pricing, https://eyalsec.com/pricing
|
|
10
|
+
Project-URL: Book a demo, https://eyalsec.com/contact
|
|
11
|
+
Author-email: EyalSec <support@eyalsec.com>
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: application security,claude,cursor,es-python,eyalsec,mcp,mcp server,model context protocol,security events,taint tracking
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: Information Technology
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Topic :: Security
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Requires-Dist: httpx>=0.27
|
|
30
|
+
Requires-Dist: mcp<3,>=2.3
|
|
31
|
+
Requires-Dist: pydantic>=2.7
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: anyio>=4; extra == 'test'
|
|
34
|
+
Requires-Dist: pytest>=8; extra == 'test'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# EyalSec MCP server
|
|
38
|
+
|
|
39
|
+
Ask your AI assistant about your EyalSec account in plain words: "what critical events came in since Monday?", "show me the full trace for event 90210", "which machines need an update?". This server gives Claude, Cursor and any other MCP client read access to your events, machines, runs and rules through the [EyalSec API](https://eyalsec.com/docs/api), so the assistant you already use for code review can also help you triage what EyalSec found.
|
|
40
|
+
|
|
41
|
+
<!-- mcp-name: io.github.EyalSec/eyalsec-mcp -->
|
|
42
|
+
|
|
43
|
+
EyalSec follows untrusted data (requests, files, environment variables and more) through your running program and reports when it reaches a risky operation: a SQL query, a shell command, deserialization, a file path. Each event names the operation, the line of code, the value it received and where the untrusted part came from. This server reads those events; it never changes anything on your account.
|
|
44
|
+
|
|
45
|
+
## What you need
|
|
46
|
+
|
|
47
|
+
- An EyalSec account and an API key. Create the key on your dashboard under **Settings > API access**. A **read-only key** is all this server needs, and it is the one we recommend: see [API keys](https://eyalsec.com/docs/api-keys).
|
|
48
|
+
- Python 3.10 or newer, or [`uv`](https://docs.astral.sh/uv/), which runs the server without a separate install.
|
|
49
|
+
|
|
50
|
+
No account yet? [Book a live demo](https://eyalsec.com/contact) and we will set one up with you. Pricing is at [eyalsec.com/pricing](https://eyalsec.com/pricing).
|
|
51
|
+
|
|
52
|
+
## Set it up
|
|
53
|
+
|
|
54
|
+
The server speaks MCP over stdio. Your client starts it with `uvx eyalsec-mcp` (or `eyalsec-mcp` after `pipx install eyalsec-mcp`) and passes the key in the environment.
|
|
55
|
+
|
|
56
|
+
### Claude Code
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
claude mcp add eyalsec -e EYALSEC_API_KEY=es2_your_read_only_key -- uvx eyalsec-mcp
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Claude Desktop
|
|
63
|
+
|
|
64
|
+
Add this to `claude_desktop_config.json` (Settings > Developer > Edit Config), then restart Claude Desktop:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"mcpServers": {
|
|
69
|
+
"eyalsec": {
|
|
70
|
+
"command": "uvx",
|
|
71
|
+
"args": ["eyalsec-mcp"],
|
|
72
|
+
"env": {
|
|
73
|
+
"EYALSEC_API_KEY": "es2_your_read_only_key"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Cursor
|
|
81
|
+
|
|
82
|
+
Add the same block to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project):
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"eyalsec": {
|
|
88
|
+
"command": "uvx",
|
|
89
|
+
"args": ["eyalsec-mcp"],
|
|
90
|
+
"env": {
|
|
91
|
+
"EYALSEC_API_KEY": "es2_your_read_only_key"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Any other MCP client
|
|
99
|
+
|
|
100
|
+
Run `uvx eyalsec-mcp` as a stdio server with `EYALSEC_API_KEY` set. To check the key before wiring it into a client:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
EYALSEC_API_KEY=es2_your_read_only_key uvx eyalsec-mcp --check
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
It calls the API once and prints the account it reached, the key's scope and the number of machines.
|
|
107
|
+
|
|
108
|
+
### Settings
|
|
109
|
+
|
|
110
|
+
| Variable | Required | Meaning |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| `EYALSEC_API_KEY` | yes | Your API key, from **Settings > API access**. Read-only is enough. |
|
|
113
|
+
| `EYALSEC_URL` | no | Your EyalSec address. Defaults to `https://eyalsec.com`; set it only if your account lives on another domain. Must be `https://`. |
|
|
114
|
+
|
|
115
|
+
## What it can do
|
|
116
|
+
|
|
117
|
+
Every tool is a read. The server has no code path that adds, changes or deletes anything, so even a full-access key cannot be used to write through it.
|
|
118
|
+
|
|
119
|
+
| Tool | What it answers |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `search_events` | Your events, newest or most severe first, with the events page's filters: product, severity, dates, machine, taint source, impact class, label, sink pattern, run, and the advanced condition builder. Follows the API's paging for you. |
|
|
122
|
+
| `get_event` | One event in full: stack trace, where the data came in, where the value was created, nearby source code when the machine sends it, your note, and the runs that produced it. |
|
|
123
|
+
| `event_stats` | The dashboard summary: totals, the last hour, day and week, top event types and a 14-day timeline. |
|
|
124
|
+
| `event_counts` | How many events each product's list holds, live versus suppressed, and the count toward your monthly quota. |
|
|
125
|
+
| `list_event_names` | The distinct sink labels across your events, handy for building a filter. |
|
|
126
|
+
| `event_map` | The es-python events as a graph: sources, the files data was read from, and the operations it reached. |
|
|
127
|
+
| `list_runs` | The program invocations behind your events, with their command lines (secrets masked). |
|
|
128
|
+
| `ci_findings` | What runs on one machine reported since a moment, counted by severity, with which findings are new. |
|
|
129
|
+
| `list_machines` | Every machine: status, OS target, product, installed and newest build, and whether an update is waiting. |
|
|
130
|
+
| `supported_targets` | The Linux distributions, architectures and Python versions es-python installs on. |
|
|
131
|
+
| `list_rules`, `list_filters`, `get_taint_settings`, `get_event_uniqueness`, `list_rule_templates` | How your account and each machine are configured. |
|
|
132
|
+
| `list_labels`, `list_saved_searches` | Your triage labels and saved searches. |
|
|
133
|
+
| `get_account`, `list_activity` | Your profile and limits, your key's scope and expiry (never the key), setup progress, and the activity log. |
|
|
134
|
+
|
|
135
|
+
Some things to try:
|
|
136
|
+
|
|
137
|
+
- "Summarize this week's critical and high events by machine."
|
|
138
|
+
- "Open the newest SQL injection event and explain the path from the request to the query."
|
|
139
|
+
- "Which runs of `app.py` produced command-injection events yesterday?"
|
|
140
|
+
- "Do any machines have an update waiting or an install stuck in pending?"
|
|
141
|
+
|
|
142
|
+
## Safety notes
|
|
143
|
+
|
|
144
|
+
- **Events contain untrusted text.** A value that reached a sink, a stack trace or a command line came from a monitored program and its inputs, which can include text an attacker wrote. The server tells the assistant to treat it as data, not instructions; keep human review on anything the assistant proposes to do with it.
|
|
145
|
+
- **Use a read-only key.** It can read everything this server reads and nothing more. A key can also carry an expiry date.
|
|
146
|
+
- **The key stays with you.** It is read from the environment, sent only to your EyalSec address over HTTPS, and never returned by any tool. Plain HTTP is refused except to `localhost`.
|
|
147
|
+
- The API's [rate limits](https://eyalsec.com/docs/api#rate-limits) apply. `search_events` reads at most 10 pages per call and hands back a cursor for the rest.
|
|
148
|
+
|
|
149
|
+
## Development
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
git clone https://github.com/EyalSec/eyalsec-mcp && cd eyalsec-mcp
|
|
153
|
+
python -m venv .venv && . .venv/bin/activate
|
|
154
|
+
pip install -e '.[test]'
|
|
155
|
+
pytest
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The tests run against a fake API. To also run one read-only pass against your own account, set `EYALSEC_LIVE=1` and `EYALSEC_API_KEY`.
|
|
159
|
+
|
|
160
|
+
## Help
|
|
161
|
+
|
|
162
|
+
Questions and bug reports are welcome in [issues](https://github.com/EyalSec/eyalsec-mcp/issues), or write to support@eyalsec.com. Please send security reports to security@eyalsec.com rather than a public issue.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
MIT. See [LICENSE](LICENSE). The license covers this MCP server; your EyalSec account is governed by the [EyalSec terms](https://eyalsec.com/legal/terms).
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# EyalSec MCP server
|
|
2
|
+
|
|
3
|
+
Ask your AI assistant about your EyalSec account in plain words: "what critical events came in since Monday?", "show me the full trace for event 90210", "which machines need an update?". This server gives Claude, Cursor and any other MCP client read access to your events, machines, runs and rules through the [EyalSec API](https://eyalsec.com/docs/api), so the assistant you already use for code review can also help you triage what EyalSec found.
|
|
4
|
+
|
|
5
|
+
<!-- mcp-name: io.github.EyalSec/eyalsec-mcp -->
|
|
6
|
+
|
|
7
|
+
EyalSec follows untrusted data (requests, files, environment variables and more) through your running program and reports when it reaches a risky operation: a SQL query, a shell command, deserialization, a file path. Each event names the operation, the line of code, the value it received and where the untrusted part came from. This server reads those events; it never changes anything on your account.
|
|
8
|
+
|
|
9
|
+
## What you need
|
|
10
|
+
|
|
11
|
+
- An EyalSec account and an API key. Create the key on your dashboard under **Settings > API access**. A **read-only key** is all this server needs, and it is the one we recommend: see [API keys](https://eyalsec.com/docs/api-keys).
|
|
12
|
+
- Python 3.10 or newer, or [`uv`](https://docs.astral.sh/uv/), which runs the server without a separate install.
|
|
13
|
+
|
|
14
|
+
No account yet? [Book a live demo](https://eyalsec.com/contact) and we will set one up with you. Pricing is at [eyalsec.com/pricing](https://eyalsec.com/pricing).
|
|
15
|
+
|
|
16
|
+
## Set it up
|
|
17
|
+
|
|
18
|
+
The server speaks MCP over stdio. Your client starts it with `uvx eyalsec-mcp` (or `eyalsec-mcp` after `pipx install eyalsec-mcp`) and passes the key in the environment.
|
|
19
|
+
|
|
20
|
+
### Claude Code
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
claude mcp add eyalsec -e EYALSEC_API_KEY=es2_your_read_only_key -- uvx eyalsec-mcp
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Claude Desktop
|
|
27
|
+
|
|
28
|
+
Add this to `claude_desktop_config.json` (Settings > Developer > Edit Config), then restart Claude Desktop:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"eyalsec": {
|
|
34
|
+
"command": "uvx",
|
|
35
|
+
"args": ["eyalsec-mcp"],
|
|
36
|
+
"env": {
|
|
37
|
+
"EYALSEC_API_KEY": "es2_your_read_only_key"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Cursor
|
|
45
|
+
|
|
46
|
+
Add the same block to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project):
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"eyalsec": {
|
|
52
|
+
"command": "uvx",
|
|
53
|
+
"args": ["eyalsec-mcp"],
|
|
54
|
+
"env": {
|
|
55
|
+
"EYALSEC_API_KEY": "es2_your_read_only_key"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Any other MCP client
|
|
63
|
+
|
|
64
|
+
Run `uvx eyalsec-mcp` as a stdio server with `EYALSEC_API_KEY` set. To check the key before wiring it into a client:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
EYALSEC_API_KEY=es2_your_read_only_key uvx eyalsec-mcp --check
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
It calls the API once and prints the account it reached, the key's scope and the number of machines.
|
|
71
|
+
|
|
72
|
+
### Settings
|
|
73
|
+
|
|
74
|
+
| Variable | Required | Meaning |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `EYALSEC_API_KEY` | yes | Your API key, from **Settings > API access**. Read-only is enough. |
|
|
77
|
+
| `EYALSEC_URL` | no | Your EyalSec address. Defaults to `https://eyalsec.com`; set it only if your account lives on another domain. Must be `https://`. |
|
|
78
|
+
|
|
79
|
+
## What it can do
|
|
80
|
+
|
|
81
|
+
Every tool is a read. The server has no code path that adds, changes or deletes anything, so even a full-access key cannot be used to write through it.
|
|
82
|
+
|
|
83
|
+
| Tool | What it answers |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `search_events` | Your events, newest or most severe first, with the events page's filters: product, severity, dates, machine, taint source, impact class, label, sink pattern, run, and the advanced condition builder. Follows the API's paging for you. |
|
|
86
|
+
| `get_event` | One event in full: stack trace, where the data came in, where the value was created, nearby source code when the machine sends it, your note, and the runs that produced it. |
|
|
87
|
+
| `event_stats` | The dashboard summary: totals, the last hour, day and week, top event types and a 14-day timeline. |
|
|
88
|
+
| `event_counts` | How many events each product's list holds, live versus suppressed, and the count toward your monthly quota. |
|
|
89
|
+
| `list_event_names` | The distinct sink labels across your events, handy for building a filter. |
|
|
90
|
+
| `event_map` | The es-python events as a graph: sources, the files data was read from, and the operations it reached. |
|
|
91
|
+
| `list_runs` | The program invocations behind your events, with their command lines (secrets masked). |
|
|
92
|
+
| `ci_findings` | What runs on one machine reported since a moment, counted by severity, with which findings are new. |
|
|
93
|
+
| `list_machines` | Every machine: status, OS target, product, installed and newest build, and whether an update is waiting. |
|
|
94
|
+
| `supported_targets` | The Linux distributions, architectures and Python versions es-python installs on. |
|
|
95
|
+
| `list_rules`, `list_filters`, `get_taint_settings`, `get_event_uniqueness`, `list_rule_templates` | How your account and each machine are configured. |
|
|
96
|
+
| `list_labels`, `list_saved_searches` | Your triage labels and saved searches. |
|
|
97
|
+
| `get_account`, `list_activity` | Your profile and limits, your key's scope and expiry (never the key), setup progress, and the activity log. |
|
|
98
|
+
|
|
99
|
+
Some things to try:
|
|
100
|
+
|
|
101
|
+
- "Summarize this week's critical and high events by machine."
|
|
102
|
+
- "Open the newest SQL injection event and explain the path from the request to the query."
|
|
103
|
+
- "Which runs of `app.py` produced command-injection events yesterday?"
|
|
104
|
+
- "Do any machines have an update waiting or an install stuck in pending?"
|
|
105
|
+
|
|
106
|
+
## Safety notes
|
|
107
|
+
|
|
108
|
+
- **Events contain untrusted text.** A value that reached a sink, a stack trace or a command line came from a monitored program and its inputs, which can include text an attacker wrote. The server tells the assistant to treat it as data, not instructions; keep human review on anything the assistant proposes to do with it.
|
|
109
|
+
- **Use a read-only key.** It can read everything this server reads and nothing more. A key can also carry an expiry date.
|
|
110
|
+
- **The key stays with you.** It is read from the environment, sent only to your EyalSec address over HTTPS, and never returned by any tool. Plain HTTP is refused except to `localhost`.
|
|
111
|
+
- The API's [rate limits](https://eyalsec.com/docs/api#rate-limits) apply. `search_events` reads at most 10 pages per call and hands back a cursor for the rest.
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git clone https://github.com/EyalSec/eyalsec-mcp && cd eyalsec-mcp
|
|
117
|
+
python -m venv .venv && . .venv/bin/activate
|
|
118
|
+
pip install -e '.[test]'
|
|
119
|
+
pytest
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The tests run against a fake API. To also run one read-only pass against your own account, set `EYALSEC_LIVE=1` and `EYALSEC_API_KEY`.
|
|
123
|
+
|
|
124
|
+
## Help
|
|
125
|
+
|
|
126
|
+
Questions and bug reports are welcome in [issues](https://github.com/EyalSec/eyalsec-mcp/issues), or write to support@eyalsec.com. Please send security reports to security@eyalsec.com rather than a public issue.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT. See [LICENSE](LICENSE). The license covers this MCP server; your EyalSec account is governed by the [EyalSec terms](https://eyalsec.com/legal/terms).
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "eyalsec-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server for reading your EyalSec security events, machines, runs and rules from an AI assistant."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
authors = [{ name = "EyalSec", email = "support@eyalsec.com" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"mcp", "model context protocol", "mcp server", "eyalsec", "es-python",
|
|
16
|
+
"application security", "security events", "taint tracking", "claude", "cursor",
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 4 - Beta",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Intended Audience :: Information Technology",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Programming Language :: Python :: 3.14",
|
|
31
|
+
"Topic :: Security",
|
|
32
|
+
]
|
|
33
|
+
dependencies = [
|
|
34
|
+
"mcp>=2.3,<3",
|
|
35
|
+
"httpx>=0.27",
|
|
36
|
+
"pydantic>=2.7",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
test = ["pytest>=8", "anyio>=4"]
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
eyalsec-mcp = "eyalsec_mcp.__main__:main"
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://eyalsec.com"
|
|
47
|
+
Documentation = "https://eyalsec.com/docs/api"
|
|
48
|
+
Source = "https://github.com/EyalSec/eyalsec-mcp"
|
|
49
|
+
Issues = "https://github.com/EyalSec/eyalsec-mcp/issues"
|
|
50
|
+
Pricing = "https://eyalsec.com/pricing"
|
|
51
|
+
"Book a demo" = "https://eyalsec.com/contact"
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build.targets.wheel]
|
|
54
|
+
packages = ["src/eyalsec_mcp"]
|
|
55
|
+
|
|
56
|
+
[tool.hatch.build.targets.sdist]
|
|
57
|
+
only-include = ["src/eyalsec_mcp", "tests", "README.md", "LICENSE", "pyproject.toml"]
|
|
58
|
+
|
|
59
|
+
[tool.pytest.ini_options]
|
|
60
|
+
testpaths = ["tests"]
|
|
61
|
+
pythonpath = ["src"]
|
|
62
|
+
|
|
63
|
+
[tool.ruff]
|
|
64
|
+
line-length = 120
|
|
65
|
+
target-version = "py310"
|
|
66
|
+
|
|
67
|
+
[tool.ruff.lint]
|
|
68
|
+
select = ["E", "F", "W", "I", "B", "UP"]
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Command line entry point: `eyalsec-mcp` runs the server on stdio."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import asyncio
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
from . import __version__
|
|
10
|
+
from .client import API_KEY_ENV, URL_ENV, APIError, ConfigError, EyalSecClient
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
async def _check() -> int:
|
|
14
|
+
"""Call the API once with the configured key and say what it found.
|
|
15
|
+
Everything goes to stderr: on stdio, stdout belongs to the MCP protocol."""
|
|
16
|
+
try:
|
|
17
|
+
api = EyalSecClient()
|
|
18
|
+
except ConfigError as exc:
|
|
19
|
+
print(f"eyalsec-mcp: {exc}", file=sys.stderr)
|
|
20
|
+
return 2
|
|
21
|
+
try:
|
|
22
|
+
profile = await api.get("/api/account/")
|
|
23
|
+
key = await api.get("/api/account/apikey")
|
|
24
|
+
machines = await api.get("/api/get_all_machines/")
|
|
25
|
+
except (APIError, ConfigError) as exc:
|
|
26
|
+
print(f"eyalsec-mcp: {exc}", file=sys.stderr)
|
|
27
|
+
return 1
|
|
28
|
+
finally:
|
|
29
|
+
await api.aclose()
|
|
30
|
+
print(
|
|
31
|
+
f"eyalsec-mcp {__version__}: connected to {api.base_url} as {profile.get('username', '?')}; "
|
|
32
|
+
f"key scope {key.get('scope', '?')}; {len(machines.get('machines') or [])} machine(s).",
|
|
33
|
+
file=sys.stderr,
|
|
34
|
+
)
|
|
35
|
+
if key.get("scope") == "full":
|
|
36
|
+
print(
|
|
37
|
+
"eyalsec-mcp: this server only reads, so a read-only key is enough. "
|
|
38
|
+
"Consider generating one on Settings > API access.",
|
|
39
|
+
file=sys.stderr,
|
|
40
|
+
)
|
|
41
|
+
return 0
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def main(argv: list[str] | None = None) -> None:
|
|
45
|
+
parser = argparse.ArgumentParser(
|
|
46
|
+
prog="eyalsec-mcp",
|
|
47
|
+
description="MCP server (stdio) for reading your EyalSec account: events, machines, runs and rules.",
|
|
48
|
+
epilog=f"Configuration: {API_KEY_ENV} (required, an API key from Settings > API access; "
|
|
49
|
+
f"a read-only key is enough) and {URL_ENV} (optional, default https://eyalsec.com).",
|
|
50
|
+
)
|
|
51
|
+
parser.add_argument("--version", action="version", version=f"eyalsec-mcp {__version__}")
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
"--check",
|
|
54
|
+
action="store_true",
|
|
55
|
+
help="call the API once with the configured key, report the result and exit",
|
|
56
|
+
)
|
|
57
|
+
args = parser.parse_args(argv)
|
|
58
|
+
if args.check:
|
|
59
|
+
sys.exit(asyncio.run(_check()))
|
|
60
|
+
|
|
61
|
+
from .server import create_server
|
|
62
|
+
|
|
63
|
+
try:
|
|
64
|
+
server = create_server()
|
|
65
|
+
except ConfigError as exc:
|
|
66
|
+
print(f"eyalsec-mcp: {exc}", file=sys.stderr)
|
|
67
|
+
sys.exit(2)
|
|
68
|
+
server.run("stdio")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
main()
|