Make CoPilot an Interactive ProgrammerClojure Tools for CoPilot
(Parts of this README is written by Claude Sonnet. Pardon any marketing language. I will clean up.) An VS Code Language model extension for Calva, the Clojure/ClojureScript extension for VS Code, enabling AI assistants to harness the power of the REPL. This extension exposes the AI tools both to CoPilot directly, using the VS Code Language Model API, and via an optional MCP server for any AI assistants/agents. Features
Evaluation power is opt-inSince evaluating Clojure code could be a bit risky, the server defaults to this being disabled, so you can use the server for other things. Search for Calva MCP in VS Code Settings to enable it. Note that there are several layers to the security model here. This server starts with evaluation powers disables, and compliant MCP servers will default to low trust mode and ask for your confirmation every time the LLM wants to use the tool. Full YOLO mode is enabled if you enable the tool in the Calva MCP settings, and configure your AI client to be allowed to use it without asking. Why Calva Backseat Driver?"I wish Copilot could actually run my Clojure code instead of just guessing what it might do." The Calva Backseat Driver transforms AI coding assistants from static code generators into interactive programming partners by giving them access to your REPL. (Please be mindful about the implications of that before you start using it.) Turn your AI Agent into an Interactive Programming partnerTired of AI tools that write plausible-looking Clojure that falls apart at runtime? Calva Backseat Driver lets your AI assistant:
For Clojurians who value Interactive ProgrammingAs Clojure developers, we know the REPL isn't just a console - it's the center of our workflow. Now your AI assistant can join that workflow, understanding your data and functions as they actually exist, not just as they appear in static code. In test-projects/example/AI_INTERACTIVE_PROGRAMMING.md you'll find an attempt to prompt the AI to leverage the REPL for interactive programming. (With varying success, help with this is much appreciated!) Getting StartedPrerequisites
Code generation instructionsThis is something we will have to figure out and discover together. Right now I include this in the
The Backset Driver extension provides this as defailts instructions, in case you don't have any yet.
Configuration (if using MCP Server)The MCP server is running as a plain socket server in the VS Code Extension Host, writing out a port file when it starts. Then the MCP client needs to start a
Workspace/project level configBackseat Driver is a per-project MCP server, so should be configured on the project level if the assistant you are using allows it.
I am sorry that this is a bit messy. It is obvious that MCP is a bit new, and that project level MCP servers may not have been considered when creating MCP. I have tried to understand and navigate the limitiations and to provide configurability/Ux to the best of my understanding and ability. Cursor configurationCursor supports project level config. In you project's
Cursor will detect the server config and offer to start it. You may want to check the Cursor MCP docs. Windsurf configurationWindsurf can use the Backseat Driver via its MCP server. However, it is a bit clunky, to say the least. Windsurf doesn't support workspace configurations for MCP servers, so they are only global. This means:
Windsurf's configuration file has the same shape as Cursor's, located at: The Windsurf AI assistant doesn't know about its MCP configurations and will keep trying to create MCP configs for CoPilot. Which is silly, because it won't work for Windsurf, and CoPilot doesn't need it. Clunk: At startup, even with the MCP server set to auto-start, Windsurf often refreshes its MCP servers quicker than the MCP server starts. You may need to refresh the tools in Windsurf. However, Windsurf doesn't seem to handle refreshing more than once well. It just keeps spinning the refresh button. IMPORTANT: Windsurf uses MCP tools without checking with the user by default. This is fine for 3 out of 4 of the Backseat Driver tools, but for the REPL tool it is less ideal. I think some Windsurf user should report this non-compliance with MCP as an issue. Claude desktopClaude Desktop doesn't run in VS Code, and doesn't have any other project/workspace concept, so it is the global config that you will use. The app has a button for finding its configuration file. Configuring to use the port for the stdio command is probably easiest.
There doesn't seem to be a way to refresh/reload the server info, so if you started the Backseat Driver MCP server after Claude, you probably neeed to restart Claude to for the refresh to happen. Other MCP client?Please add configuration for other AI clients! 🙏 Using
All tools can be referenced in the chat:
How It Works (evaluating code)
MCPCalva Backseat Driver implements the Model Context Protocol (MCP), creating a bridge between AI assistants and your REPL: WIPThis is a super early, bare bones, MCP server. The “plan” (hope) is that we will expose much more of Calva's features. Please let us now what features you would like to see. ContributingContributions are welcome! Issues, PRs, whatever. Before a PR, we appreciate an issue stating the problem being solved. You may also want to reach out discussing the issue before starting to work on it. License 🍻🗽Sponsor my open source work ♥️You are welcome to show me you like my work using this link: |