Skip to content

feat: add websocket-based application log tools#20

Open
Azilone wants to merge 3 commits intoDokploy:mainfrom
Azilone:feat/add-dokploy-log-tools
Open

feat: add websocket-based application log tools#20
Azilone wants to merge 3 commits intoDokploy:mainfrom
Azilone:feat/add-dokploy-log-tools

Conversation

@Azilone
Copy link

@Azilone Azilone commented Feb 19, 2026

Summary

  • add application-readContainerLogs (websocket snapshot from /docker-container-logs)
  • add application-readDeploymentLogs (websocket snapshot from /listen-deployment)
  • add shared websocket collector utility with timeout/truncation safeguards
  • harden stream handling (single-settle, handshake timeout, optional auth header)
  • accept numeric tail input for better client compatibility
  • update docs (README.md, TOOLS.md) and register tools

Why

Dokploy exposes logs in the UI via websocket, but MCP only exposed deployment metadata (logPath).
This adds a clean, read-only way to fetch real log snapshots through MCP.

Validation

  • npm run type-check
  • npm run lint
  • npm run build
  • manual call tests against a real Dokploy instance:
    • application-readDeploymentLogs
    • application-readContainerLogs

Notes

  • tools are read-only and bounded by timeoutMs + maxChars to keep responses stable
  • defaults remain conservative (timeoutMs=5000, maxChars=30000)

@Azilone
Copy link
Author

Azilone commented Feb 19, 2026

Closing for now per latest validation feedback; will revisit with a safer approach.

@Azilone Azilone closed this Feb 19, 2026
@Azilone Azilone reopened this Feb 19, 2026
@Azilone Azilone changed the title feat: add websocket-based tools to read Dokploy logs feat: add websocket-based application log tools Feb 20, 2026
@Azilone
Copy link
Author

Azilone commented Feb 20, 2026

Quick recap of the changes since the previous version (before the PR was closed/reopened):

✅ Added/Adjusted

  • Added 2 websocket log tools:

  • application-readContainerLogs

  • application-readDeploymentLogs

  • Added a common utility collectWebSocketLogs (handles timeout + maxChars + bounded snapshots).

  • Fixed TypeScript compatibility for the streamable transport (http-server.ts).

🔧 Hardening (Post-Implementation)

  • tail now accepts string or number (improves client compatibility).
  • Reinforced websocket robustness:
  • Ensured unique finalization (prevents double resolve/reject).
  • Added handshakeTimeout.
  • Auth header is now only added if present.

🧪 Revalidation

  • npm run type-check
  • npm run lint
  • npm run build
  • Manual tests on a live Dokploy instance:
  • Deployment logs reading ✅
  • Container logs reading ✅

If you'd like, I can also add targeted unit tests for collectWebSocketLogs (covering timeout, truncation, and close/error paths) within this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant