-
-
Notifications
You must be signed in to change notification settings - Fork 61
Claude Code
While you can use these tools alongside Claude Code and other code assistants with their own tooling, we recommend trying the Clojure MCP tools independently first to experience their full capabilities.
See the README for more details.
See the README for instructions.
See the README for instructions.
The following command registers the Clojure MCP server with claude so it will connect to the nREPL (for the current project only). Change /path/to/clojure-mcp to the directory where you cloned clojure-mcp in the previous step.
claude mcp add clojure-mcp -- /bin/sh -c 'PORT=$(cat .nrepl-port); cd /path/to/clojure-mcp && clojure -X:mcp :port $PORT'It's recommended to disable Claude Code's built-in tools when using the Clojure MCP server.
For shell commands, the clojure-mcp bash tool is better for sandboxed nREPL environments. The Scratchpad and Todo tools can complement or replace each other depending on the desired workflow. NotebookEdit and NotebookRead are usually not needed. The Task tool utilizes the Anthropic API, making it useful in certain scenarios.
Disabling tools is possible using a project config:
/your/project/dir/.claude/settings.json (project configuration)
{
"permissions": {
"allow": [],
"deny": [
"Bash",
"Edit",
"Glob",
"Grep",
"LS",
"MultiEdit",
"NotebookEdit",
"NotebookRead",
"Read",
"Task",
"TodoRead",
"TodoWrite",
"Write"
]
}
}Make sure your project's nREPL server is running before moving to the next step. You should have an nREPL configuration set up after step 2 in the README.
Run the claude command in your project directory to start Claude Code and run the Clojure MCP server as a subprocess. Since it may take some time to start the MCP server and connect to the project's nREPL, you can check the status with the /mcp command:
> /mcp
⎿ MCP Server Status
• clojure-mcp: connected
Once you see it's connected, you're ready to use Claude Code with the Clojure MCP server.
See the corresponding section in the main README for details. Below are Claude Code specific commands to add resources and prompts from within the chat window.
Add resources via @:
-
@PROJECT_SUMMARY.mdor@clojure-mcp:custom://project-summary -
@Clojure Project Infoor@clojure-mcp:custom://project-info -
@LLM_CODE_STYLE.mdor@clojure-mcp:custom://llm-code-style -
@CLAUDE.mdor@clojure-mcp:custom://claude
Example:
@PROJECT_SUMMARY.md
⎿ Read PROJECT_SUMMARY.md (210 lines)
⏺ I can see you have a comprehensive Clojure project with MCP (Model Context
Protocol) integration. [...rest removed...]
Add prompts via /:
-
/clojure-mcp:clojure_repl_system_prompt(clojure_repl_system_promptcontains instructions on how to code) - Additional commands are available. Start typing
/to see all available commands, including those from MCP servers. Commands provided by clojure-mcp are prefixed with/clojure-mcp.
Example:
> /clojure-mcp:clojure_repl_system_prompt
⏺ I'm ready to help you with Clojure development tasks. I have access to REPL
evaluation, specialized Clojure editing tools, and can assist with REPL-driven
development workflows.
What would you like to work on?