Compare commits
14 Commits
v0.2.2
...
fix/release
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b5bb1cc81 | |||
| 847a69e2ba | |||
| 186d2c1d94 | |||
| 96d5789200 | |||
| b332c54330 | |||
| 9a05b171ae | |||
| e93eb9d302 | |||
| 5af7c25dab | |||
| a0b9482915 | |||
| 85b9a14fc6 | |||
| e53f4dc2dc | |||
| 8147f237cd | |||
| d4966fc925 | |||
| f173e957f3 |
@@ -18,14 +18,14 @@ jobs:
|
|||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
|
||||||
- name: Create bump and changelog
|
- name: Create bump and changelog
|
||||||
uses: commitizen-tools/commitizen-action@0.24.0
|
uses: commitizen-tools/commitizen-action@5b0848cd060263e24602d1eba03710e056ef7711 # 0.24.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||||
changelog_increment_filename: body.md
|
changelog_increment_filename: body.md
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
|
||||||
with:
|
with:
|
||||||
body_path: "body.md"
|
body_path: "body.md"
|
||||||
tag_name: v${{ env.REVISION }}
|
tag_name: v${{ env.REVISION }}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ name: Build and Publish Docker Image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
tags: ["*"]
|
tags: ["*"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -16,14 +16,8 @@ jobs:
|
|||||||
uses: hoverkraft-tech/compose-action@8be2d741e891ac9b8ac20825e6f3904149599925 # v2.2.0
|
uses: hoverkraft-tech/compose-action@8be2d741e891ac9b8ac20825e6f3904149599925 # v2.2.0
|
||||||
with:
|
with:
|
||||||
compose-file: "./docker-compose.yml"
|
compose-file: "./docker-compose.yml"
|
||||||
|
- name: Install the latest version of uv
|
||||||
- name: Install dependencies
|
uses: astral-sh/setup-uv@v6
|
||||||
run: |
|
|
||||||
sudo apt update -y && sudo apt install -y pipx
|
|
||||||
pipx install uv
|
|
||||||
uv sync --locked
|
|
||||||
env:
|
|
||||||
DEBIAN_FRONTEND: "noninteractive"
|
|
||||||
|
|
||||||
- name: Wait for service to be ready
|
- name: Wait for service to be ready
|
||||||
run: |
|
run: |
|
||||||
@@ -41,10 +35,6 @@ jobs:
|
|||||||
done
|
done
|
||||||
echo "Service is ready (returned 401)."
|
echo "Service is ready (returned 401)."
|
||||||
|
|
||||||
- name: Install notes app
|
|
||||||
run: |
|
|
||||||
docker compose exec app php occ app:enable notes
|
|
||||||
|
|
||||||
# Add subsequent steps here, e.g., running tests
|
# Add subsequent steps here, e.g., running tests
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
@@ -52,4 +42,4 @@ jobs:
|
|||||||
NEXTCLOUD_USERNAME: "admin"
|
NEXTCLOUD_USERNAME: "admin"
|
||||||
NEXTCLOUD_PASSWORD: "admin"
|
NEXTCLOUD_PASSWORD: "admin"
|
||||||
run: |
|
run: |
|
||||||
uv run python -m pytest
|
uv run --frozen python -m pytest
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
## 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)
|
## v0.2.2 (2025-05-24)
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
|||||||
+1
-5
@@ -6,8 +6,4 @@ COPY . .
|
|||||||
|
|
||||||
RUN uv sync --locked
|
RUN uv sync --locked
|
||||||
|
|
||||||
ENV VIRTUAL_ENV=/app/.venv
|
CMD ["uv", "run", "--locked", "mcp", "run", "--transport", "sse", "nextcloud_mcp_server/server.py:mcp"]
|
||||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
||||||
ENV FASTMCP_LOG_LEVEL=DEBUG
|
|
||||||
|
|
||||||
CMD ["mcp", "run", "--transport", "sse", "nextcloud_mcp_server/server.py:mcp"]
|
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
php /var/www/html/occ app:enable notes
|
||||||
@@ -34,6 +34,7 @@ services:
|
|||||||
- db
|
- db
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
- ./app-hooks/post-installation:/docker-entrypoint-hooks.d/post-installation:ro
|
||||||
environment:
|
environment:
|
||||||
- NEXTCLOUD_TRUSTED_DOMAINS=app
|
- NEXTCLOUD_TRUSTED_DOMAINS=app
|
||||||
- NEXTCLOUD_ADMIN_USER=admin
|
- NEXTCLOUD_ADMIN_USER=admin
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
import time # Import time for sleep
|
|
||||||
import mimetypes
|
import mimetypes
|
||||||
from io import BytesIO
|
|
||||||
from httpx import (
|
from httpx import (
|
||||||
Client,
|
Client,
|
||||||
Auth,
|
Auth,
|
||||||
BasicAuth,
|
BasicAuth,
|
||||||
Headers,
|
|
||||||
Request,
|
Request,
|
||||||
Response,
|
Response,
|
||||||
HTTPStatusError,
|
HTTPStatusError,
|
||||||
@@ -211,7 +208,7 @@ class NextcloudClient:
|
|||||||
score = self.calculate_score(query_tokens, title_tokens, content_tokens)
|
score = self.calculate_score(query_tokens, title_tokens, content_tokens)
|
||||||
|
|
||||||
# Only include notes with a non-zero score
|
# Only include notes with a non-zero score
|
||||||
if score > 0:
|
if score >= 0.5:
|
||||||
search_results.append({
|
search_results.append({
|
||||||
"id": note.get("id"),
|
"id": note.get("id"),
|
||||||
"title": note.get("title"),
|
"title": note.get("title"),
|
||||||
|
|||||||
@@ -4,11 +4,8 @@ LOGGING_CONFIG = {
|
|||||||
"version": 1,
|
"version": 1,
|
||||||
"handlers": {
|
"handlers": {
|
||||||
"default": {
|
"default": {
|
||||||
"class": "logging.FileHandler",
|
"class": "logging.StreamHandler",
|
||||||
"formatter": "http",
|
"formatter": "http",
|
||||||
# "stream": "ext://sys.stderr"
|
|
||||||
"filename": "/tmp/nextcloud-mcp-server.log",
|
|
||||||
"mode": "a",
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"formatters": {
|
"formatters": {
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import asyncio # Import asyncio
|
|||||||
|
|
||||||
setup_logging()
|
setup_logging()
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class AppContext:
|
class AppContext:
|
||||||
@@ -23,11 +21,9 @@ class AppContext:
|
|||||||
async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
|
async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
|
||||||
"""Manage application lifecycle with type-safe context"""
|
"""Manage application lifecycle with type-safe context"""
|
||||||
# Initialize on startup
|
# Initialize on startup
|
||||||
logger.info("Creating Nextcloud client")
|
logging.info("Creating Nextcloud client")
|
||||||
client = NextcloudClient.from_env()
|
client = NextcloudClient.from_env()
|
||||||
# Add a small delay to allow client initialization to complete
|
logging.info("Client initialization wait complete.")
|
||||||
logger.info("Waiting 2 seconds for client initialization...")
|
|
||||||
logger.info("Client initialization wait complete.")
|
|
||||||
try:
|
try:
|
||||||
yield AppContext(client=client)
|
yield AppContext(client=client)
|
||||||
finally:
|
finally:
|
||||||
@@ -38,6 +34,8 @@ async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
|
|||||||
# Create an MCP server
|
# Create an MCP server
|
||||||
mcp = FastMCP("Nextcloud MCP", lifespan=app_lifespan)
|
mcp = FastMCP("Nextcloud MCP", lifespan=app_lifespan)
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@mcp.resource("nc://capabilities")
|
@mcp.resource("nc://capabilities")
|
||||||
def nc_get_capabilities():
|
def nc_get_capabilities():
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nextcloud-mcp-server"
|
name = "nextcloud-mcp-server"
|
||||||
version = "0.2.2"
|
version = "0.2.4"
|
||||||
description = ""
|
description = ""
|
||||||
authors = [
|
authors = [
|
||||||
{name = "Chris Coutinho",email = "chris@coutinho.io"}
|
{name = "Chris Coutinho",email = "chris@coutinho.io"}
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nextcloud-mcp-server"
|
name = "nextcloud-mcp-server"
|
||||||
version = "0.2.2"
|
version = "0.2.4"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
|
|||||||
Reference in New Issue
Block a user