Compare commits

...

23 Commits

Author SHA1 Message Date
Chris Coutinho 2b5bb1cc81 fix: Commitizen release process
https://commitizen-tools.github.io/commitizen/tutorials/github_actions/
2025-05-25 12:47:10 +02:00
github-actions[bot] 847a69e2ba bump: version 0.2.3 → 0.2.4 2025-05-25 10:33:45 +00:00
Chris Coutinho 186d2c1d94 Merge pull request #34 from cbcoutinho/feature/logging
fix: Configure logging
2025-05-25 12:33:20 +02:00
Chris Coutinho 96d5789200 fix: Do not update dependencies when running in Dockerfile 2025-05-25 12:26:01 +02:00
Chris Coutinho b332c54330 ci: Setup uv using action, make sure uv runs tests without updating 2025-05-25 12:02:57 +02:00
Chris Coutinho 9a05b171ae ci: Install uv using curl 2025-05-25 11:55:21 +02:00
Chris Coutinho e93eb9d302 fix: Configure logging 2025-05-25 11:46:41 +02:00
Chris Coutinho 5af7c25dab Merge branch 'master' of github.com:cbcoutinho/nextcloud-mcp-server 2025-05-25 10:59:26 +02:00
Chris Coutinho a0b9482915 build: Only build on tags 2025-05-25 10:59:14 +02:00
github-actions[bot] 85b9a14fc6 bump: version 0.2.2 → 0.2.3 2025-05-25 08:57:33 +00:00
Chris Coutinho e53f4dc2dc Merge pull request #33 from cbcoutinho/feature/search
Limit search results to notes with score > 0.5
2025-05-25 10:57:05 +02:00
Chris Coutinho 8147f237cd fix: Limit search results to notes with score > 0.5
Add hooks to docker-compose rather than in CICD step
2025-05-25 10:48:59 +02:00
Chris Coutinho d4966fc925 Merge pull request #31 from cbcoutinho/renovate/pin-dependencies
chore(deps): pin dependencies
2025-05-25 08:51:19 +02:00
renovate-bot-cbcoutinho[bot] f173e957f3 chore(deps): pin dependencies 2025-05-25 04:03:51 +00:00
github-actions[bot] 78fd4eb54c bump: version 0.2.1 → 0.2.2 2025-05-24 22:37:16 +00:00
Chris Coutinho 93092a94cc Merge pull request #32 from cbcoutinho/renovate/actions-checkout-4.x
chore(deps): update actions/checkout action to v4
2025-05-25 00:36:44 +02:00
renovate-bot-cbcoutinho[bot] 914aef2861 chore(deps): update actions/checkout action to v4 2025-05-24 22:05:46 +00:00
Chris Coutinho fab0f3ef05 bump: version 0.2.0 → 0.2.1 2025-05-24 22:54:30 +02:00
Chris Coutinho 0e6ff3bdda Merge pull request #30 from cbcoutinho/feature/locked
Feature/locked
2025-05-24 22:52:03 +02:00
Chris Coutinho 37f031d13e fix: Install deps before checking service 2025-05-24 22:51:13 +02:00
Chris Coutinho 02e05dc8d0 ci: comments 2025-05-24 22:41:09 +02:00
Chris Coutinho 21019c6cff ci: use locked in test 2025-05-24 22:36:33 +02:00
Chris Coutinho 050d236312 build: Add v prefix to version 2025-05-24 22:29:23 +02:00
12 changed files with 49 additions and 43 deletions
+6 -6
View File
@@ -15,18 +15,18 @@ jobs:
packages: write
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@0.24.0
uses: commitizen-tools/commitizen-action@5b0848cd060263e24602d1eba03710e056ef7711 # 0.24.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
changelog_increment_filename: body.md
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
with:
body_path: "body.md"
tag_name: ${{ env.REVISION }}
tag_name: v${{ env.REVISION }}
token: ${{ secrets.GITHUB_TOKEN }}
@@ -2,7 +2,6 @@ name: Build and Publish Docker Image
on:
push:
branches: [ "master" ]
tags: ["*"]
jobs:
@@ -11,7 +10,6 @@ jobs:
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -22,7 +20,6 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
#cbcoutinho/nextcloud-mcp-server
ghcr.io/cbcoutinho/nextcloud-mcp-server
# generate Docker tags based on the following events/attributes
tags: |
+3 -13
View File
@@ -16,6 +16,8 @@ jobs:
uses: hoverkraft-tech/compose-action@8be2d741e891ac9b8ac20825e6f3904149599925 # v2.2.0
with:
compose-file: "./docker-compose.yml"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
- name: Wait for service to be ready
run: |
@@ -33,18 +35,6 @@ jobs:
done
echo "Service is ready (returned 401)."
- name: Install notes app
run: |
docker compose exec app php occ app:enable notes
- name: Install dependencies
run: |
sudo apt update -y && sudo apt install -y pipx
pipx install uv
uv sync --frozen
env:
DEBIAN_FRONTEND: "noninteractive"
# Add subsequent steps here, e.g., running tests
- name: Run tests
env:
@@ -52,4 +42,4 @@ jobs:
NEXTCLOUD_USERNAME: "admin"
NEXTCLOUD_PASSWORD: "admin"
run: |
uv run python -m pytest
uv run --frozen python -m pytest
+27
View File
@@ -1,3 +1,30 @@
## v0.2.4 (2025-05-25)
### Fix
- Do not update dependencies when running in Dockerfile
- Configure logging
## v0.2.3 (2025-05-25)
### Fix
- Limit search results to notes with score > 0.5
## v0.2.2 (2025-05-24)
### Fix
- Install deps before checking service
## v0.2.1 (2025-05-24)
### Fix
- Install deps before checking service
## v0.2.1 (2025-05-24)
## v0.2.0 (2025-05-24)
### Feat
+1 -5
View File
@@ -6,8 +6,4 @@ COPY . .
RUN uv sync --locked
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV FASTMCP_LOG_LEVEL=DEBUG
CMD ["mcp", "run", "--transport", "sse", "nextcloud_mcp_server/server.py:mcp"]
CMD ["uv", "run", "--locked", "mcp", "run", "--transport", "sse", "nextcloud_mcp_server/server.py:mcp"]
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
php /var/www/html/occ app:enable notes
+1
View File
@@ -34,6 +34,7 @@ services:
- db
volumes:
- nextcloud:/var/www/html
- ./app-hooks/post-installation:/docker-entrypoint-hooks.d/post-installation:ro
environment:
- NEXTCLOUD_TRUSTED_DOMAINS=app
- NEXTCLOUD_ADMIN_USER=admin
+1 -4
View File
@@ -1,12 +1,9 @@
import os
import time # Import time for sleep
import mimetypes
from io import BytesIO
from httpx import (
Client,
Auth,
BasicAuth,
Headers,
Request,
Response,
HTTPStatusError,
@@ -211,7 +208,7 @@ class NextcloudClient:
score = self.calculate_score(query_tokens, title_tokens, content_tokens)
# Only include notes with a non-zero score
if score > 0:
if score >= 0.5:
search_results.append({
"id": note.get("id"),
"title": note.get("title"),
+1 -4
View File
@@ -4,11 +4,8 @@ LOGGING_CONFIG = {
"version": 1,
"handlers": {
"default": {
"class": "logging.FileHandler",
"class": "logging.StreamHandler",
"formatter": "http",
# "stream": "ext://sys.stderr"
"filename": "/tmp/nextcloud-mcp-server.log",
"mode": "a",
}
},
"formatters": {
+4 -6
View File
@@ -11,8 +11,6 @@ import asyncio # Import asyncio
setup_logging()
logger = logging.getLogger(__name__)
@dataclass
class AppContext:
@@ -23,11 +21,9 @@ class AppContext:
async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
"""Manage application lifecycle with type-safe context"""
# Initialize on startup
logger.info("Creating Nextcloud client")
logging.info("Creating Nextcloud client")
client = NextcloudClient.from_env()
# Add a small delay to allow client initialization to complete
logger.info("Waiting 2 seconds for client initialization...")
logger.info("Client initialization wait complete.")
logging.info("Client initialization wait complete.")
try:
yield AppContext(client=client)
finally:
@@ -38,6 +34,8 @@ async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
# Create an MCP server
mcp = FastMCP("Nextcloud MCP", lifespan=app_lifespan)
logger = logging.getLogger(__name__)
@mcp.resource("nc://capabilities")
def nc_get_capabilities():
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "nextcloud-mcp-server"
version = "0.2.0"
version = "0.2.4"
description = ""
authors = [
{name = "Chris Coutinho",email = "chris@coutinho.io"}
Generated
+1 -1
View File
@@ -492,7 +492,7 @@ wheels = [
[[package]]
name = "nextcloud-mcp-server"
version = "0.2.0"
version = "0.2.4"
source = { editable = "." }
dependencies = [
{ name = "httpx" },