Liking cljdoc? Tell your friends :D

PluMCP

Clojars Project Documentation Clojurians Slack Ask DeepWiki (useful but watch  for hallucinations)

Model Context Protocol (MCP) SDK for Java and JavaScript runtimes. Build MCP clients and servers using Clojure/ClojureScript.

PluMCP is a low-dependency Clojure/ClojureScript library for making MCP clients and servers. Connect your business (data, process and software) with AI Agents using MCP and idiomatic Clojure.

Rationale

  • Complete: Enjoy all non-deprecated MCP features and transports
  • Reach: Clojure/ClojureScript reaches Java/JavaScript eco-systems
  • Ergonomic: User-friendly API, automatic error-checking
  • Light: Low dependency, Bring your own dependency
  • Flexible: Composable design with configurable/overridable defaults
  • Secure: OAuth 2.1 integrated with Streamable HTTP transport

Who is using PluMCP?

Funding and Support

Show your support, star the Github repo!

Fund this project

  • Sponsor this project via Github Sponsors
  • Hire me for consulting, development or training

Thank you, sponsors!

Many thanks to Clojurists Together for sponsoring this project for Q2 2026.

The scope of work for this sponsorship is documented here.

Development

There are Makefile targets for various development tasks:

Setup and teardown

make setup
make clean
make distclean  # needs `make setup` later

Running tests

make clj-test   # run tests in Clojure/JVM
make cljs-test  # run tests in Node.js

Enable OAuth tests (disabled by default)

  1. Copy test-config.template.edn to test-config.edn
  2. Edit suitably
  3. Enable OAuth in src/test/plumcp/core/test/transport_test.cljc (in auth-options-fn)

Enable OAuth when running local MCP server (Streamable HTTP)

Enable OAuth in src/main/plumcp/core/main/main_http_server.cljc (in main/-main)

Alternatives to OAuth Dynamic Client Registration (DCR) for testing

Use preregistered OAuth client

Uncomment :client-id and :client-secret in src/main/plumcp/core/main/client.cljc (in make-http-transport)

Use Client ID Metadata Document (CIMD)

  1. Edit script/client-id-metadata-document/client.json suitably
  2. Run a web server serving the client.json file:
    cd script/client-id-metadata-document
    jwebserver  # this utility is part of JDK since Java 18
    
  3. Run a tunneling service, e.g. cloudflared:
    cloudflared tunnel --url http://localhost:8000
    
  4. Make sure "client_id" points to the HTTPS URL for client.json
  5. Now test with your OAuth Authorization server

Module release

# Edit `module-project-clj.bb` for version
make install-all-modules
make clean-all-modules

License

Copyright © 2025-2026 Shantanu Kumar

This program and the accompanying materials are made available under the terms of the Eclipse Public License 1.0 which is available at https://www.eclipse.org/legal/epl/epl-v10.html.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close