librenms-mcp 1.2.2__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.
- librenms_mcp-1.2.2/.dockerignore +32 -0
- librenms_mcp-1.2.2/.env.example +34 -0
- librenms_mcp-1.2.2/.github/workflows/docker-publish.yml +103 -0
- librenms_mcp-1.2.2/.github/workflows/publish.yml +33 -0
- librenms_mcp-1.2.2/.github/workflows/release.yml +37 -0
- librenms_mcp-1.2.2/.github/workflows/test.yml +35 -0
- librenms_mcp-1.2.2/.gitignore +236 -0
- librenms_mcp-1.2.2/.pre-commit-config.yaml +25 -0
- librenms_mcp-1.2.2/CHANGELOG.md +33 -0
- librenms_mcp-1.2.2/Dockerfile +43 -0
- librenms_mcp-1.2.2/Dockerfile.mcpo +54 -0
- librenms_mcp-1.2.2/LICENSE +21 -0
- librenms_mcp-1.2.2/MANIFEST.in +3 -0
- librenms_mcp-1.2.2/PKG-INFO +386 -0
- librenms_mcp-1.2.2/README.md +334 -0
- librenms_mcp-1.2.2/fastmcp.json +16 -0
- librenms_mcp-1.2.2/pyproject.toml +132 -0
- librenms_mcp-1.2.2/run_server.py +9 -0
- librenms_mcp-1.2.2/src/librenms_mcp/__init__.py +5 -0
- librenms_mcp-1.2.2/src/librenms_mcp/librenms_client.py +140 -0
- librenms_mcp-1.2.2/src/librenms_mcp/librenms_middlewares.py +148 -0
- librenms_mcp-1.2.2/src/librenms_mcp/librenms_tools.py +2493 -0
- librenms_mcp-1.2.2/src/librenms_mcp/models.py +38 -0
- librenms_mcp-1.2.2/src/librenms_mcp/server.py +131 -0
- librenms_mcp-1.2.2/src/librenms_mcp/utils.py +17 -0
- librenms_mcp-1.2.2/tests/__init__.py +3 -0
- librenms_mcp-1.2.2/tests/test_utils.py +30 -0
- librenms_mcp-1.2.2/uv.lock +1904 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Docker ignore file to reduce build context size
|
|
2
|
+
**/__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
.Python
|
|
7
|
+
*.so
|
|
8
|
+
.git
|
|
9
|
+
.gitignore
|
|
10
|
+
.github
|
|
11
|
+
.vscode
|
|
12
|
+
.idea
|
|
13
|
+
*.md
|
|
14
|
+
!README.md
|
|
15
|
+
.env
|
|
16
|
+
.env.*
|
|
17
|
+
!.env.example
|
|
18
|
+
*.log
|
|
19
|
+
.coverage
|
|
20
|
+
.pytest_cache
|
|
21
|
+
.mypy_cache
|
|
22
|
+
dist/
|
|
23
|
+
build/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
screenshots/
|
|
26
|
+
docker-compose.yml
|
|
27
|
+
Dockerfile*
|
|
28
|
+
*.tar
|
|
29
|
+
*.zip
|
|
30
|
+
.venv/
|
|
31
|
+
venv/
|
|
32
|
+
.ruff_cache/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# LibreNMS MCP Server Environment Configuration
|
|
2
|
+
|
|
3
|
+
# LibreNMS Connection Details
|
|
4
|
+
LIBRENMS_URL=https://domain.tld:8443
|
|
5
|
+
LIBRENMS_TOKEN=your-librenms-token
|
|
6
|
+
|
|
7
|
+
# SSL Configuration
|
|
8
|
+
LIBRENMS_VERIFY_SSL=true
|
|
9
|
+
LIBRENMS_TIMEOUT=30
|
|
10
|
+
|
|
11
|
+
# Read-Only Mode
|
|
12
|
+
# Set READ_ONLY_MODE true to disable all write operations (put, post, delete)
|
|
13
|
+
READ_ONLY_MODE=false
|
|
14
|
+
|
|
15
|
+
# Logging Configuration
|
|
16
|
+
LOG_LEVEL=INFO
|
|
17
|
+
|
|
18
|
+
# Rate Limiting (requests per minute)
|
|
19
|
+
# Set RATE_LIMIT_ENABLED true to enable rate limiting
|
|
20
|
+
RATE_LIMIT_ENABLED=false
|
|
21
|
+
RATE_LIMIT_MAX_REQUESTS=100
|
|
22
|
+
RATE_LIMIT_WINDOW_MINUTES=1
|
|
23
|
+
|
|
24
|
+
# MCP Transport Configuration
|
|
25
|
+
# Transport type: 'stdio' (default), 'sse' (Server-Sent Events), or 'http' (HTTP Streamable)
|
|
26
|
+
MCP_TRANSPORT=stdio
|
|
27
|
+
|
|
28
|
+
# HTTP Transport Settings (used when MCP_TRANSPORT=sse or MCP_TRANSPORT=http)
|
|
29
|
+
# Host to bind the HTTP server (default: 0.0.0.0 for all interfaces)
|
|
30
|
+
MCP_HTTP_HOST=0.0.0.0
|
|
31
|
+
# Port to bind the HTTP server (default: 8000)
|
|
32
|
+
MCP_HTTP_PORT=8000
|
|
33
|
+
# Optional bearer token for authentication (leave empty for no auth)
|
|
34
|
+
MCP_HTTP_BEARER_TOKEN=
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
name: Docker Multi-arch Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
tags: ["v*.*.*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: ["main"]
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
REGISTRY: ghcr.io
|
|
12
|
+
IMAGE_NAME: ${{ github.repository }}
|
|
13
|
+
IMAGE_NAME_MCPO: ${{ github.repository }}o
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build-and-push:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
packages: write
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout repository
|
|
24
|
+
uses: actions/checkout@v5
|
|
25
|
+
|
|
26
|
+
- name: Set up QEMU
|
|
27
|
+
uses: docker/setup-qemu-action@v3
|
|
28
|
+
|
|
29
|
+
- name: Set up Docker Buildx
|
|
30
|
+
uses: docker/setup-buildx-action@v3
|
|
31
|
+
|
|
32
|
+
- name: Log in to GitHub Container Registry
|
|
33
|
+
if: github.event_name != 'pull_request'
|
|
34
|
+
uses: docker/login-action@v3
|
|
35
|
+
with:
|
|
36
|
+
registry: ${{ env.REGISTRY }}
|
|
37
|
+
username: ${{ github.actor }}
|
|
38
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
39
|
+
|
|
40
|
+
- name: Extract metadata for Docker
|
|
41
|
+
id: meta
|
|
42
|
+
uses: docker/metadata-action@v5
|
|
43
|
+
with:
|
|
44
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
45
|
+
tags: |
|
|
46
|
+
# Set latest tag for main branch
|
|
47
|
+
type=raw,value=latest,enable={{is_default_branch}}
|
|
48
|
+
# Tag with branch name (e.g., main, develop)
|
|
49
|
+
type=ref,event=branch
|
|
50
|
+
# Tag with PR number (e.g., pr-2)
|
|
51
|
+
type=ref,event=pr
|
|
52
|
+
# Tag with semver - v1.2.3 -> 1.2.3
|
|
53
|
+
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
54
|
+
# Tag with major.minor - v1.2.3 -> 1.2
|
|
55
|
+
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
56
|
+
# Tag with major - v1.2.3 -> 1
|
|
57
|
+
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
58
|
+
# Tag with git sha
|
|
59
|
+
type=sha,format=short
|
|
60
|
+
|
|
61
|
+
- name: Build and push Docker image
|
|
62
|
+
uses: docker/build-push-action@v6
|
|
63
|
+
with:
|
|
64
|
+
context: .
|
|
65
|
+
platforms: linux/amd64,linux/arm64
|
|
66
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
67
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
68
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
69
|
+
cache-from: type=gha
|
|
70
|
+
cache-to: type=gha,mode=max
|
|
71
|
+
|
|
72
|
+
- name: Extract metadata for MCPO Docker
|
|
73
|
+
id: meta-mcpo
|
|
74
|
+
uses: docker/metadata-action@v5
|
|
75
|
+
with:
|
|
76
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_MCPO }}
|
|
77
|
+
tags: |
|
|
78
|
+
# Set latest tag for main branch
|
|
79
|
+
type=raw,value=latest,enable={{is_default_branch}}
|
|
80
|
+
# Tag with branch name
|
|
81
|
+
type=ref,event=branch
|
|
82
|
+
# Tag with PR number
|
|
83
|
+
type=ref,event=pr
|
|
84
|
+
# Tag with semver
|
|
85
|
+
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
86
|
+
# Tag with major.minor
|
|
87
|
+
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
88
|
+
# Tag with major
|
|
89
|
+
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
90
|
+
# Tag with git sha
|
|
91
|
+
type=sha,format=short
|
|
92
|
+
|
|
93
|
+
- name: Build and push Docker MCPO image
|
|
94
|
+
uses: docker/build-push-action@v6
|
|
95
|
+
with:
|
|
96
|
+
context: .
|
|
97
|
+
file: Dockerfile.mcpo
|
|
98
|
+
platforms: linux/amd64,linux/arm64
|
|
99
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
100
|
+
tags: ${{ steps.meta-mcpo.outputs.tags }}
|
|
101
|
+
labels: ${{ steps.meta-mcpo.outputs.labels }}
|
|
102
|
+
cache-from: type=gha
|
|
103
|
+
cache-to: type=gha,mode=max
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: pypi
|
|
13
|
+
url: https://pypi.org/p/librenms-mcp
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write # Mandatory for Trusted Publishing
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v6
|
|
20
|
+
|
|
21
|
+
- name: Install the latest version of uv and set the python version
|
|
22
|
+
uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.13'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: uv sync --locked --all-extras --no-dev
|
|
28
|
+
|
|
29
|
+
- name: Build package
|
|
30
|
+
run: uv build
|
|
31
|
+
|
|
32
|
+
- name: Publish package distributions to PyPI
|
|
33
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
create-release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
outputs:
|
|
14
|
+
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
15
|
+
tag_name: ${{ steps.get_version.outputs.tag_name }}
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v5
|
|
20
|
+
|
|
21
|
+
- name: Get version from tag
|
|
22
|
+
id: get_version
|
|
23
|
+
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
24
|
+
|
|
25
|
+
- name: Create Release
|
|
26
|
+
id: create_release
|
|
27
|
+
uses: softprops/action-gh-release@v2
|
|
28
|
+
with:
|
|
29
|
+
tag_name: ${{ steps.get_version.outputs.tag_name }}
|
|
30
|
+
name: ${{ steps.get_version.outputs.tag_name }}
|
|
31
|
+
generate_release_notes: true
|
|
32
|
+
append_body: true
|
|
33
|
+
body: |
|
|
34
|
+
## Docker Images
|
|
35
|
+
- `ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.tag_name }}`
|
|
36
|
+
- `ghcr.io/${{ github.repository }}o:${{ steps.get_version.outputs.tag_name }}`
|
|
37
|
+
prerelease: ${{ contains(steps.get_version.outputs.tag_name, '-') }}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Test & Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Install the latest version of uv and set the python version
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: uv sync --all-groups
|
|
27
|
+
|
|
28
|
+
- name: Run ruff linter
|
|
29
|
+
run: uv run ruff check .
|
|
30
|
+
|
|
31
|
+
- name: Run ruff formatter
|
|
32
|
+
run: uv run ruff format --check .
|
|
33
|
+
|
|
34
|
+
- name: Run pytest
|
|
35
|
+
run: uv run pytest tests/ -v --cov=src/
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be added to the global gitignore or merged into this project gitignore. For a JetBrains IDE
|
|
158
|
+
# it is recommended to use a global gitignore:
|
|
159
|
+
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
160
|
+
# JetBrains IDEs
|
|
161
|
+
.idea/
|
|
162
|
+
|
|
163
|
+
# VS Code
|
|
164
|
+
.vscode/
|
|
165
|
+
!.vscode/tasks.json
|
|
166
|
+
!.vscode/launch.json
|
|
167
|
+
!.vscode/extensions.json
|
|
168
|
+
!.vscode/settings.json
|
|
169
|
+
|
|
170
|
+
# Project specific
|
|
171
|
+
# Environment files
|
|
172
|
+
.env.local
|
|
173
|
+
.env.production
|
|
174
|
+
.env.development
|
|
175
|
+
|
|
176
|
+
# Logs
|
|
177
|
+
*.log
|
|
178
|
+
logs/
|
|
179
|
+
|
|
180
|
+
# Temporary files
|
|
181
|
+
*.tmp
|
|
182
|
+
*.temp
|
|
183
|
+
temp/
|
|
184
|
+
tmp/
|
|
185
|
+
|
|
186
|
+
# Backup files
|
|
187
|
+
*.backup
|
|
188
|
+
*.bak
|
|
189
|
+
backups/
|
|
190
|
+
|
|
191
|
+
# SSL Certificates (if stored locally)
|
|
192
|
+
*.pem
|
|
193
|
+
*.key
|
|
194
|
+
*.crt
|
|
195
|
+
*.cert
|
|
196
|
+
certificates/
|
|
197
|
+
|
|
198
|
+
# Test outputs
|
|
199
|
+
test_results/
|
|
200
|
+
test_output/
|
|
201
|
+
|
|
202
|
+
# Documentation builds
|
|
203
|
+
docs/_build/
|
|
204
|
+
docs/build/
|
|
205
|
+
|
|
206
|
+
# MacOS
|
|
207
|
+
.DS_Store
|
|
208
|
+
.AppleDouble
|
|
209
|
+
.LSOverride
|
|
210
|
+
|
|
211
|
+
# Windows
|
|
212
|
+
Thumbs.db
|
|
213
|
+
ehthumbs.db
|
|
214
|
+
Desktop.ini
|
|
215
|
+
|
|
216
|
+
# Linux
|
|
217
|
+
*~
|
|
218
|
+
|
|
219
|
+
# UV specific
|
|
220
|
+
.uv/
|
|
221
|
+
|
|
222
|
+
# Runtime files
|
|
223
|
+
*.pid
|
|
224
|
+
*.sock
|
|
225
|
+
|
|
226
|
+
# Database files (if any)
|
|
227
|
+
*.db
|
|
228
|
+
*.sqlite
|
|
229
|
+
*.sqlite3
|
|
230
|
+
|
|
231
|
+
# Cache directories
|
|
232
|
+
.cache/
|
|
233
|
+
cache/
|
|
234
|
+
|
|
235
|
+
# ruff cache
|
|
236
|
+
.ruff_cache/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.14.9
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff-check
|
|
6
|
+
args: [--fix]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/commitizen-tools/commitizen
|
|
10
|
+
rev: v4.10.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: commitizen
|
|
13
|
+
- id: commitizen-branch
|
|
14
|
+
stages:
|
|
15
|
+
- pre-push
|
|
16
|
+
|
|
17
|
+
- repo: local
|
|
18
|
+
hooks:
|
|
19
|
+
- id: pytest
|
|
20
|
+
name: pytest
|
|
21
|
+
entry: uv run pytest
|
|
22
|
+
language: system
|
|
23
|
+
types: [python]
|
|
24
|
+
pass_filenames: false
|
|
25
|
+
always_run: true
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
## v1.2.2 (2025-12-18)
|
|
2
|
+
|
|
3
|
+
### Fix
|
|
4
|
+
|
|
5
|
+
- **publish**: change trigger from release types to push tags for PyPI publishing
|
|
6
|
+
|
|
7
|
+
## v1.2.1 (2025-12-18)
|
|
8
|
+
|
|
9
|
+
### Fix
|
|
10
|
+
|
|
11
|
+
- **publish**: update release types to include 'created'
|
|
12
|
+
|
|
13
|
+
## v1.2.0 (2025-12-18)
|
|
14
|
+
|
|
15
|
+
### Feat
|
|
16
|
+
|
|
17
|
+
- **publish**: add workflow for publishing to PyPI and configuration
|
|
18
|
+
- **pre-commit**: add commitizen hooks for conventional commits
|
|
19
|
+
- **deps**: add commitizen for conventional commits
|
|
20
|
+
|
|
21
|
+
### Fix
|
|
22
|
+
|
|
23
|
+
- **docker**: update base image to alpine3.23 and improve uv installation commands
|
|
24
|
+
|
|
25
|
+
## v1.1.0 (2025-10-18)
|
|
26
|
+
|
|
27
|
+
### Feat
|
|
28
|
+
|
|
29
|
+
- add MCP transport configuration and support for multiple transport types
|
|
30
|
+
|
|
31
|
+
## v1.0.1 (2025-10-18)
|
|
32
|
+
|
|
33
|
+
## v1.0.0 (2025-08-09)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
FROM python:3.13-alpine3.23 AS builder
|
|
2
|
+
|
|
3
|
+
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip \
|
|
4
|
+
&& pip install --root-user-action=ignore --no-cache-dir uv
|
|
5
|
+
|
|
6
|
+
ENV UV_LINK_MODE=copy
|
|
7
|
+
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
11
|
+
--mount=type=bind,source=uv.lock,target=uv.lock \
|
|
12
|
+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
13
|
+
uv sync --locked --no-install-project --no-dev
|
|
14
|
+
|
|
15
|
+
COPY pyproject.toml uv.lock LICENSE README.md run_server.py ./
|
|
16
|
+
COPY src/ ./src/
|
|
17
|
+
|
|
18
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
19
|
+
uv sync --locked --no-dev
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
FROM python:3.13-alpine3.23
|
|
23
|
+
LABEL org.opencontainers.image.title="LibreNMS MCP Server" \
|
|
24
|
+
org.opencontainers.image.description="MCP server for LibreNMS management" \
|
|
25
|
+
org.opencontainers.image.url="https://github.com/mhajder/librenms-mcp" \
|
|
26
|
+
org.opencontainers.image.source="https://github.com/mhajder/librenms-mcp" \
|
|
27
|
+
org.opencontainers.image.vendor="Mateusz Hajder" \
|
|
28
|
+
org.opencontainers.image.licenses="MIT"
|
|
29
|
+
ENV PYTHONUNBUFFERED=1
|
|
30
|
+
|
|
31
|
+
RUN apk add --no-cache ca-certificates \
|
|
32
|
+
&& addgroup -g 1000 appuser \
|
|
33
|
+
&& adduser -D -u 1000 -G appuser appuser
|
|
34
|
+
|
|
35
|
+
COPY --from=builder --chown=appuser:appuser /app /app
|
|
36
|
+
|
|
37
|
+
WORKDIR /app
|
|
38
|
+
|
|
39
|
+
USER appuser
|
|
40
|
+
|
|
41
|
+
ENV PATH="/app/.venv/bin:$PATH"
|
|
42
|
+
|
|
43
|
+
CMD ["python", "-u", "run_server.py"]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
FROM python:3.13-alpine3.23 AS builder
|
|
2
|
+
|
|
3
|
+
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip \
|
|
4
|
+
&& pip install --root-user-action=ignore --no-cache-dir uv
|
|
5
|
+
|
|
6
|
+
ENV UV_LINK_MODE=copy
|
|
7
|
+
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
11
|
+
--mount=type=bind,source=uv.lock,target=uv.lock \
|
|
12
|
+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
13
|
+
uv sync --locked --no-install-project --no-dev \
|
|
14
|
+
&& uv pip install mcpo
|
|
15
|
+
|
|
16
|
+
COPY pyproject.toml uv.lock LICENSE README.md run_server.py ./
|
|
17
|
+
COPY src/ ./src/
|
|
18
|
+
|
|
19
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
20
|
+
uv sync --locked --no-dev \
|
|
21
|
+
&& uv pip install mcpo
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
FROM python:3.13-alpine3.23
|
|
25
|
+
LABEL org.opencontainers.image.title="LibreNMS MCP Server (MCPO)" \
|
|
26
|
+
org.opencontainers.image.description="MCP server for LibreNMS management with MCPO" \
|
|
27
|
+
org.opencontainers.image.url="https://github.com/mhajder/librenms-mcp" \
|
|
28
|
+
org.opencontainers.image.source="https://github.com/mhajder/librenms-mcp" \
|
|
29
|
+
org.opencontainers.image.vendor="Mateusz Hajder" \
|
|
30
|
+
org.opencontainers.image.licenses="MIT"
|
|
31
|
+
ENV PYTHONUNBUFFERED=1
|
|
32
|
+
|
|
33
|
+
RUN apk add --no-cache ca-certificates \
|
|
34
|
+
&& addgroup -g 1000 appuser \
|
|
35
|
+
&& adduser -D -u 1000 -G appuser appuser
|
|
36
|
+
|
|
37
|
+
COPY --from=builder --chown=appuser:appuser /app /app
|
|
38
|
+
|
|
39
|
+
WORKDIR /app
|
|
40
|
+
|
|
41
|
+
USER appuser
|
|
42
|
+
|
|
43
|
+
ENV PATH="/app/.venv/bin:$PATH"
|
|
44
|
+
|
|
45
|
+
HEALTHCHECK \
|
|
46
|
+
--interval=30s \
|
|
47
|
+
--timeout=10s \
|
|
48
|
+
--start-period=30s \
|
|
49
|
+
--retries=3 \
|
|
50
|
+
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/openapi.json || exit 1
|
|
51
|
+
|
|
52
|
+
EXPOSE 8000
|
|
53
|
+
|
|
54
|
+
CMD ["sh", "-c", "if [ -n \"$MCPO_API_KEY\" ]; then exec mcpo --api-key \"$MCPO_API_KEY\" -- python -u run_server.py; else exec mcpo -- python -u run_server.py; fi"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mateusz Hajder
|
|
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.
|