CO

code-assistant

Created 6 months ago

A CLI tool built in Rust for assisting with code-related tasks.

development documentation public MCP CLI

What is code-assistant?

A coding assistant MCP server that allows to explore a code-base and make changes to code. Should be used with trusted repos only (insufficient protection against prompt injections).

Documentation

Code Assistant

Features

  • Autonomous Exploration: The agent can intelligently explore codebases and build up working memory of the project structure.
  • Reading/Writing Files: The agent can read file contents and make changes to files as needed.
  • User Interface: The agent can run with a UI based on Zed's gpui.
  • Interactive Communication: Ability to ask users questions and get responses for better decision-making.
  • MCP Server Mode: Can run as a Model Context Protocol server, providing tools and resources to LLMs running in an MCP client.

Installation

Ensure you have Rust installed on your system. Then:

git clone https://github.com/stippi/code-assistant\n\n# Navigate to the project directory
cd code-assistant\n\n# Build the project
cargo build --release\n\n# The binary will be available in target/release/code-assistant

Configuration in Claude Desktop

The code-assistant implements the Model Context Protocol by Anthropic. This means it can be added as a plugin to MCP client applications such as Claude Desktop.

Configure Your Projects

Create a file ~/.config/code-assistant/projects.json. This file adds available projects in MCP server mode (list_projects and file operation tools). It has the following structure:

{
  "code-assistant": {
    "path": "/Users//workspace/code-assistant"
  },
  "asteroids": {
    "path": "/Users//workspace/asteroids"
  },
  "zed": {
    "path": "Users//workspace/zed"
  }
}

Configure MCP Servers

  • Open the Claude Desktop application settings (Claude -> Settings)
  • Switch to the Developer tab.
  • Click the Edit Config button. A Finder window opens highlighting the file claude_desktop_config.json. Open that file in your favorite text editor. An example configuration is given below:
{
  "mcpServers": {
    "code-assistant": {
      "command": "/Users//workspace/code-assistant/target/release/code-assistant",
      "args": ["server"],
      "env": {
        "PERPLEXITY_API_KEY": "pplx-...",
        "SHELL": "/bin/zsh"
      }
    }
  }
}

Usage

Code Assistant can run in two modes:\n\n### Agent Mode (Default)

code-assistant --task [OPTIONS]
```\n\n### Server Mode
Runs as a Model Context Protocol server:
```bash
code-assistant server [OPTIONS]

Roadmap

This section is not really a roadmap, as the items are in no particular order. Below are some topics that are likely the next focus.

  • Block Replacing in Changed Files: When streaming a tool use block, we already know the LLM attempts to use replace_in_file and we know in which file quite early. If we also know this file has changed since the LLM last read it, we can block the attempt with an appropriate error message.
  • Compact Tool Use Failures: When the LLM produces an invalid tool call, or a mismatching search block, we should be able to strip the failed attempt from the message history, saving tokens.
  • Improve UI: There are various ways in which the UI can be improved.
  • Add Memory Tools: Add tools that facilitate building up a knowledge base useful work working in a given project.
  • Security: Ideally, the execution for all tools would run in some sort of sandbox that restricts access to the files in the project tracked by git.
  • Fuzzy matching search blocks: Investigate the benefit of fuzzy matching search blocks.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Server Config

{
  "mcpServers": {
    "code-assistant-server": {
      "command": "npx",
      "args": [
        "code-assistant"
      ]
    }
  }
}

Links & Status

Repository: github.com
Hosted: No
Global: No
Official: Yes

Project Info

Hosted Featured
Created At: May 23, 2025
Updated At: Aug 07, 2025
Author: Stippi
Category: community
License: MIT
Tags:
development documentation public