Get the FREE Ultimate OpenClaw Setup Guide →

clj -starter

Starter template to build MCP tools in Clojure (using Modex) (Model Context Protocol)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio theronic-clj-mcp-starter java -jar /absolute/path/to/target/my-mcp-server-0.0.1.jar

How to use

This MCP server is a starter template for building Modex-based MCP tools in Clojure. It compiles your Clojure project into an Uberjar which can be executed by Java, exposing your tools via the MCP protocol. The template emphasizes editing clj_mcp_starter/core.clj to define your tools and behavior. After building, you run the resulting jar with java -jar to start the MCP server and connect it to your Modex/Claude environment. To use it with Claude Desktop, configure an MCP server entry (as shown in the example) and restart Claude Desktop to load the new server.

Key capabilities you get with this starter include: editing a single core.clj to implement or register MCP tools, building an Uberjar that packages your code, and exposing a standardized MCP interface through the Java execution of the jar. You’ll typically want to customize the tool definitions, input/output handling, and any Modex integration points inside clj_mcp_starter/core.clj, then rebuild the Uberjar before wiring it up to Claude Desktop.

How to install

Prerequisites:

  • Java (JDK) installed and available in your PATH
  • Git installed
  • Basic familiarity with Clojure and the Modex MCP workflow

Installation steps:

  1. Clone the starter repository: git clone git@github.com:theronic/clj-mcp-starter.git my-mcp-tools

  2. Navigate to the project directory and build the Uberjar: cd my-mcp-tools ./build.sh

    This will produce an Uberjar at target/my-mcp-server-0.0.1.jar.

  3. Configure Claude Desktop to point to your built jar. Create or edit the configuration file (for example claude_desktop_config.json) with: { "mcpServers": { "scicloj": { "command": "java", "args": ["-jar", "/absolute/path/to/target/my-mcp-server-0.0.1.jar"] } }, "globalShortcut": "" }

  4. Restart Claude Desktop to load the new MCP server configuration.

Notes:

  • Replace /absolute/path/to/target/... with the actual path to your built jar.
  • If you modify clj_mcp_starter/core.clj, rebuild the Uberjar with ./build.sh to apply changes.

Additional notes

Tips and notes:

  • The core.clj file is where you define tools and behavior; after changes, run ./build.sh to regenerate the Uberjar.
  • Ensure the path to the Uberjar in your MCP config is correct (absolute paths are safest).
  • If you encounter connection issues, verify that Java can execute the jar and that Claude Desktop has network access to the MCP server if applicable.
  • The template uses a simple example server name scicloj; rename or duplicate entries to manage multiple MCP tools.
  • Environment variables can be added under env in mcp_config if your tools require config overrides at runtime.

Related MCP Servers

Sponsor this space

Reach thousands of developers