Get the FREE Ultimate OpenClaw Setup Guide →

aj

Simple MCP SDK in Java

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lightweight-component-aj-mcp java -jar path/to/aj-mcp-server.jar \
  --env MCP_LOG_LEVEL="INFO" \
  --env MCP_CONFIG_PATH="path/to/config"

How to use

AJ-MCP is a lightweight Java MCP SDK server designed to implement the Model Context Protocol in Java applications. It provides a foundation to expose your data sources and business logic via MCP-compliant models and endpoints, with Spring Boot 2.x compatibility for easy integration into existing Java ecosystems. The server ships with a Common library, a Client SDK, and sample implementations, making it straightforward to build, test, and deploy MCP-enabled services. To get started, build the supported modules, run the server, and explore the included samples to see how models, contexts, and actions are wired to real data sources.

Once running, you can extend the server by adding MCP models, registers, and adapters that bridge your data sources (databases, REST services, internal systems) to the MCP layer. The provided samples demonstrate both server-side model definitions and how to expose them through the MCP API, enabling clients to query context, request inferences, or trigger actions against your data sources. Refer to the user manual linked in the project for design patterns, best practices, and integration guidance across common data sources and deployment scenarios.

How to install

Prerequisites:

  • Java 8 (or higher) JDK
  • Maven or Gradle for build (depending on your chosen workflow)
  • Basic knowledge of Java and Spring Boot (for Spring-based integrations)
  1. Clone the repository and navigate to the project directory:
git clone https://github.com/lightweight-component/aj-mcp
cd aj-mcp
  1. Build the modules (examples use Maven by default):
# Build all modules including aj-mcp-server and samples
mvn -B -DskipTests package
  1. Locate the server artifact (e.g., aj-mcp-server.jar) in the target directories (or run via Spring Boot if you prefer).

  2. Run the MCP server:

java -jar path/to/aj-mcp-server.jar
  1. Optional: If you want to run via Spring Boot tooling, you can use:
mvn spring-boot:run -pl aj-mcp-server
  1. Configure via environment variables or a config file as described in the documentation (see MCP_CONFIG_PATH and MCP_LOG_LEVEL in the notes below).

Additional notes

Notes and tips:

  • The project targets Java 8+ and supports Spring Boot 2.x. If you’re embedding the server in a larger Spring application, you can wire MCP components as Spring beans and manage lifecycle via the host app.
  • Use the provided samples to understand how to define MCP models, contexts, and actions, and how to connect to data sources.
  • Environment variables like MCP_CONFIG_PATH and MCP_LOG_LEVEL help control runtime behavior and logging without changing code.
  • If you encounter classpath or dependency issues, ensure you’re building with the correct module scope and using compatible Java versions.
  • For production deployments, consider containerizing the jar and configuring resource limits, logging, and health checks according to your orchestration platform.

Related MCP Servers

Sponsor this space

Reach thousands of developers