mcp-cyberbro 0.0.1__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.
- mcp_cyberbro-0.0.1/.bandit.yml +17 -0
- mcp_cyberbro-0.0.1/.env.example +24 -0
- mcp_cyberbro-0.0.1/.gitignore +25 -0
- mcp_cyberbro-0.0.1/.pre-commit-config.yaml +30 -0
- mcp_cyberbro-0.0.1/.ruff.toml +37 -0
- mcp_cyberbro-0.0.1/CODE_OF_CONDUCT.md +41 -0
- mcp_cyberbro-0.0.1/CONTRIBUTING.md +42 -0
- mcp_cyberbro-0.0.1/Dockerfile +11 -0
- mcp_cyberbro-0.0.1/LICENSE +21 -0
- mcp_cyberbro-0.0.1/PKG-INFO +211 -0
- mcp_cyberbro-0.0.1/README.md +182 -0
- mcp_cyberbro-0.0.1/SECURITY.md +7 -0
- mcp_cyberbro-0.0.1/pyproject.toml +74 -0
- mcp_cyberbro-0.0.1/requirements-dev.txt +1 -0
- mcp_cyberbro-0.0.1/requirements.txt +2 -0
- mcp_cyberbro-0.0.1/server.json +77 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/__init__.py +4 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/__main__.py +4 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/cli.py +80 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/server.py +34 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/tools/__init__.py +1 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/tools/analysis.py +62 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/tools/engines.py +180 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/tools/web.py +20 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/utils/__init__.py +1 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/utils/config.py +61 -0
- mcp_cyberbro-0.0.1/src/mcp_cyberbro/utils/http.py +17 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# .bandit.yml
|
|
2
|
+
# Bandit configuration file
|
|
3
|
+
|
|
4
|
+
# List of tests to skip
|
|
5
|
+
skips:
|
|
6
|
+
- B101 # assert_used
|
|
7
|
+
- B113 # request_without_timeout
|
|
8
|
+
|
|
9
|
+
# Exclude directories
|
|
10
|
+
exclude_dirs:
|
|
11
|
+
- tests
|
|
12
|
+
- docs
|
|
13
|
+
- migrations
|
|
14
|
+
|
|
15
|
+
# Include only specific file extensions
|
|
16
|
+
include:
|
|
17
|
+
- .py
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Required: URL of your Cyberbro instance
|
|
2
|
+
CYBERBRO_URL=http://localhost:5000
|
|
3
|
+
|
|
4
|
+
# Optional: Cyberbro API prefix
|
|
5
|
+
API_PREFIX=api
|
|
6
|
+
|
|
7
|
+
# Optional: SSL verification for Cyberbro backend calls
|
|
8
|
+
# true|false
|
|
9
|
+
SSL_VERIFY=true
|
|
10
|
+
|
|
11
|
+
# MCP transport for local runs
|
|
12
|
+
# stdio|sse|streamable-http
|
|
13
|
+
MCP_TRANSPORT=stdio
|
|
14
|
+
|
|
15
|
+
# Host and port used with HTTP transports (sse/streamable-http)
|
|
16
|
+
MCP_HOST=0.0.0.0
|
|
17
|
+
MCP_PORT=8000
|
|
18
|
+
|
|
19
|
+
# Optional SSE settings
|
|
20
|
+
MCP_MOUNT_PATH=/
|
|
21
|
+
MCP_SSE_PATH=/sse
|
|
22
|
+
|
|
23
|
+
# Optional Streamable HTTP endpoint path
|
|
24
|
+
MCP_STREAMABLE_HTTP_PATH=/mcp
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Ignore .bak
|
|
2
|
+
*.bak
|
|
3
|
+
|
|
4
|
+
__pycache__/
|
|
5
|
+
.dccache
|
|
6
|
+
.pytest_cache/
|
|
7
|
+
.qodo
|
|
8
|
+
.ruff_cache
|
|
9
|
+
.venv
|
|
10
|
+
*.csv
|
|
11
|
+
*.db
|
|
12
|
+
*.xlsx
|
|
13
|
+
data/
|
|
14
|
+
log*/
|
|
15
|
+
secrets.json
|
|
16
|
+
uv.lock
|
|
17
|
+
.env
|
|
18
|
+
.env.test
|
|
19
|
+
.mcp.json
|
|
20
|
+
.mcpregistry_*
|
|
21
|
+
*.pyc
|
|
22
|
+
*.egg-info/
|
|
23
|
+
dist/
|
|
24
|
+
build/
|
|
25
|
+
.eggs/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
exclude: "^.*/(tests/)"
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v6.0.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: trailing-whitespace
|
|
7
|
+
types_or: [python, pyi]
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
types_or: [python, pyi]
|
|
10
|
+
- id: check-yaml
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
13
|
+
rev: v0.15.5
|
|
14
|
+
hooks:
|
|
15
|
+
- id: ruff
|
|
16
|
+
types_or: [python, pyi]
|
|
17
|
+
args: [--fix, --config=.ruff.toml]
|
|
18
|
+
# Run the linter.
|
|
19
|
+
- id: ruff-format
|
|
20
|
+
types_or: [python, pyi]
|
|
21
|
+
args: [--config=.ruff.toml]
|
|
22
|
+
|
|
23
|
+
# Bandit SAST
|
|
24
|
+
# https://bandit.readthedocs.io/en/latest/index.html
|
|
25
|
+
- repo: https://github.com/PyCQA/bandit
|
|
26
|
+
rev: "1.9.4"
|
|
27
|
+
hooks:
|
|
28
|
+
- id: bandit
|
|
29
|
+
types_or: [python, pyi]
|
|
30
|
+
args: ["-c", ".bandit.yml"]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
line-length = 100
|
|
2
|
+
indent-width = 4
|
|
3
|
+
|
|
4
|
+
[lint]
|
|
5
|
+
exclude = ["tests/**", "__pycache__/**"]
|
|
6
|
+
select = [
|
|
7
|
+
"E", # Pycodestyle errors
|
|
8
|
+
"F", # Pyflakes
|
|
9
|
+
"W", # Pywicked
|
|
10
|
+
"B", # Flake8-bugbear
|
|
11
|
+
"C4", # Flake8-comprehensions
|
|
12
|
+
"I", # Isort
|
|
13
|
+
"N", # PEP8-Naming
|
|
14
|
+
"PGH", # Flake8-pygments
|
|
15
|
+
"PTH", # Flake8-pytest-helper
|
|
16
|
+
"RET", # Flake8-return
|
|
17
|
+
"RUF", # Ruff-specific rules
|
|
18
|
+
"SIM", # Flake8-simplify
|
|
19
|
+
"UP", # Flake8-pyupgrade
|
|
20
|
+
"YTT", # Flake8-2020
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
ignore = [
|
|
24
|
+
"E501", # line-too-long (many static descriptions/URLs are intentionally long)
|
|
25
|
+
"RET501", # unnecessary-return-none (RET501)
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[format]
|
|
29
|
+
# Like Black, use double quotes for strings.
|
|
30
|
+
quote-style = "double"
|
|
31
|
+
|
|
32
|
+
# Ensure that all files use the same line endings.
|
|
33
|
+
# This is important for cross-platform compatibility.
|
|
34
|
+
line-ending = "lf"
|
|
35
|
+
|
|
36
|
+
# Like Black, indent with spaces, rather than tabs.
|
|
37
|
+
indent-style = "space"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Contributor Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We, as members, contributors, and maintainers of this project, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to a positive environment include:
|
|
10
|
+
- Using welcoming and inclusive language.
|
|
11
|
+
- Being respectful of differing viewpoints and experiences.
|
|
12
|
+
- Gracefully accepting constructive criticism.
|
|
13
|
+
- Focusing on what is best for the community.
|
|
14
|
+
- Showing empathy toward other community members.
|
|
15
|
+
|
|
16
|
+
Examples of unacceptable behavior include:
|
|
17
|
+
- The use of sexualized language or imagery and unwelcome sexual attention.
|
|
18
|
+
- Trolling, insulting, or derogatory comments, and personal or political attacks.
|
|
19
|
+
- Public or private harassment.
|
|
20
|
+
- Publishing others’ private information without explicit permission.
|
|
21
|
+
- Other conduct that could reasonably be considered inappropriate in a professional setting.
|
|
22
|
+
|
|
23
|
+
## Our Responsibilities
|
|
24
|
+
|
|
25
|
+
Project maintainers are responsible for clarifying standards of acceptable behavior and taking appropriate corrective action in response to any unacceptable behavior.
|
|
26
|
+
|
|
27
|
+
## Scope
|
|
28
|
+
|
|
29
|
+
This Code of Conduct applies within project spaces and public spaces where an individual is representing the project or its community.
|
|
30
|
+
|
|
31
|
+
## Enforcement
|
|
32
|
+
|
|
33
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the maintainer at **kbr81a5yuvz at protonmail.com**. All complaints will be reviewed and investigated, and appropriate action will be taken to maintain a safe and welcoming environment.
|
|
34
|
+
|
|
35
|
+
## Attribution
|
|
36
|
+
|
|
37
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
**Maintainer**: [stanfrbd](https://github.com/stanfrbd)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Contributing to Cyberbro MCP
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to Cyberbro MCP! This guide will help you get started.
|
|
4
|
+
|
|
5
|
+
## How to Contribute
|
|
6
|
+
|
|
7
|
+
### 1. Reporting Issues
|
|
8
|
+
- Check if the issue is already reported.
|
|
9
|
+
- Open a [GitHub Issue](https://github.com/stanfrbd/mcp-cyberbro/issues) with a clear description and steps to reproduce the problem.
|
|
10
|
+
|
|
11
|
+
### 2. Feature Requests
|
|
12
|
+
- Open a [GitHub Issue](https://github.com/stanfrbd/mcp-cyberbro/issues) with the "enhancement" label.
|
|
13
|
+
- Describe the feature, its benefits, and how it aligns with the project goals.
|
|
14
|
+
|
|
15
|
+
### 3. Submitting Code
|
|
16
|
+
- Fork the repository and create a feature branch (`git checkout -b feature/my-feature`).
|
|
17
|
+
- Write clear, concise code that adheres to the project's style.
|
|
18
|
+
- Ensure all tests pass before submitting.
|
|
19
|
+
- Submit a pull request to the `main` branch and describe your changes.
|
|
20
|
+
|
|
21
|
+
### 4. Writing Documentation
|
|
22
|
+
- Improve existing documentation or write new content for new features.
|
|
23
|
+
- Ensure documentation is clear, concise, and easy to follow.
|
|
24
|
+
|
|
25
|
+
### 5. Testing
|
|
26
|
+
- Add tests for your changes to ensure quality and stability.
|
|
27
|
+
- Use sample observables to validate the functionality.
|
|
28
|
+
|
|
29
|
+
## Development Guidelines
|
|
30
|
+
- Use Python 3.11 or later.
|
|
31
|
+
- Follow snake_case coding style
|
|
32
|
+
- Keep dependencies minimal and document any new ones in `requirements.txt`.
|
|
33
|
+
|
|
34
|
+
## Community Guidelines
|
|
35
|
+
- Be respectful and constructive in discussions.
|
|
36
|
+
- Avoid unrelated self-promotion.
|
|
37
|
+
- Strive to make Cyberbro MCP better for all users.
|
|
38
|
+
|
|
39
|
+
We appreciate your contributions and efforts to improve Cyberbro MCP. Together, we can make this tool even more powerful!
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
**Maintainer**: [stanfrbd](https://github.com/stanfrbd)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 stanfrbd
|
|
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
|
|
13
|
+
in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
16
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
18
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
+
DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-cyberbro
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Model Context Protocol server for Cyberbro IOC analysis and enrichment
|
|
5
|
+
Project-URL: Homepage, https://github.com/stanfrbd/mcp-cyberbro
|
|
6
|
+
Project-URL: Repository, https://github.com/stanfrbd/mcp-cyberbro
|
|
7
|
+
Project-URL: Issues, https://github.com/stanfrbd/mcp-cyberbro/issues
|
|
8
|
+
Author: stanfrbd
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cyberbro,ioc,mcp,model-context-protocol,osint,threat-intelligence
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: httpx>=0.27.0
|
|
20
|
+
Requires-Dist: mcp[cli]>=1.0.0
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: bandit>=1.9.4; extra == 'dev'
|
|
23
|
+
Requires-Dist: pre-commit>=4.3.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-mock>=3.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.15.5; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
[](https://mseep.ai/app/stanfrbd-mcp-cyberbro)
|
|
31
|
+
|
|
32
|
+
<h1 align="center">Cyberbro MCP Server</h1>
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<img src="https://github.com/user-attachments/assets/5e5a4406-99c1-47f1-a726-de176baa824c" width="90" /><br />
|
|
36
|
+
<b><i>Extract IoCs from messy text and analyze them with Cyberbro.</i></b>
|
|
37
|
+
<br />
|
|
38
|
+
<b>🌐 <a href="https://demo.cyberbro.net/">demo.cyberbro.net</a></b><br />
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
Model Context Protocol server for Cyberbro.
|
|
44
|
+
|
|
45
|
+
This project is packaged as a standard Python distribution and can be launched with:
|
|
46
|
+
|
|
47
|
+
- `uvx mcp-cyberbro`
|
|
48
|
+
- `pip install mcp-cyberbro` then `mcp-cyberbro`
|
|
49
|
+
|
|
50
|
+
## Why this server
|
|
51
|
+
|
|
52
|
+
- Analyze observables (IP, domain, URL, hash, etc.) via Cyberbro engines.
|
|
53
|
+
- Integrate threat-analysis actions directly in MCP-capable assistants.
|
|
54
|
+
- Run with `stdio`, `sse`, or `streamable-http` transports.
|
|
55
|
+
- Compatible with any MCP client that supports one of these transports.
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
### Use with `uvx` (standalone)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uvx mcp-cyberbro --cyberbro_url http://localhost:5000
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Use with `pip`
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install mcp-cyberbro
|
|
69
|
+
mcp-cyberbro --cyberbro_url http://localhost:5000
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Local development
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install -e .
|
|
76
|
+
mcp-cyberbro --cyberbro_url http://localhost:5000
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Docker
|
|
80
|
+
|
|
81
|
+
Default container command starts in `streamable-http` mode on port `8000`.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
docker run --rm -p 8000:8000 \
|
|
85
|
+
-e CYBERBRO_URL=http://host.docker.internal:5000 \
|
|
86
|
+
ghcr.io/stanfrbd/mcp-cyberbro:latest
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
To force `stdio` transport:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
docker run -i --rm \
|
|
93
|
+
-e CYBERBRO_URL=http://host.docker.internal:5000 \
|
|
94
|
+
ghcr.io/stanfrbd/mcp-cyberbro:latest \
|
|
95
|
+
--transport stdio
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
Copy `.env.example` and set at least:
|
|
101
|
+
|
|
102
|
+
- `CYBERBRO_URL` (required)
|
|
103
|
+
|
|
104
|
+
Supported environment variables:
|
|
105
|
+
|
|
106
|
+
- `CYBERBRO_URL`
|
|
107
|
+
- `API_PREFIX` (default: `api`)
|
|
108
|
+
- `SSL_VERIFY` (`true`/`false`)
|
|
109
|
+
- `MCP_TRANSPORT` (`stdio`, `sse`, `streamable-http`)
|
|
110
|
+
- `MCP_HOST`
|
|
111
|
+
- `MCP_PORT`
|
|
112
|
+
- `MCP_MOUNT_PATH`
|
|
113
|
+
- `MCP_SSE_PATH`
|
|
114
|
+
- `MCP_STREAMABLE_HTTP_PATH`
|
|
115
|
+
|
|
116
|
+
CLI flags are also available and override env values.
|
|
117
|
+
|
|
118
|
+
## MCP Client Integration
|
|
119
|
+
|
|
120
|
+
You can use this server with Claude Desktop, Claude Code, Cursor, OpenAI-compatible MCP clients, or any other MCP client.
|
|
121
|
+
|
|
122
|
+
Example config using `uvx`:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"mcpServers": {
|
|
127
|
+
"cyberbro": {
|
|
128
|
+
"command": "uvx",
|
|
129
|
+
"args": ["mcp-cyberbro"],
|
|
130
|
+
"env": {
|
|
131
|
+
"CYBERBRO_URL": "http://localhost:5000",
|
|
132
|
+
"API_PREFIX": "api"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Example with Docker + `stdio`:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"mcpServers": {
|
|
144
|
+
"cyberbro": {
|
|
145
|
+
"command": "docker",
|
|
146
|
+
"args": [
|
|
147
|
+
"run",
|
|
148
|
+
"-i",
|
|
149
|
+
"--rm",
|
|
150
|
+
"-e",
|
|
151
|
+
"CYBERBRO_URL",
|
|
152
|
+
"ghcr.io/stanfrbd/mcp-cyberbro:latest",
|
|
153
|
+
"--transport",
|
|
154
|
+
"stdio"
|
|
155
|
+
],
|
|
156
|
+
"env": {
|
|
157
|
+
"CYBERBRO_URL": "http://localhost:5000"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## MCP Registry Metadata
|
|
165
|
+
|
|
166
|
+
`server.json` is included for MCP Registry publication and points to PyPI package `mcp-cyberbro`.
|
|
167
|
+
|
|
168
|
+
## Release Pipelines
|
|
169
|
+
|
|
170
|
+
Release-created workflows:
|
|
171
|
+
|
|
172
|
+
- `.github/workflows/publish-test-pypi.yml`
|
|
173
|
+
- `.github/workflows/publish-pypi.yml`
|
|
174
|
+
- `.github/workflows/publish-mcp-plugin.yml`
|
|
175
|
+
|
|
176
|
+
## Available Tools
|
|
177
|
+
|
|
178
|
+
- `analyze_observable`
|
|
179
|
+
- `is_analysis_complete`
|
|
180
|
+
- `get_analysis_results`
|
|
181
|
+
- `get_engines`
|
|
182
|
+
- `get_web_url`
|
|
183
|
+
|
|
184
|
+
## Example Prompts
|
|
185
|
+
|
|
186
|
+
Here are practical prompt examples you can use with any MCP-capable assistant connected to Cyberbro.
|
|
187
|
+
|
|
188
|
+
### Getting Indicator Details
|
|
189
|
+
|
|
190
|
+
- Cyberbro: Check indicators for target.com
|
|
191
|
+
- Can you check this IP reputation with Cyberbro? 192.168.1.1. Use github, google and virustotal engines.
|
|
192
|
+
- I want to analyze the domain example.com. What can Cyberbro tell me about it? Use max 3 engines.
|
|
193
|
+
- Analyze these observables with Cyberbro: suspicious-domain.com, 8.8.8.8, and 44d88612fea8a8f36de82e1278abb02f. Use all available engines.
|
|
194
|
+
|
|
195
|
+
### Observable Analysis
|
|
196
|
+
|
|
197
|
+
- I found this (hash|domain|url|ip|extension). Can you submit it for analysis to Cyberbro and analyze the results?
|
|
198
|
+
|
|
199
|
+
### OSINT Investigation
|
|
200
|
+
|
|
201
|
+
- Create an OSINT report for the domain example.com using Cyberbro. Use all available engines and pivot on the results for more information. Use a maximum of 10 analysis requests.
|
|
202
|
+
|
|
203
|
+
## Acknowledgements
|
|
204
|
+
|
|
205
|
+
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
206
|
+
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
|
|
207
|
+
- [Cyberbro](https://github.com/stanfrbd/cyberbro)
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
MIT
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
[](https://mseep.ai/app/stanfrbd-mcp-cyberbro)
|
|
2
|
+
|
|
3
|
+
<h1 align="center">Cyberbro MCP Server</h1>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://github.com/user-attachments/assets/5e5a4406-99c1-47f1-a726-de176baa824c" width="90" /><br />
|
|
7
|
+
<b><i>Extract IoCs from messy text and analyze them with Cyberbro.</i></b>
|
|
8
|
+
<br />
|
|
9
|
+
<b>🌐 <a href="https://demo.cyberbro.net/">demo.cyberbro.net</a></b><br />
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
Model Context Protocol server for Cyberbro.
|
|
15
|
+
|
|
16
|
+
This project is packaged as a standard Python distribution and can be launched with:
|
|
17
|
+
|
|
18
|
+
- `uvx mcp-cyberbro`
|
|
19
|
+
- `pip install mcp-cyberbro` then `mcp-cyberbro`
|
|
20
|
+
|
|
21
|
+
## Why this server
|
|
22
|
+
|
|
23
|
+
- Analyze observables (IP, domain, URL, hash, etc.) via Cyberbro engines.
|
|
24
|
+
- Integrate threat-analysis actions directly in MCP-capable assistants.
|
|
25
|
+
- Run with `stdio`, `sse`, or `streamable-http` transports.
|
|
26
|
+
- Compatible with any MCP client that supports one of these transports.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Use with `uvx` (standalone)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uvx mcp-cyberbro --cyberbro_url http://localhost:5000
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Use with `pip`
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install mcp-cyberbro
|
|
40
|
+
mcp-cyberbro --cyberbro_url http://localhost:5000
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Local development
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install -e .
|
|
47
|
+
mcp-cyberbro --cyberbro_url http://localhost:5000
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Docker
|
|
51
|
+
|
|
52
|
+
Default container command starts in `streamable-http` mode on port `8000`.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
docker run --rm -p 8000:8000 \
|
|
56
|
+
-e CYBERBRO_URL=http://host.docker.internal:5000 \
|
|
57
|
+
ghcr.io/stanfrbd/mcp-cyberbro:latest
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
To force `stdio` transport:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
docker run -i --rm \
|
|
64
|
+
-e CYBERBRO_URL=http://host.docker.internal:5000 \
|
|
65
|
+
ghcr.io/stanfrbd/mcp-cyberbro:latest \
|
|
66
|
+
--transport stdio
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
Copy `.env.example` and set at least:
|
|
72
|
+
|
|
73
|
+
- `CYBERBRO_URL` (required)
|
|
74
|
+
|
|
75
|
+
Supported environment variables:
|
|
76
|
+
|
|
77
|
+
- `CYBERBRO_URL`
|
|
78
|
+
- `API_PREFIX` (default: `api`)
|
|
79
|
+
- `SSL_VERIFY` (`true`/`false`)
|
|
80
|
+
- `MCP_TRANSPORT` (`stdio`, `sse`, `streamable-http`)
|
|
81
|
+
- `MCP_HOST`
|
|
82
|
+
- `MCP_PORT`
|
|
83
|
+
- `MCP_MOUNT_PATH`
|
|
84
|
+
- `MCP_SSE_PATH`
|
|
85
|
+
- `MCP_STREAMABLE_HTTP_PATH`
|
|
86
|
+
|
|
87
|
+
CLI flags are also available and override env values.
|
|
88
|
+
|
|
89
|
+
## MCP Client Integration
|
|
90
|
+
|
|
91
|
+
You can use this server with Claude Desktop, Claude Code, Cursor, OpenAI-compatible MCP clients, or any other MCP client.
|
|
92
|
+
|
|
93
|
+
Example config using `uvx`:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"cyberbro": {
|
|
99
|
+
"command": "uvx",
|
|
100
|
+
"args": ["mcp-cyberbro"],
|
|
101
|
+
"env": {
|
|
102
|
+
"CYBERBRO_URL": "http://localhost:5000",
|
|
103
|
+
"API_PREFIX": "api"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Example with Docker + `stdio`:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"cyberbro": {
|
|
116
|
+
"command": "docker",
|
|
117
|
+
"args": [
|
|
118
|
+
"run",
|
|
119
|
+
"-i",
|
|
120
|
+
"--rm",
|
|
121
|
+
"-e",
|
|
122
|
+
"CYBERBRO_URL",
|
|
123
|
+
"ghcr.io/stanfrbd/mcp-cyberbro:latest",
|
|
124
|
+
"--transport",
|
|
125
|
+
"stdio"
|
|
126
|
+
],
|
|
127
|
+
"env": {
|
|
128
|
+
"CYBERBRO_URL": "http://localhost:5000"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## MCP Registry Metadata
|
|
136
|
+
|
|
137
|
+
`server.json` is included for MCP Registry publication and points to PyPI package `mcp-cyberbro`.
|
|
138
|
+
|
|
139
|
+
## Release Pipelines
|
|
140
|
+
|
|
141
|
+
Release-created workflows:
|
|
142
|
+
|
|
143
|
+
- `.github/workflows/publish-test-pypi.yml`
|
|
144
|
+
- `.github/workflows/publish-pypi.yml`
|
|
145
|
+
- `.github/workflows/publish-mcp-plugin.yml`
|
|
146
|
+
|
|
147
|
+
## Available Tools
|
|
148
|
+
|
|
149
|
+
- `analyze_observable`
|
|
150
|
+
- `is_analysis_complete`
|
|
151
|
+
- `get_analysis_results`
|
|
152
|
+
- `get_engines`
|
|
153
|
+
- `get_web_url`
|
|
154
|
+
|
|
155
|
+
## Example Prompts
|
|
156
|
+
|
|
157
|
+
Here are practical prompt examples you can use with any MCP-capable assistant connected to Cyberbro.
|
|
158
|
+
|
|
159
|
+
### Getting Indicator Details
|
|
160
|
+
|
|
161
|
+
- Cyberbro: Check indicators for target.com
|
|
162
|
+
- Can you check this IP reputation with Cyberbro? 192.168.1.1. Use github, google and virustotal engines.
|
|
163
|
+
- I want to analyze the domain example.com. What can Cyberbro tell me about it? Use max 3 engines.
|
|
164
|
+
- Analyze these observables with Cyberbro: suspicious-domain.com, 8.8.8.8, and 44d88612fea8a8f36de82e1278abb02f. Use all available engines.
|
|
165
|
+
|
|
166
|
+
### Observable Analysis
|
|
167
|
+
|
|
168
|
+
- I found this (hash|domain|url|ip|extension). Can you submit it for analysis to Cyberbro and analyze the results?
|
|
169
|
+
|
|
170
|
+
### OSINT Investigation
|
|
171
|
+
|
|
172
|
+
- Create an OSINT report for the domain example.com using Cyberbro. Use all available engines and pivot on the results for more information. Use a maximum of 10 analysis requests.
|
|
173
|
+
|
|
174
|
+
## Acknowledgements
|
|
175
|
+
|
|
176
|
+
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
177
|
+
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
|
|
178
|
+
- [Cyberbro](https://github.com/stanfrbd/cyberbro)
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability within this project, please raise an issue on our [GitHub Issues page](https://github.com/stanfrbd/mcp-cyberbro/issues). We take all security vulnerabilities seriously and will address them promptly.
|
|
6
|
+
|
|
7
|
+
Thank you for helping to keep our project secure.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mcp-cyberbro"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Model Context Protocol server for Cyberbro IOC analysis and enrichment"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "stanfrbd"},
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
]
|
|
23
|
+
keywords = [
|
|
24
|
+
"mcp",
|
|
25
|
+
"model-context-protocol",
|
|
26
|
+
"cyberbro",
|
|
27
|
+
"threat-intelligence",
|
|
28
|
+
"osint",
|
|
29
|
+
"ioc",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"mcp[cli]>=1.0.0",
|
|
33
|
+
"httpx>=0.27.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Homepage = "https://github.com/stanfrbd/mcp-cyberbro"
|
|
38
|
+
Repository = "https://github.com/stanfrbd/mcp-cyberbro"
|
|
39
|
+
Issues = "https://github.com/stanfrbd/mcp-cyberbro/issues"
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
mcp-cyberbro = "mcp_cyberbro.cli:main"
|
|
43
|
+
|
|
44
|
+
[project.optional-dependencies]
|
|
45
|
+
dev = [
|
|
46
|
+
"pytest>=7.0",
|
|
47
|
+
"pytest-mock>=3.0",
|
|
48
|
+
"pytest-asyncio>=0.23.0",
|
|
49
|
+
"ruff>=0.15.5",
|
|
50
|
+
"pre-commit>=4.3.0",
|
|
51
|
+
"bandit>=1.9.4",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[tool.hatch.build.targets.wheel]
|
|
55
|
+
packages = ["src/mcp_cyberbro"]
|
|
56
|
+
|
|
57
|
+
[tool.hatch.build.targets.sdist]
|
|
58
|
+
exclude = [
|
|
59
|
+
"tests/",
|
|
60
|
+
"docs/",
|
|
61
|
+
".github/",
|
|
62
|
+
".claude/",
|
|
63
|
+
".claude-plugin/",
|
|
64
|
+
"agents/",
|
|
65
|
+
"commands/",
|
|
66
|
+
"skills/",
|
|
67
|
+
"dist/",
|
|
68
|
+
"*.png",
|
|
69
|
+
"uv.lock",
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[tool.pytest.ini_options]
|
|
73
|
+
testpaths = ["tests"]
|
|
74
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-e .[dev]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.stanfrbd/mcp-cyberbro",
|
|
4
|
+
"title": "Cyberbro MCP Server",
|
|
5
|
+
"description": "MCP server for Cyberbro IOC extraction, enrichment and reputation analysis.",
|
|
6
|
+
"version": "0.0.1",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/stanfrbd/mcp-cyberbro",
|
|
9
|
+
"source": "github"
|
|
10
|
+
},
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registryType": "pypi",
|
|
14
|
+
"identifier": "mcp-cyberbro",
|
|
15
|
+
"version": "0.0.1",
|
|
16
|
+
"transport": {
|
|
17
|
+
"type": "stdio"
|
|
18
|
+
},
|
|
19
|
+
"environmentVariables": [
|
|
20
|
+
{
|
|
21
|
+
"name": "CYBERBRO_URL",
|
|
22
|
+
"isRequired": true,
|
|
23
|
+
"description": "Base URL of Cyberbro (for example http://localhost:5000)",
|
|
24
|
+
"format": "string"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "API_PREFIX",
|
|
28
|
+
"isRequired": false,
|
|
29
|
+
"description": "Cyberbro API prefix (default: api)",
|
|
30
|
+
"format": "string"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "SSL_VERIFY",
|
|
34
|
+
"isRequired": false,
|
|
35
|
+
"description": "Enable/disable SSL verification for Cyberbro API calls (true/false)",
|
|
36
|
+
"format": "string"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "MCP_TRANSPORT",
|
|
40
|
+
"isRequired": false,
|
|
41
|
+
"description": "Transport override: stdio, sse or streamable-http",
|
|
42
|
+
"format": "string"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "MCP_HOST",
|
|
46
|
+
"isRequired": false,
|
|
47
|
+
"description": "Host for HTTP transports",
|
|
48
|
+
"format": "string"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "MCP_PORT",
|
|
52
|
+
"isRequired": false,
|
|
53
|
+
"description": "Port for HTTP transports",
|
|
54
|
+
"format": "string"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "MCP_MOUNT_PATH",
|
|
58
|
+
"isRequired": false,
|
|
59
|
+
"description": "Mount path for SSE transport",
|
|
60
|
+
"format": "string"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "MCP_SSE_PATH",
|
|
64
|
+
"isRequired": false,
|
|
65
|
+
"description": "SSE endpoint path",
|
|
66
|
+
"format": "string"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "MCP_STREAMABLE_HTTP_PATH",
|
|
70
|
+
"isRequired": false,
|
|
71
|
+
"description": "Streamable HTTP endpoint path",
|
|
72
|
+
"format": "string"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
|
|
5
|
+
from mcp_cyberbro.server import run_server
|
|
6
|
+
from mcp_cyberbro.utils.config import resolve_config
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
10
|
+
parser = argparse.ArgumentParser(description="Cyberbro MCP Server")
|
|
11
|
+
parser.add_argument(
|
|
12
|
+
"--transport",
|
|
13
|
+
required=False,
|
|
14
|
+
type=str,
|
|
15
|
+
choices=["stdio", "sse", "streamable-http"],
|
|
16
|
+
default=None,
|
|
17
|
+
help="MCP transport to use (env: MCP_TRANSPORT, default: stdio)",
|
|
18
|
+
)
|
|
19
|
+
parser.add_argument(
|
|
20
|
+
"--host",
|
|
21
|
+
required=False,
|
|
22
|
+
type=str,
|
|
23
|
+
default=None,
|
|
24
|
+
help="Host for HTTP transports (env: MCP_HOST, default: SDK default)",
|
|
25
|
+
)
|
|
26
|
+
parser.add_argument(
|
|
27
|
+
"--port",
|
|
28
|
+
required=False,
|
|
29
|
+
type=int,
|
|
30
|
+
default=None,
|
|
31
|
+
help="Port for HTTP transports (env: MCP_PORT, default: SDK default)",
|
|
32
|
+
)
|
|
33
|
+
parser.add_argument(
|
|
34
|
+
"--mount_path",
|
|
35
|
+
required=False,
|
|
36
|
+
type=str,
|
|
37
|
+
default=None,
|
|
38
|
+
help="Mount path for SSE transport (env: MCP_MOUNT_PATH, default: SDK default)",
|
|
39
|
+
)
|
|
40
|
+
parser.add_argument(
|
|
41
|
+
"--sse_path",
|
|
42
|
+
required=False,
|
|
43
|
+
type=str,
|
|
44
|
+
default=None,
|
|
45
|
+
help="SSE endpoint path for SSE transport (env: MCP_SSE_PATH, default: SDK default)",
|
|
46
|
+
)
|
|
47
|
+
parser.add_argument(
|
|
48
|
+
"--streamable_http_path",
|
|
49
|
+
required=False,
|
|
50
|
+
type=str,
|
|
51
|
+
default=None,
|
|
52
|
+
help="Endpoint path for streamable-http transport (env: MCP_STREAMABLE_HTTP_PATH, default: SDK default)",
|
|
53
|
+
)
|
|
54
|
+
parser.add_argument(
|
|
55
|
+
"--cyberbro_url",
|
|
56
|
+
type=str,
|
|
57
|
+
required=False,
|
|
58
|
+
help="Base URL for Cyberbro API (env: CYBERBRO_URL)",
|
|
59
|
+
)
|
|
60
|
+
parser.add_argument(
|
|
61
|
+
"--api_prefix",
|
|
62
|
+
required=False,
|
|
63
|
+
type=str,
|
|
64
|
+
default=None,
|
|
65
|
+
help="API prefix path (env: API_PREFIX, default: api)",
|
|
66
|
+
)
|
|
67
|
+
parser.add_argument(
|
|
68
|
+
"--no_ssl_verify",
|
|
69
|
+
required=False,
|
|
70
|
+
action="store_true",
|
|
71
|
+
help="Disable SSL verification, default is enabled",
|
|
72
|
+
)
|
|
73
|
+
return parser
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def main() -> None:
|
|
77
|
+
parser = build_parser()
|
|
78
|
+
args = parser.parse_args()
|
|
79
|
+
config = resolve_config(args)
|
|
80
|
+
run_server(config)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
|
|
5
|
+
from mcp_cyberbro.tools.analysis import register_analysis_tools
|
|
6
|
+
from mcp_cyberbro.tools.engines import register_engine_tools
|
|
7
|
+
from mcp_cyberbro.tools.web import register_web_tools
|
|
8
|
+
from mcp_cyberbro.utils.config import CyberbroConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def create_server(config: CyberbroConfig) -> FastMCP:
|
|
12
|
+
mcp = FastMCP("CyberbroMCP")
|
|
13
|
+
|
|
14
|
+
register_analysis_tools(mcp, config)
|
|
15
|
+
register_engine_tools(mcp)
|
|
16
|
+
register_web_tools(mcp, config)
|
|
17
|
+
|
|
18
|
+
if config.host:
|
|
19
|
+
mcp.settings.host = config.host
|
|
20
|
+
if config.port:
|
|
21
|
+
mcp.settings.port = config.port
|
|
22
|
+
if config.mount_path:
|
|
23
|
+
mcp.settings.mount_path = config.mount_path
|
|
24
|
+
if config.sse_path:
|
|
25
|
+
mcp.settings.sse_path = config.sse_path
|
|
26
|
+
if config.streamable_http_path:
|
|
27
|
+
mcp.settings.streamable_http_path = config.streamable_http_path
|
|
28
|
+
|
|
29
|
+
return mcp
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def run_server(config: CyberbroConfig) -> None:
|
|
33
|
+
mcp = create_server(config)
|
|
34
|
+
mcp.run(transport=config.transport)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""MCP tool registrations for Cyberbro."""
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from mcp.server.fastmcp import FastMCP
|
|
6
|
+
|
|
7
|
+
from mcp_cyberbro.utils.config import CyberbroConfig
|
|
8
|
+
from mcp_cyberbro.utils.http import get_json, post_json
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def register_analysis_tools(mcp: FastMCP, config: CyberbroConfig) -> None:
|
|
12
|
+
@mcp.tool()
|
|
13
|
+
async def analyze_observable(text: str, engines: list[str]) -> Any:
|
|
14
|
+
"""
|
|
15
|
+
Trigger an analysis for a given observable (IP, domain, URL, hash, chrome extension id) using Cyberbro.
|
|
16
|
+
It can support multiple observables at once separated by spaces.
|
|
17
|
+
Args:
|
|
18
|
+
text: Observable(s) to analyze.
|
|
19
|
+
engines: List of engine names.
|
|
20
|
+
Returns:
|
|
21
|
+
The analysis response from Cyberbro API.
|
|
22
|
+
"""
|
|
23
|
+
try:
|
|
24
|
+
payload = {"text": text, "engines": engines}
|
|
25
|
+
return await post_json(
|
|
26
|
+
f"{config.cyberbro_api}/analyze", payload=payload, verify=config.ssl_verify
|
|
27
|
+
)
|
|
28
|
+
except Exception as exc:
|
|
29
|
+
return {"error": f"Error executing tool analyze_observable: {exc!s}"}
|
|
30
|
+
|
|
31
|
+
@mcp.tool()
|
|
32
|
+
async def is_analysis_complete(analysis_id: str) -> Any:
|
|
33
|
+
"""
|
|
34
|
+
Check if the analysis is complete for the given analysis_id.
|
|
35
|
+
Args:
|
|
36
|
+
analysis_id: Analysis ID to check.
|
|
37
|
+
Returns:
|
|
38
|
+
The completion status from Cyberbro API.
|
|
39
|
+
"""
|
|
40
|
+
try:
|
|
41
|
+
return await get_json(
|
|
42
|
+
f"{config.cyberbro_api}/is_analysis_complete/{analysis_id}",
|
|
43
|
+
verify=config.ssl_verify,
|
|
44
|
+
)
|
|
45
|
+
except Exception as exc:
|
|
46
|
+
return {"error": f"Error executing tool is_analysis_complete: {exc!s}"}
|
|
47
|
+
|
|
48
|
+
@mcp.tool()
|
|
49
|
+
async def get_analysis_results(analysis_id: str) -> Any:
|
|
50
|
+
"""
|
|
51
|
+
Retrieve the results of a previous analysis by analysis_id.
|
|
52
|
+
Args:
|
|
53
|
+
analysis_id: Analysis ID to retrieve results for.
|
|
54
|
+
Returns:
|
|
55
|
+
The analysis results from Cyberbro API.
|
|
56
|
+
"""
|
|
57
|
+
try:
|
|
58
|
+
return await get_json(
|
|
59
|
+
f"{config.cyberbro_api}/results/{analysis_id}", verify=config.ssl_verify
|
|
60
|
+
)
|
|
61
|
+
except Exception as exc:
|
|
62
|
+
return {"error": f"Error executing tool get_analysis_results: {exc!s}"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from mcp.server.fastmcp import FastMCP
|
|
6
|
+
|
|
7
|
+
ENGINES = [
|
|
8
|
+
{
|
|
9
|
+
"name": "reverse_dns",
|
|
10
|
+
"supports": ["domain", "IP", "abuse"],
|
|
11
|
+
"description": "Performs a reverse DNS lookup (local DNS) for IP, domain, URL (on the Cyberbro machine)",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "dfir_iris",
|
|
15
|
+
"supports": ["domain", "URL", "IP", "hash"],
|
|
16
|
+
"description": "Searches DFIR-IRIS globally across all cases for indicators, free, API key required.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "rdap",
|
|
20
|
+
"supports": ["abuse", "domain"],
|
|
21
|
+
"description": "Checks RDAP (ex Whois) record for domain, URL",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "ipquery",
|
|
25
|
+
"supports": ["IP", "risk", "VPN", "proxy", "geoloc"],
|
|
26
|
+
"description": "Checks IPquery for IP, reversed obtained IP for a given domain/URL",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "abuseipdb",
|
|
30
|
+
"supports": ["risk", "IP"],
|
|
31
|
+
"description": "Checks AbuseIPDB for IP, reversed obtained IP for a given domain/URL",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "ipapi",
|
|
35
|
+
"supports": ["IP", "risk", "geoloc", "VPN", "proxy"],
|
|
36
|
+
"description": "Checks IPAPI for IP, reversed obtained IP for a given domain/URL",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "ipinfo",
|
|
40
|
+
"supports": ["IP", "geoloc"],
|
|
41
|
+
"description": "Checks IPinfo for IP, reversed obtained IP for a given domain/URL",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "virustotal",
|
|
45
|
+
"supports": ["hash", "risk", "IP", "domain", "URL"],
|
|
46
|
+
"description": "Checks VirusTotal for IP, domain, URL, hash",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "spur",
|
|
50
|
+
"supports": ["VPN", "proxy", "IP"],
|
|
51
|
+
"description": "Checks Spur.us for IP, reversed obtained IP for a given domain/URL",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "mde",
|
|
55
|
+
"supports": ["hash", "IP", "domain", "URL"],
|
|
56
|
+
"description": "Checks Microsoft Defender for Endpoint EDR API for IP, domain, URL, hash",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "crowdstrike",
|
|
60
|
+
"supports": ["hash", "IP", "domain", "URL"],
|
|
61
|
+
"description": "Checks CrowdStrike EDR for IP, domain, URL, hash using Falcon API",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "google_safe_browsing",
|
|
65
|
+
"supports": ["risk", "domain", "IP", "URL"],
|
|
66
|
+
"description": "Checks Google Safe Browsing for IP, domain, URL",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "shodan",
|
|
70
|
+
"supports": ["ports", "IP"],
|
|
71
|
+
"description": "Checks Shodan, reversed obtained IP for a given domain/URL",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "phishtank",
|
|
75
|
+
"supports": ["risk", "domain", "URL"],
|
|
76
|
+
"description": "Checks Phishtank for domains, URL",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "threatfox",
|
|
80
|
+
"supports": ["IP", "domain", "URL"],
|
|
81
|
+
"description": "Checks ThreatFox by Abuse.ch for IP, domains, URL",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "urlscan",
|
|
85
|
+
"supports": ["domain", "URL", "IP", "hash"],
|
|
86
|
+
"description": "Checks URLscan for all types of observable",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "google",
|
|
90
|
+
"supports": ["domain", "URL", "IP", "hash", "chrome_extension_id", "edge_extension_id"],
|
|
91
|
+
"description": "Checks Google search results for all types of observable",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "github",
|
|
95
|
+
"supports": ["domain", "URL", "IP", "hash", "chrome_extension_id", "edge_extension_id"],
|
|
96
|
+
"description": "Get Github grep.app API search results for all types of observable",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "ioc_one_html",
|
|
100
|
+
"supports": ["domain", "URL", "IP", "hash", "chrome_extension_id", "edge_extension_id"],
|
|
101
|
+
"description": "Scraps (can be long) Ioc.One HTML search results for all types of observable",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "ioc_one_pdf",
|
|
105
|
+
"supports": ["domain", "URL", "IP", "hash", "chrome_extension_id", "edge_extension_id"],
|
|
106
|
+
"description": "Scraps (can be long) Ioc.One PDF search results for all types of observable",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "opencti",
|
|
110
|
+
"supports": ["domain", "URL", "IP", "hash"],
|
|
111
|
+
"description": "Searches OpenCTI results for all types of observable",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "abusix",
|
|
115
|
+
"supports": ["abuse", "IP"],
|
|
116
|
+
"description": "Checks abuse contact with Abusix for IP, reversed obtained IP for a given domain/URL",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "hudsonrock",
|
|
120
|
+
"supports": ["domain", "URL", "email", "infostealers", "malware"],
|
|
121
|
+
"description": "Searches Hudson Rock results for domains, URL, Email",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "webscout",
|
|
125
|
+
"supports": ["IP", "risk", "geoloc", "VPN", "proxy"],
|
|
126
|
+
"description": "Checks WebScout for IP, reversed obtained IP for a given domain / URL",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "criminalip",
|
|
130
|
+
"supports": ["IP", "risk", "VPN", "proxy"],
|
|
131
|
+
"description": "Checks CriminalIP for IP, reversed obtained IP for a given domain / URL",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "alienvault",
|
|
135
|
+
"supports": ["IP", "domain", "URL", "hash", "risk"],
|
|
136
|
+
"description": "Checks Alienvault for IP, domain, URL, hash",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "misp",
|
|
140
|
+
"supports": ["IP", "domain", "URL", "hash"],
|
|
141
|
+
"description": "Checks MISP for IP, domain, URL, hash",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "google_dns",
|
|
145
|
+
"supports": ["IP", "domain", "URL"],
|
|
146
|
+
"description": "Checks Google common DNS records (A, AAAA, CNAME, NS, MX, TXT, PTR) for IP, domain, URL",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "crtsh",
|
|
150
|
+
"supports": ["domain", "URL"],
|
|
151
|
+
"description": "Checks crt.sh for domain, URL",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "rl_analyze",
|
|
155
|
+
"supports": ["domain", "URL", "IP", "hash"],
|
|
156
|
+
"description": "Looks up observables in the Reversing Labs Spectra Analyze service",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "bad_asn",
|
|
160
|
+
"supports": ["IP", "risk"],
|
|
161
|
+
"description": "Malicious ASN detection (free). Checks if IP's ASN is listed in Spamhaus ASNDROP or Brianhama Bad ASN databases. Requires ipapi, ipinfo to be selected to get the ASN. Free, no API key",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "rosti",
|
|
165
|
+
"supports": ["domain", "URL", "IP", "email", "hash", "risk"],
|
|
166
|
+
"description": "IOC search and enrichment. Searches Rosti IOC data for domains, URLs, IPs, emails, and hashes (MD5, SHA1, SHA256), API key required",
|
|
167
|
+
},
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def register_engine_tools(mcp: FastMCP) -> None:
|
|
172
|
+
@mcp.tool()
|
|
173
|
+
async def get_engines() -> Any:
|
|
174
|
+
"""
|
|
175
|
+
List available Cyberbro engines.
|
|
176
|
+
This is the first tool to be called to get the usable engines.
|
|
177
|
+
Returns:
|
|
178
|
+
The list of engines.
|
|
179
|
+
"""
|
|
180
|
+
return {"engines": ENGINES}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from mcp.server.fastmcp import FastMCP
|
|
6
|
+
|
|
7
|
+
from mcp_cyberbro.utils.config import CyberbroConfig
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def register_web_tools(mcp: FastMCP, config: CyberbroConfig) -> None:
|
|
11
|
+
@mcp.tool()
|
|
12
|
+
async def get_web_url(analysis_id: str) -> Any:
|
|
13
|
+
"""
|
|
14
|
+
Get the web GUI URL for a given analysis ID.
|
|
15
|
+
Args:
|
|
16
|
+
analysis_id: Analysis ID to get the web URL for.
|
|
17
|
+
Returns:
|
|
18
|
+
The web URL from Cyberbro API - Useful for the user to check the results.
|
|
19
|
+
"""
|
|
20
|
+
return {"web_url": f"{config.cyberbro_url}/results/{analysis_id}"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Utility helpers for Cyberbro MCP."""
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(slots=True)
|
|
8
|
+
class CyberbroConfig:
|
|
9
|
+
cyberbro_url: str
|
|
10
|
+
api_prefix: str = "api"
|
|
11
|
+
ssl_verify: bool = True
|
|
12
|
+
transport: str = "stdio"
|
|
13
|
+
host: str | None = None
|
|
14
|
+
port: int | None = None
|
|
15
|
+
mount_path: str | None = None
|
|
16
|
+
sse_path: str | None = None
|
|
17
|
+
streamable_http_path: str | None = None
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def cyberbro_api(self) -> str:
|
|
21
|
+
return f"{self.cyberbro_url}/{self.api_prefix}"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _as_bool(value: str, default: bool = True) -> bool:
|
|
25
|
+
if value is None:
|
|
26
|
+
return default
|
|
27
|
+
return value.strip().lower() in {"1", "true", "yes", "on"}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def resolve_config(args) -> CyberbroConfig:
|
|
31
|
+
cyberbro_url = (args.cyberbro_url.rstrip("/") if args.cyberbro_url else None) or (
|
|
32
|
+
os.environ.get("CYBERBRO_URL", "").rstrip("/") or None
|
|
33
|
+
)
|
|
34
|
+
if not cyberbro_url:
|
|
35
|
+
raise ValueError("CYBERBRO_URL is required (use --cyberbro_url or env var)")
|
|
36
|
+
|
|
37
|
+
api_prefix = (args.api_prefix.rstrip("/") if args.api_prefix else None) or os.environ.get(
|
|
38
|
+
"API_PREFIX", "api"
|
|
39
|
+
).rstrip("/")
|
|
40
|
+
ssl_verify = (
|
|
41
|
+
False if args.no_ssl_verify else _as_bool(os.environ.get("SSL_VERIFY"), default=True)
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
transport = args.transport or os.environ.get("MCP_TRANSPORT", "stdio")
|
|
45
|
+
host = args.host or os.environ.get("MCP_HOST")
|
|
46
|
+
port = args.port or (int(os.environ["MCP_PORT"]) if os.environ.get("MCP_PORT") else None)
|
|
47
|
+
mount_path = args.mount_path or os.environ.get("MCP_MOUNT_PATH")
|
|
48
|
+
sse_path = args.sse_path or os.environ.get("MCP_SSE_PATH")
|
|
49
|
+
streamable_http_path = args.streamable_http_path or os.environ.get("MCP_STREAMABLE_HTTP_PATH")
|
|
50
|
+
|
|
51
|
+
return CyberbroConfig(
|
|
52
|
+
cyberbro_url=cyberbro_url,
|
|
53
|
+
api_prefix=api_prefix,
|
|
54
|
+
ssl_verify=ssl_verify,
|
|
55
|
+
transport=transport,
|
|
56
|
+
host=host,
|
|
57
|
+
port=port,
|
|
58
|
+
mount_path=mount_path,
|
|
59
|
+
sse_path=sse_path,
|
|
60
|
+
streamable_http_path=streamable_http_path,
|
|
61
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async def post_json(url: str, payload: dict, verify: bool):
|
|
7
|
+
async with httpx.AsyncClient(verify=verify) as client:
|
|
8
|
+
response = await client.post(url, json=payload)
|
|
9
|
+
response.raise_for_status()
|
|
10
|
+
return response.json()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
async def get_json(url: str, verify: bool):
|
|
14
|
+
async with httpx.AsyncClient(verify=verify) as client:
|
|
15
|
+
response = await client.get(url)
|
|
16
|
+
response.raise_for_status()
|
|
17
|
+
return response.json()
|