Skip to content

dbeaver/pro#11120 Add shared MCP function service API - #17

Merged
serge-rider merged 7 commits into
develfrom
dbeaver/pro#11120-ai-service-api
Oct 27, 2026
Merged

serge-rider merged 7 commits into
develfrom
dbeaver/pro#11120-ai-service-api

Conversation

@labanovichttps

@labanovichttps labanovichttps commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds com.dbeaver.datadam.mcp.api, a shared OSGi/Maven contract for desktop MCP functions, consumed by https://github.com/dbeaver/datadam/pull/156.

DDMcpFunctionService provides synchronous getFunctions() and callFunction(call) methods with typed descriptors, calls and JSON results. Its shared RPC topic is dbeaver.mcp.functions. The module, packages and classes use MCP naming. Both peers must update together because RPC operation IDs include Java argument type names.

Desktop implementations register the service on their existing Remote DAM RPC endpoint. The contract documents JSON null/number preservation, desktop authorization responsibilities and error/cancellation semantics without adding a separate transport.

Validation: three contract serialization tests pass, plus the consuming MCP reactor and HTTP/WebSocket integration test. Checkstyle with nullability validation passes and IntelliJ workspace was regenerated.

The same API commit is published on dbeaver/pro#11120-mcp-service for the server CI's sibling dependency selection.

Related to https://github.com/dbeaver/pro/issues/11120.

@labanovichttps labanovichttps changed the title dbeaver/pro#11120 Add shared AI function service API dbeaver/pro#11120 Add shared MCP function service API Oct 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Resolve the RPC exception contract mismatch and align the README wire-format and numeric-precision documentation with the shared API.

2 open issues
What changed in this PR

Adds a shared OSGi/Maven API for discovering and invoking desktop MCP functions over the existing Remote DAM RPC transport.

Changes:

  • Adds the com.dbeaver.datadam.mcp.api module and exports its service, model, and exception packages.
  • Defines MCP function descriptors, parameters, calls, results, error codes, and service operations.
  • Adds serialization contract tests and documents RPC registration, authorization, error handling, and JSON behavior.

Open review items include aligning README examples with the exported DTO and numeric handling, and reconciling the checked exception contract with Remote DAM RPC exception behavior.

File Summary
README.md Documents the MCP function API and Remote DAM registration guidance.
apis/​pom.xml Registers the new MCP API module in the Maven reactor.
apis/​com.dbeaver.datadam.mcp.api/​src/​test/​java/​com/​dbeaver/​datadam/​mcp/​api/​DDMcpFunctionContractTest.java Verifies descriptor, argument, numeric, null, and result serialization.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​service/​DDMcpFunctionService.java Defines the synchronous MCP function RPC service contract.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​model/​DDMcpFunctionResult.java Defines JSON results and execution-error status.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​model/​DDMcpFunctionParameter.java Defines typed function parameter metadata.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​model/​DDMcpFunctionErrorCode.java Defines function error categories.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​model/​DDMcpFunctionDescriptor.java Defines function metadata and parameters.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​model/​DDMcpFunctionCall.java Defines function invocation arguments.
apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​exception/​DDMcpFunctionException.java Defines typed function exceptions and optional error data.
apis/​com.dbeaver.datadam.mcp.api/​pom.xml Defines module dependencies and test configuration.
apis/​com.dbeaver.datadam.mcp.api/​META-INF/​MANIFEST.MF Configures OSGi exports and package imports.
apis/​com.dbeaver.datadam.mcp.api/​build.properties Configures Eclipse bundle source and build output.

Review effort: Lite

Comment thread README.md Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Moderate contract-validation issues remain for invalid descriptors and null function results.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Reject null result values during decoding

apis/​com.dbeaver.datadam.mcp.api/​src/​main/​java/​com/​dbeaver/​datadam/​mcp/​api/​model/​DDMcpFunctionResult.java:23

The README contract says results must use JsonNull.INSTANCE and never a Java null, but this record accepts null directly and Gson can also produce a null value when the value member is missing. That invalid result then passes the RPC return-type check and can reach the MCP server as a Java null. Reject null in a compact constructor so malformed peers fail during decoding instead of violating the service contract.

2 resolved since last review

Review effort: Lite

@serge-rider
serge-rider merged commit ae0f5d4 into devel Oct 27, 2026
4 checks passed
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.

4 participants