Modex logo

Modex

by theronic

Modex is a Clojure library that implements the Model Context Protocol (MCP) to augment AI models with tools, resources, and prompts. It allows building MCP Servers & Clients in native Clojure, eliminating the need for the Anthropic's MCP Java SDK.

View on GitHub

Last updated: N/A

What is Modex?

Modex is a Clojure library that implements the Model Context Protocol (MCP), enabling you to augment AI models with tools, resources, and prompts. It provides a native Clojure solution for building MCP servers and clients.

How to use Modex?

To use Modex, clone the repository, build the uberjar using ./build.sh, configure your MCP client (e.g., Claude Desktop) to connect to the server by specifying the command and arguments to run the uberjar, and restart the client. You can then interact with the server's tools through the client.

Key features of Modex

  • Native Clojure implementation of MCP

  • Implements the stdio transport

  • DSL for defining tools protocols

  • Supports tools with parameter validation

  • Error handling for tool execution

Use cases of Modex

  • Exposing Datomic databases to AI models for intelligent support query diagnosis

  • Automating recurring support queries

  • Providing AI models with access to tools, resources, and prompts

  • Integrating AI models with production databases

FAQ from Modex

Can I modify the server while an MCP Client (like Claude Desktop) is connected?

Not yet, but an nREPL will be added soon so you can eval changes while Claude Desktop is connected to the process without rebuilding the uberjar.

What is MCP?

MCP lets you augment your AI models with Tools, Resources & Prompts: Tools are things it can do, like query a database (e.g. Datomic). Resources are files and data it can read, like PDF bank statements. Prompts are templated messages and workflows.

What transport types does Modex support?

Modex implements the stdio/stdout transport. Server-Sent Events (SSE) is not implemented yet.

What tool parameter types are supported?

The MCP spec currently only supports :string & :number tool parameter types.

How do I define tools?

Tools can be defined using the tool and tools macros, which provide a convenient way to specify tool parameters, documentation, and handlers.