What is io.modelcontext/clojure-sdk?
A Clojure SDK for building servers that implement the Model Context Protocol (MCP). It provides core components including server implementation, STDIO transport, error handling, and protocol specifications. It is aimed at Clojure developers who want to create MCP servers that expose tools, resources, and prompts to AI clients like Claude Desktop.
How to use io.modelcontext/clojure-sdk?
Add the dependency via git coordinates in deps.edn or use the provided deps-new template or GitHub template to quickly scaffold a new project. Build the examples jar with make clean && make examples-jar, then run any example server (e.g., calculator_server, vegalite_server, code_analysis_server) using java with the required JVM properties and classpath.
Key features of io.modelcontext/clojure-sdk
- Core server implementation handling MCP request/response cycles
- STDIO transport layer using core.async channels
- Custom error handling and protocol specification validation
- Example servers: calculator, Vega-lite charting, and code analysis
- Templates for quick project scaffolding (deps-new, GitHub)
Use cases of io.modelcontext/clojure-sdk
- Expose arithmetic tools (add, subtract, multiply, etc.) to an MCP client
- Generate Vega-lite charts from data via a dedicated tool server
- Provide analysis prompts for code review or poetry generation
- Build custom MCP servers in Clojure with minimal boilerplate
コメント