mcp server code assist

Local 2025-08-31 23:14:18 0

A Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.


Overview

A Model Context Protocol server for code modification and generation. This server provides tools to create, modify, and delete code via Large Language Models.

mcp-server-code-assist MCP server

Tools

  1. create
  2. Creates new files
  3. Input: XML instruction with path and content
  4. Returns: Confirmation of file creation

  5. modify

  6. Modifies existing files with search/replace
  7. Input: XML instruction with path, search pattern, and new content
  8. Returns: Diff of changes

  9. rewrite

  10. Completely rewrites a file
  11. Input: XML instruction with path and new content
  12. Returns: Confirmation of rewrite

  13. delete

  14. Removes files
  15. Input: XML instruction with path
  16. Returns: Confirmation of deletion

XML Format

<Plan>
Describe approach and reasoning
</Plan>

<file path="/path/to/file" action="create|modify|rewrite|delete">
  <change>
    <description>What this change does</description>
    <search>
===
Original code for modification
===
    </search>
    <content>
===
New or modified code
===
    </content>
  </change>
</file>

Installation

uvx mcp-server-code-assist

Using pip

pip install mcp-server-code-assist
python -m mcp_server_code_assist

Configuration

Usage with Claude Desktop

Using uvx
"mcpServers": {
  "code-assist": {
    "command": "uvx",
    "args": ["mcp-server-code-assist"]
  }
}
Using docker
"mcpServers": {
  "code-assist": {
    "command": "docker",
    "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/code-assist"]
  }
}

Usage with Zed

Add to settings.json:

"context_servers": {
  "mcp-server-code-assist": {
    "command": {
      "path": "uvx",
      "args": ["mcp-server-code-assist"]
    }
  }
},

Development

cd src/code-assist
uvx mcp-server-code-assist

# For docker:
docker build -t mcp/code-assist .

License

MIT License. See LICENSE file for details.

[
  {
    "description": "Lists directory contents using system ls/dir command",
    "inputSchema": {
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path"
      ],
      "title": "ListDirectory",
      "type": "object"
    },
    "name": "list_directory"
  },
  {
    "description": "Creates a new directory",
    "inputSchema": {
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path"
      ],
      "title": "CreateDirectory",
      "type": "object"
    },
    "name": "create_directory"
  },
  {
    "description": "Creates a new file with content",
    "inputSchema": {
      "properties": {
        "content": {
          "default": "",
          "title": "Content",
          "type": "string"
        },
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path"
      ],
      "title": "FileCreate",
      "type": "object"
    },
    "name": "create_file"
  },
  {
    "description": "Deletes a file",
    "inputSchema": {
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path"
      ],
      "title": "FileDelete",
      "type": "object"
    },
    "name": "delete_file"
  },
  {
    "description": "Modifies parts of a file using string replacements",
    "inputSchema": {
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        },
        "replacements": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Replacements",
          "type": "object"
        }
      },
      "required": [
        "path",
        "replacements"
      ],
      "title": "FileModify",
      "type": "object"
    },
    "name": "modify_file"
  },
  {
    "description": "Rewrites entire file content",
    "inputSchema": {
      "properties": {
        "content": {
          "title": "Content",
          "type": "string"
        },
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path",
        "content"
      ],
      "title": "FileRewrite",
      "type": "object"
    },
    "name": "rewrite_file"
  },
  {
    "description": "Reads file content",
    "inputSchema": {
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path"
      ],
      "title": "FileRead",
      "type": "object"
    },
    "name": "read_file"
  },
  {
    "description": "Lists directory tree structure with git tracking support",
    "inputSchema": {
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "path",
              "type": "string"
            }
          ],
          "title": "Path"
        }
      },
      "required": [
        "path"
      ],
      "title": "ListDirectory",
      "type": "object"
    },
    "name": "file_tree"
  },
  {
    "description": "Shows git repository status",
    "inputSchema": {
      "properties": {
        "repo_path": {
          "title": "Repo Path",
          "type": "string"
        }
      },
      "required": [
        "repo_path"
      ],
      "title": "GitStatus",
      "type": "object"
    },
    "name": "git_status"
  },
  {
    "description": "Shows git diff",
    "inputSchema": {
      "properties": {
        "repo_path": {
          "title": "Repo Path",
          "type": "string"
        },
        "target": {
          "title": "Target",
          "type": "string"
        }
      },
      "required": [
        "repo_path",
        "target"
      ],
      "title": "GitDiff",
      "type": "object"
    },
    "name": "git_diff"
  },
  {
    "description": "Shows git commit history",
    "inputSchema": {
      "properties": {
        "max_count": {
          "default": 10,
          "title": "Max Count",
          "type": "integer"
        },
        "repo_path": {
          "title": "Repo Path",
          "type": "string"
        }
      },
      "required": [
        "repo_path"
      ],
      "title": "GitLog",
      "type": "object"
    },
    "name": "git_log"
  },
  {
    "description": "Shows git commit details",
    "inputSchema": {
      "properties": {
        "repo_path": {
          "title": "Repo Path",
          "type": "string"
        },
        "revision": {
          "title": "Revision",
          "type": "string"
        }
      },
      "required": [
        "repo_path",
        "revision"
      ],
      "title": "GitShow",
      "type": "object"
    },
    "name": "git_show"
  }
]