Clojure

A Clojure MCP server SDK enabling creation of MCP servers with stdio transport and example servers for calculator, Vega-lite, and code analysis.
  • other

57

GitHub Stars

other

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "unravel-team-mcp-clojure-sdk": {
      "command": "java",
      "args": [
        "-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory",
        "-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog",
        "-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector",
        "-Dlog4j2.configurationFile=log4j2-mcp.xml",
        "-Dbabashka.json.provider=metosin/jsonista",
        "-Dlogging.level=INFO",
        "-cp",
        "/Users/you/path/to/examples-jar.jar",
        "calculator_server"
      ]
    }
  }
}

You can build Model Context Protocol (MCP) servers in Clojure using the clojure-sdk, which provides a stdio transport and core server primitives to handle requests, tools, resources, and prompts. This guide walks you through practical usage, installation steps, and concrete example servers to get you running quickly.

How to use

You interact with MCP by starting a local server process that communicates over standard input/output. The clojure-sdk provides ready-made example servers you can run to understand how arithmetic tools, data visualization, and code-analysis prompts are exposed as MCP tools. Start the servers, connect an MCP client, and call tools or read resources as needed. The flow includes initialization, discovery of available tools/resources/prompts, tool calls, resource reads, and optional notifications.

How to install

Prerequisites you need on your machine are Java installed and a Java runtime available on your PATH. You also need a path to the compiled examples JAR that contains the MCP servers.

Run this sequence to build and start example servers from the provided project artifacts.

make clean
make examples-jar

Additional sections

Core components include the server implementation that handles request/response cycles, a stdio transport for IO, custom error handling, and protocol specifications that validate requests and responses.

Available tools

add

Adds two numbers and returns the sum.

subtract

Subtracts the second number from the first.

multiply

Multiplies two numbers.

divide

Divides the first number by the second.

power

Raises the first number to the power of the second.

square-root

Computes the square root of a number.

average

Calculates the average of a list of numbers.

factorial

Computes the factorial of a non-negative integer.

save-data

Saves data for Vega-lite chart generation.

visualize-data

Generates a Vega-lite visualization from provided data.

analyse-code

Prompts to analyze code and provide insights.

poem-about-code

Prompts to compose a poem about code.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational