Skip to content

Add comprehensive tool coverage for Dokploy API#17

Draft
limehawk wants to merge 3 commits intoDokploy:mainfrom
limehawk:feature/openapi-sync
Draft

Add comprehensive tool coverage for Dokploy API#17
limehawk wants to merge 3 commits intoDokploy:mainfrom
limehawk:feature/openapi-sync

Conversation

@limehawk
Copy link

@limehawk limehawk commented Jan 27, 2026

Summary

This PR resolves the issue where MCP tools with large/complex schemas fail to execute properly (e.g., compose-update with 43 fields, application-update with 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

  • Upgrade to Zod v4 for native z.toJSONSchema() with target: "draft-2020-12" support
  • Pre-convert schemas before MCP SDK registration to bypass SDK's draft-07 conversion
  • Normalize response IDs to top level for consistent LLM tool chaining (e.g., data.projectId always accessible)
  • Fix Zod v4 breaking changes:
    • z.record(z.string())z.record(z.string(), z.string())
    • ZodError.errorsZodError.issues

Testing

Verified with 8 comprehensive scenarios against a live Dokploy sandbox:

  1. ✅ Full application deployment workflow
  2. ✅ Database stack setup (PostgreSQL + MySQL)
  3. ✅ Docker Compose deployment with YAML
  4. ✅ Complex 87-field application updates
  5. ✅ Multi-environment setup (prod/staging/dev)
  6. ✅ Mounts and port mappings
  7. ✅ Git-based deployments
  8. ✅ Error handling validation

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.create

These operations succeed but LLMs cannot chain delete/update without querying for IDs first.


🤖 Generated with Claude Code

@limehawk limehawk marked this pull request as draft January 27, 2026 20:17
@yoinks-yoinks
Copy link

Great work! This comprehensive coverage is exactly what the community needs. Looking forward to seeing this merged!

@limehawk limehawk force-pushed the feature/openapi-sync branch from 403ca9e to 09589cc Compare February 2, 2026 17:18
@limehawk limehawk marked this pull request as ready for review February 2, 2026 17:20
@yoinks-yoinks
Copy link

Issue in this PR: MCP Tools with Large/Complex Schemas Fail to Execute Properly

Description:
Dokploy MCP tools that return large JSON responses or have complex parameter schemas are experiencing execution failures. This appears to be a schema validation or response size limitation issue in the MCP implementation.

Evidence:

Tools with extensive parameter schemas (like compose-update with multiple complex fields) show inconsistent behavior

Some tools work while others with similar complexity fail

Root Cause:

Potential schema validation timeout for complex parameter sets

Response size limits in MCP protocol handling

JSON parsing issues with deeply nested or large response objects

Reproduction Steps:

Call Dokploy MCP tools with complex schemas (compose-update, application management tools)

Observe inconsistent execution or timeout failures

Compare with simpler tools that work reliably

Proposed Resolution:

Implement response streaming for large JSON payloads

Add schema validation timeouts with configurable limits

Split complex tools into smaller, focused operations

Add response size monitoring and chunking

Impact: Blocks full utilization of Dokploy management capabilities through MCP

Priority: High - affects core functionality

@limehawk
Copy link
Author

limehawk commented Feb 5, 2026

Thank you for testing @yoinks-yoinks I'll look into this and add a commit. This may be a Zod3 vs. Zod4 thing

@limehawk limehawk force-pushed the feature/openapi-sync branch from 0bebf48 to 617d004 Compare February 5, 2026 18:04
- Upgrade to Zod v4 for native JSON Schema draft-2020-12 support
  (Claude API requires draft-2020-12, MCP SDK outputs draft-07)
- Normalize response IDs to top level for consistent LLM access
  (e.g., projectId, applicationId always at data.projectId)
- Fix Zod v4 breaking changes:
  - z.record() now requires 2 args: z.record(z.string(), z.string())
  - ZodError.errors → ZodError.issues
- Add talismanrc for false positive secret patterns

Tested with 8 comprehensive scenarios against live sandbox:
- Full application deployment workflow
- Database stack setup (PostgreSQL + MySQL)
- Docker Compose deployment
- Complex 87-field application updates
- Multi-environment setup
- Mounts and port mappings
- Git-based deployments
- Error handling validation
@limehawk limehawk force-pushed the feature/openapi-sync branch from 617d004 to 86bada1 Compare February 5, 2026 18:11
The SDK expects Zod schemas for input validation (calls safeParseAsync).
Passing raw JSON Schema objects broke all tool execution.
@limehawk limehawk marked this pull request as draft February 5, 2026 19:55
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.

2 participants