Skip to content

Replace individual tools with 2 generic tools powered by live OpenAPI spec#25

Open
limehawk wants to merge 1 commit intoDokploy:mainfrom
limehawk:feature/openapi-sync
Open

Replace individual tools with 2 generic tools powered by live OpenAPI spec#25
limehawk wants to merge 1 commit intoDokploy:mainfrom
limehawk:feature/openapi-sync

Conversation

@limehawk
Copy link

Summary

Replaces all individual MCP tools with 2 generic tools that provide full coverage of the entire Dokploy API (454 operations across 44 categories) with zero maintenance overhead.

  • dokploy-api — Executes any Dokploy API operation. HTTP method (GET/POST) is auto-detected from the live OpenAPI spec.
  • dokploy-api-schema — Discovers available operations and their parameter schemas by introspecting the OpenAPI spec. Resolves $ref, allOf, and oneOf so LLMs get complete type information.

Both tools share a single cached spec fetch, so the server hits the Dokploy API exactly once on first use.

Why this approach?

The current MCP server has ~32 hand-coded tools covering 5 categories. This takes a different approach — no individual tool files, no static operation lists, no manual method mapping:

Current repo This PR
Tools registered ~32 (5 categories) 2 (all 44 categories)
Operations covered ~32 454
New Dokploy endpoints Requires new tool file Available automatically
Launch token overhead ~70k at scale ~2k
Method detection Hard-coded per tool Derived from OpenAPI spec

When Dokploy adds new API endpoints, this server picks them up on next restart. No code changes, no PRs, no maintenance.

What changed

  • Added src/mcp/tools/api.ts — generic API executor (138 lines)
  • Added src/mcp/tools/apiSchema.ts — schema discovery with recursive $ref resolution (227 lines)
  • Added src/utils/openApiSpec.ts — shared OpenAPI spec cache (75 lines)
  • Removed all individual tool files (67 files, ~4700 lines deleted)
  • Removed toolFactory.ts
  • Updated README.md and TOOLS.md

Net: -3,239 lines, full API coverage, zero maintenance.

Tested against live Dokploy server

Verified across 25+ categories including:

  • Project: create, all, one, update, remove (cascade deletes children)
  • Application: create, deploy, environment, monitoring, traefik config
  • Compose: create, update (sourceType raw), deploy, stop, start, loadServices, randomizeCompose, getConvertedCompose, templates
  • Databases: postgres create/deploy, redis create/deploy/stop, mongo create, mariadb create
  • Domain: create, update, delete, validate, generateDomain
  • Infrastructure: settings (health, version, IP, traefik), swarm nodes, docker containers, certificates, organization
  • Schema discovery: category listing (44 categories), operation listing, full parameter resolution with nested $ref/allOf/oneOf
  • Error handling: 400/401/403/404/422/5xx all return actionable messages with Dokploy's actual validation details

Test plan

  • Connect to a Dokploy server
  • dokploy-api with settings.health (no-param GET)
  • dokploy-api with project.all (list operation)
  • dokploy-api with project.create then project.remove (POST mutation lifecycle)
  • dokploy-api-schema with no params (category overview — expect 44 categories)
  • dokploy-api-schema with operation: "application.create" (full parameter schema with types and required flags)
  • Verify categories not in current repo (e.g. compose, redis, mongo, backup, schedule) are accessible

@limehawk limehawk force-pushed the feature/openapi-sync branch 3 times, most recently from 6748292 to 9446e07 Compare March 11, 2026 05:57
dokploy-api executes any operation; dokploy-api-schema returns parameter
schemas. Both derive from the live Dokploy OpenAPI spec at startup —
zero maintenance when endpoints change. Covers all 454 operations across
44 categories.
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