Sandbox
@metosin/mcp-toolkit

Clojure MCP client and server SDK

MCP Toolkit is a Clojure and ClojureScript library for talking MCP as either a client or a server. It handles the protocol plumbing and aims to feel Clojure-native, while staying I/O agnostic and async-friendly through Promesa.

40 starsโ€ข5 forksโ€ขClojureโ€ขUpdated 5mo ago
Who it's for

Builders who want to build MCP clients or servers in Clojure or ClojureScript.

What it delivers

You can build MCP integrations without writing the protocol plumbing from scratch.

What it does

Client and server APIs

Provides APIs for both MCP clients and MCP servers.

CLJC support

Works in both Clojure and ClojureScript, with Babashka support marked as not yet done.

I/O agnostic design

Separates the library from a specific transport so you can wire it into different runtimes.

Async task support

Uses Promesa so prompts, resources, and tools can run async work.

Protocol feature coverage

Implements cancellation, ping, progress, roots, sampling, prompts, resources, tools, completion, and logging.

Example projects

Includes STDIO client and server examples, plus an HTTP/SSE server example.

Doc set

Provides CLJDocs and a `doc/` directory with introduction, session, API design, and usage notes.

How to get it

  1. 1Additionally, see the documentation on CLJDocs or in the doc/ directory.
    npm install
    ./bin/kaocha --watch

README

MCP Toolkit

Clojars Project Slack cljdoc badge

This library is a very unofficial MCP SDK in Clojure.

It handles the communication between MCP clients and MCP servers, and attempts to provide a Clojure-ish experience to developers working on expending the MCP ecosystem.

Status: alpha quality

Tested on Claude Desktop and Claude Code, no problems found for the features implemented.

Implemented features

  • API for both clients & servers
  • CLJC
    • Clojure
    • Clojurescript
    • Babashka
  • I/O agnostic library
  • Uses Promesa to support async tasks in prompts, resources and tools
  • Compatible with protocol versions
    • 2024-11-05
    • 2025-03-26
    • 2025-06-18 (not yet)
  • MCP features implemented
    • Cancellation
    • Ping
    • Progress
    • Roots
    • Sampling
    • Prompts
    • Resources
    • Tools
    • Completion
    • Logging
    • Pagination
  • Example projects

Usage

See the README.md in the example/cljc-server-stdio/ project to learn:

  • how to use this library to make your own MCP server in Clojure, and
  • how to develop its components (prompts, resources and tools) via the REPL while the server is running.

Additionally, see the documentation on CLJDocs or in the doc/ directory.

Testing

npm install
./bin/kaocha --watch

Its place in the AI ecosystem

MCP toolkit aims to be more convenient for the Clojure community than the official MCP SDKs for Java or Typescript.

It provides utilities to build an MCP server in Clojure(script), but doesn't provide any prompts, resources or tools to help working on a Clojure codebase. It is typically used for building general purpose MCP stuffs.

Other MCP libs

Contributing

Only code typed and reviewed by a human will be accepted for review, discussion, and maybe merged. We have a policy of keeping the source code clean, organized, and easy to read for a human.

Advices for improving the chances for your PR to be accepted:

  • Keep your PR small and in line with an associated Github issue.
  • If you plan some significant changes, it's best to discuss them in an issue first, to keep the contribution aligned with the technical direction of project.
  • Do not reformat the source code unless you found a formatting issue, in which case you should use a separate PR just for that.

License

This project is distributed under the Eclipse Public License v2.0.

Copyright (c) Metosin and contributors.

Files in the repo

Repository payloadโ€ข17 top-level entries
  • .github
  • bin
  • doc
  • example
  • src
  • test
  • .gitignore
  • CHANGELOG.md
  • deps.edn
  • docker-compose.yml
  • Dockerfile
  • LICENSE.txt
  • package-lock.json
  • package.json
  • pom.xml
  • README.md
  • tests.edn

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents โ€” swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

๐Ÿ•ท๏ธ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k