Add comprehensive tool coverage for Dokploy API#17
Add comprehensive tool coverage for Dokploy API#17limehawk wants to merge 10 commits intoDokploy:mainfrom
Conversation
|
Great work! This comprehensive coverage is exactly what the community needs. Looking forward to seeing this merged! |
This PR adds 250+ new MCP tools covering the complete Dokploy API, synced with the official OpenAPI specification. New tool categories: - admin: Server monitoring setup - ai: AI assistant management (create, deploy, suggest) - backup: Database and volume backup management - certificates: SSL certificate management - cluster: Swarm cluster node management - compose: Docker Compose project lifecycle - database: Unified database tools (postgres, mysql, mongo, mariadb, redis) - deployment: Deployment history and process management - destination: Backup destination configuration - docker: Container and config management - environment: Project environment management - git: Git provider and repository integration - mounts: File, bind, and volume mount management - notification: Multi-provider notification setup - organization: Organization and invitation management - port: Port mapping configuration - previewDeployment: Preview deployment management - redirects: URL redirect configuration - registry: Docker registry management - rollback: Deployment rollback functionality - schedule: Scheduled task management - security: Security rule configuration - server: Remote server management - settings: System settings and Traefik configuration - sshKey: SSH key management - stripe: Billing integration - swarm: Docker Swarm node information - user: User and permission management All tools include: - Zod schema validation matching OpenAPI spec - Detailed parameter descriptions for LLM usability - Proper error handling and response formatting
403ca9e to
09589cc
Compare
|
Issue in this PR: MCP Tools with Large/Complex Schemas Fail to Execute Properly Description: Evidence: Root Cause: Reproduction Steps: Proposed Resolution: Impact: Blocks full utilization of Dokploy management capabilities through MCP Priority: High - affects core functionality |
|
Thank you for testing @yoinks-yoinks I'll look into this and add a commit. This may be a Zod3 vs. Zod4 thing |
617d004 to
86bada1
Compare
Replaces 312 individual MCP tools with two: dokploy-api (executes any operation) and dokploy-api-schema (discovers operations and params from OpenAPI spec).
Addresses review findings: adds mongo/mariadb/redis categories, missing gitProvider operations, specifies api-schema output format, corrects error handling as new vs preserved, documents polymorphic endpoint flattening.
6 tasks: create api.ts, apiSchema.ts, rewire server, delete old tools, build/verify, update docs. Fixes from review: proper AxiosError status checking, recursive $ref/allOf schema resolution, depth guard against circular refs.
Auto-detect GET vs POST via static set of known GET operations. LLM only needs to provide operation and params.
…chema - dokploy-api: executes any Dokploy API operation with auto-detected HTTP method (GET/POST) via static operations set - dokploy-api-schema: discovers operation parameters from OpenAPI spec with lazy fetch and in-memory caching - Removes all 33 category directories and toolFactory.ts - Adds index signature to FormattedResponse for MCP SDK compatibility - Reduces tool registration from ~70k tokens to ~2k on launch
Replace 170 lines of hand-maintained static lists with dynamic derivation from the Dokploy OpenAPI spec at startup. Both tools now share a single cached spec fetch via utils/openApiSpec.ts. Also surfaces Dokploy's actual error message on 400 responses instead of swallowing it.
539f7d2 to
dd68ff5
Compare
|
Closing in favor of a new PR with an updated description. This branch evolved significantly since the original PR:
The original description no longer reflects what's being delivered. Opening a fresh PR with the full story. |
|
@yoinks-yoinks check out the new method on PR 25 and test it. Appreciate your feedback. |
Summary
This PR resolves the issue where MCP tools with large/complex schemas fail to execute properly (e.g.,
compose-updatewith 43 fields,application-updatewith 87 fields).Root Cause
Claude API requires JSON Schema draft-2020-12, but the MCP SDK's default Zod-to-JSON-Schema conversion outputs draft-07, causing schema validation failures.
Fixes
z.toJSONSchema()withtarget: "draft-2020-12"supportdata.projectIdalways accessible)z.record(z.string())→z.record(z.string(), z.string())ZodError.errors→ZodError.issuesTesting
Verified with 8 comprehensive scenarios against a live Dokploy sandbox:
All scenarios pass with proper cleanup (0 orphaned resources).
API Limitations Documented
Some Dokploy API endpoints don't return IDs on create:
mounts.create,port.create,redirects.create,security.createThese operations succeed but LLMs cannot chain delete/update without querying for IDs first.
🤖 Generated with Claude Code