xemantic-ai-tool-schema-mdc
Adapting xemantic-ai-tool-schema to Model Context Protocol kotlin-sdk Tool input
claude mcp add --transport stdio xemantic-xemantic-ai-tool-schema-mdc docker run -i xemantic/xemantic-ai-tool-schema-mdc \ --env JAVA_HOME="path to Java installation or placeholder" \ --env GRADLE_OPTS="optional Gradle options"
How to use
The xemantic-ai-tool-schema-mdc MCP server provides a Model Context Protocol (MCP) adapter for the xemantic-ai-tool-schema Kotlin library. It enables generating MDC-compatible JSON Schema representations for Kotlin data classes via the Tool.Input abstraction used in the MCP ecosystem. The library allows you to express schema information for serialized Kotlin classes and convert them into a tool input that can be consumed by downstream MDC tooling. In practice, you would use the provided mdcToolInput<T>() function in your Kotlin project to obtain a Tool.Input instance that reflects the structure of your data class.
To leverage this within an MCP workflow, create or import your Kotlin data classes, annotate or structure them as needed, and then use the mdcToolInput function to generate the Tool.Input representation. This adapter focuses on expanding the JSON Schema expressivity beyond the limited Tool.Input options by enabling automatic MDC-compatible JSON Schema generation from serializable Kotlin classes. You can inspect the example Foo class usage in the README and tests, where Foo with a bar: String becomes a corresponding Tool.Input instance for MDC processing.
How to install
Prerequisites:
- Java JDK 8+ and a compatible Kotlin/Gradle environment
- Docker (for running the MCP server image) or a local Java/Kotlin build setup
- Git
Step-by-step installation:
-
Install Docker if you don’t already have it: https://docs.docker.com/get-docker/
-
Pull and run the MDC-compatible Docker image (as defined by the MCP setup):
# Pull the image (already included in mcp_config example)
docker pull xemantic/xemantic-ai-tool-schema-mdc
# Run the container in interactive mode (adjust ports or mounts as needed)
docker run -i xemantic/xemantic-ai-tool-schema-mdc
- If you prefer a local Kotlin/Gradle setup (alternative to using Docker):
# Clone the repository
git clone https://github.com/xemantic/xemantic-ai-tool-schema-mdc.git
cd xemantic-ai-tool-schema-mdc
# Build the project (requires Gradle and Kotlin tooling)
./gradlew build
# Run tests (optional)
./gradlew test
- Use the library in your Kotlin project by adding the dependency (as shown in the README):
dependencies {
implementation("com.xemantic.ai:xemantic-ai-tool-schema-mdc:0.1.1")
}
- If you’re packaging this for MDC usage in a pipeline, configure your MCP to point to the Docker image or to the local artifact as appropriate.
Additional notes
Notes and tips:
- The project publishes as a Maven artifact (com.xemantic.ai:xemantic-ai-tool-schema-mdc). There is no npm package for this MCP server variant, so npm_package is null.
- The primary entry point is the mdcToolInput<T>() Kotlin function used to derive Tool.Input from a serializable Kotlin class.
- When running via Docker, ensure that your environment variables (e.g., JAVA_HOME) are set correctly inside the container if needed by the toolchain.
- If you need to customize schema generation, look into the JsonSchema-related classes in the xemantic-ai-tool-schema project and how they map to Tool.Input in the MDC Kotlin SDK.
- For CI environments, consider mounting the project sources and running ./gradlew build within an image to ensure consistent builds.
Related MCP Servers
bytebot
Bytebot is a self-hosted AI desktop agent that automates computer tasks through natural language commands, operating within a containerized Linux desktop environment.
sdk-python
A model-driven approach to building AI agents in just a few lines of code.
tools
A set of tools that gives agents powerful capabilities.
DeepMCPAgent
Model-agnostic plug-n-play LangChain/LangGraph agents powered entirely by MCP tools over HTTP/SSE.
samples
Agent samples built using the Strands Agents SDK.
volcano-agent-sdk
🌋 Build AI agents that seamlessly combine LLM reasoning with real-world actions via MCP tools — in just a few lines of TypeScript.