
hugoduncan/mcp-clj
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
hugoduncan/mcp-clj - кандидат на сервер MCP, импортированный из https://github.com/hugoduncan/mcp-clj.
Обзор
hugoduncan/mcp-clj - кандидат на сервер MCP, импортированный из https://github.com/hugoduncan/mcp-clj.
Обзор (машинный перевод)
Реализация протокола Model Context Protocol (MCP) с минимальными зависимостями и автономной интеграцией Clojure REPL.
Быстрый старт
**Прыжок к: ** Установка • Использование клиента • Настройка кода Клода • Настройка рабочего стола Клода • Разработка
##Что и почему
mcp-clj предоставляет как MCP-сервер, так и клиент реализации в Clojure:
Самодостаточный REPL: Оценка Clojure непосредственно в серверном процессе (без зависимости от nREPL)
** Низкие зависимости**: требуется только org.clojure/data.json
Множественные виды транспорта: SSE (HTTP), stdio и in-memory для тестирования
- ** Инструменты встроенные**: Оценка Clojure
clj-evalи листинг файловlsс поддержкой gitignore ** Клиент MCP**: Подключение к другим серверам MCP от Clojure
Когда использовать mcp-clj: Выявление функциональности Clojure REPL для Claude Desktop или других клиентов MCP Создание приложений Clojure, которые потребляют услуги MCP Простое развертывание без внешних зависимостей REPL
Торговые вычеты против Clojure-mcp: Простая настройка, самодостаточная оценка Не может подключиться к существующим удаленным REPL Меньше встроенных инструментов
##Установка
Зависимости Git (рекомендуется)
Использование CLI
Использование сервера
Базовый сервер
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
mcp-clj
A Clojure implementation of the Model Context Protocol (MCP) with minimal dependencies and self-contained Clojure REPL integration.
Quick Start
# Add to deps.edn
{:deps {org.hugoduncan/mcp-clj
{:git/url "https://github.com/hugoduncan/mcp-clj"
:git/sha "latest-commit-sha"
:deps/root "projects/server"}}}
;; Start MCP server
(require 'mcp-clj.mcp-server.core)
(def server (mcp-clj.mcp-server.core/create-server {:transport {:type :stdio}}))
;; Server exposes tools like clj-eval and ls
;; Connect with Claude Desktop via stdio transport (see Claude Desktop Setup)
Jump to: Installation • Client Usage • Claude Code Setup • Claude Desktop Setup • Development
What & Why
mcp-clj provides both MCP server and client implementations in Clojure:
- Self-contained REPL: Evaluates Clojure directly in the server process (no nREPL dependency)
- Low dependencies: Only requires
org.clojure/data.json - Multiple transports: SSE (HTTP), stdio, and in-memory for testing
- Built-in tools: Clojure evaluation (
clj-eval) and file listing (ls) with gitignore support - MCP client: Connect to other MCP servers from Clojure
When to use mcp-clj:
- Expose Clojure REPL functionality to Claude Desktop or other MCP clients
- Build Clojure applications that consume MCP services
- Simple deployment without external REPL dependencies
Trade-offs vs clojure-mcp:
- ✅ Simpler setup, self-contained evaluation
- ❌ Cannot connect to existing remote REPLs
- ❌ Fewer built-in tools
Installation
Git Dependencies (Recommended)
;; deps.edn
{:deps {org.hugoduncan/mcp-clj
{:git/url "https://github.com/hugoduncan/mcp-clj"
:git/sha "latest-commit-sha" ; Replace with actual latest SHA
:deps/root "projects/server"}}}
CLI Usage
# Clone and run directly
git clone https://github.com/hugoduncan/mcp-clj
cd mcp-clj
# Start stdio server (recommended for Claude Desktop)
clj -M:stdio-server
# Start SSE server (HTTP) on port 3001 (default)
clj -M:sse-server
# Start SSE server on custom port
clj -M:sse-server --port 8080
Server Usage
Basic Server
(require 'mcp-clj.mcp-server.core)
;; Stdio server (recommended for Claude Desktop)
(def server (mcp-clj.mcp-server.core/create-server
{:transport {:type :stdio}}))
;; SSE server (for HTTP-based clients)
(def server (mcp-clj.mcp-server.core/create-server
{:transport {:type :sse :port 3001}}))
;; Stop server
((:stop server))
Custom Tools
(def echo-tool
{:name "echo"
:description "Echo the input text"
:inputSchema {:type "object"
:properties {"text" {:type "string"}}
:required ["text"]}
:implementation (fn [{:keys [text]}]
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"mcp-clj": {
"command": "/opt/homebrew/bin/bash",
"args": [
"-c",
"cd /path/to/your/project && clojure -M:mcp"
],
"env": {
"PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
}
}
}
}