Skip to content

Commit cab83b0

Browse files
committed
remover mcpm-aider
1 parent 4969c3d commit cab83b0

File tree

3 files changed

+19
-159
lines changed

3 files changed

+19
-159
lines changed

registry/coder/modules/aider/main.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ variable "workdir" {
4545
variable "report_tasks" {
4646
type = bool
4747
description = "Whether to enable task reporting to Coder UI via AgentAPI"
48-
default = true
48+
default = false
4949
}
5050

5151
variable "subdomain" {
@@ -270,9 +270,7 @@ module "agentapi" {
270270
echo -n '${base64encode(local.install_script)}' | base64 -d > /tmp/install.sh
271271
chmod +x /tmp/install.sh
272272
ARG_WORKDIR='${var.workdir}' \
273-
ARG_MCP_APP_STATUS_SLUG='${local.app_slug}' \
274273
ARG_INSTALL_AIDER='${var.install_aider}' \
275-
ARG_SYSTEM_PROMPT='${base64encode(local.final_system_prompt)}' \
276274
ARG_REPORT_TASKS='${var.report_tasks}' \
277275
ARG_AIDER_CONFIG="$(echo -n '${base64encode(local.base_aider_config)}' | base64 -d)" \
278276
/tmp/install.sh

registry/coder/modules/aider/scripts/install.sh

Lines changed: 6 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ command_exists() {
99
# Inputs
1010
ARG_WORKDIR=${ARG_WORKDIR:-/home/coder}
1111
ARG_INSTALL_AIDER=${ARG_INSTALL_AIDER:-true}
12-
ARG_REPORT_TASKS=${ARG_REPORT_TASKS:-true}
1312
ARG_AIDER_CONFIG=${ARG_AIDER_CONFIG:-}
14-
ARG_MCP_APP_STATUS_SLUG=${ARG_MCP_APP_STATUS_SLUG:-}
1513

1614
echo "--------------------------------"
1715
echo "Install flag: $ARG_INSTALL_AIDER"
@@ -31,101 +29,21 @@ function install_aider() {
3129
pipx install --force aider-install
3230
aider-install
3331
fi
34-
echo "Aider installed: $(aider --version || echo 'check failed the Aider module insatllation failed')"
35-
}
36-
37-
function install_node() {
38-
if ! command_exists npm; then
39-
printf "npm not found, checking for Node.js installation...\n"
40-
if ! command_exists node; then
41-
printf "Node.js not found, installing Node.js via NVM...\n"
42-
export NVM_DIR="$HOME/.nvm"
43-
if [ ! -d "$NVM_DIR" ]; then
44-
mkdir -p "$NVM_DIR"
45-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
46-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
47-
else
48-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
49-
fi
50-
51-
# Temporarily disable nounset (-u) for nvm to avoid PROVIDED_VERSION error
52-
set +u
53-
nvm install --lts
54-
nvm use --lts
55-
nvm alias default node
56-
set -u
57-
58-
printf "Node.js installed: %s\n" "$(node --version)"
59-
printf "npm installed: %s\n" "$(npm --version)"
60-
else
61-
printf "Node.js is installed but npm is not available. Please install npm manually.\n"
62-
exit 1
63-
fi
64-
fi
65-
}
66-
67-
function install_UV() {
68-
if ! command_exists uv; then
69-
printf "UV not found"
70-
printf "Installing UV"
71-
curl -LsSf https://astral.sh/uv/install.sh | sh
72-
printf "UV installed successful %s" "Version : $(uv --version)"
73-
fi
74-
}
75-
76-
function install_mcpm-aider() {
77-
install_node
78-
install_UV
79-
# If nvm is not used, set up user npm global directory
80-
if ! command_exists nvm; then
81-
mkdir -p "$HOME/.npm-global"
82-
npm config set prefix "$HOME/.npm-global"
83-
export PATH="$HOME/.npm-global/bin:$PATH"
84-
if ! grep -q "export PATH=$HOME/.npm-global/bin:\$PATH" ~/.bashrc; then
85-
echo "export PATH=$HOME/.npm-global/bin:\$PATH" >> ~/.bashrc
86-
fi
87-
fi
88-
printf "%s Installing MCPM-Aider for supporting coder MCP...\n"
89-
npm install -g @poai/mcpm-aider
90-
printf "%s Successfully installed MCPM-Aider. Version: %s\n" "$(mcpm-aider -V)"
32+
echo "Aider installed: $(aider --version || echo 'check failed the Aider module installation failed')"
9133
}
9234

9335
function configure_aider_settings() {
94-
if [ "${ARG_REPORT_TASKS}" = "true" ]; then
36+
if [ -n "${ARG_AIDER_CONFIG}" ]; then
37+
echo "Aider Envronment Variables AND Model are Configuring"
38+
9539
mkdir -p "$HOME/.config/aider"
9640

9741
echo "$ARG_AIDER_CONFIG" > "$HOME/.config/aider/.aider.conf.yml"
98-
echo "Added Coder MCP extension to Aider config.yml"
99-
else
100-
printf "MCP Server not Implemented"
101-
fi
102-
}
103-
104-
function report_tasks() {
105-
if [ "$ARG_REPORT_TASKS" = "true" ]; then
106-
echo "Configuring Aider to report tasks via Coder MCP..."
107-
export CODER_MCP_APP_STATUS_SLUG="$ARG_MCP_APP_STATUS_SLUG"
108-
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
109-
coder exp mcp configure claude-code "$ARG_WORKDIR"
110-
echo "claude configured with SLUG successfuly"
111-
configure_claude_for_mcpm_aider
42+
echo "Aider config.yml created at $HOME/.config/aider/.aider.conf.yml"
11243
else
113-
export CODER_MCP_APP_STATUS_SLUG=""
114-
export CODER_MCP_AI_AGENTAPI_URL=""
115-
echo "Configuring Aider with Coder MCP..."
116-
coder exp mcp configure claude-code "$ARG_WORKDIR"
117-
echo "claude configured successfuly"
118-
configure_claude_for_mcpm_aider
44+
printf "NO Aider Environment Variables and Model Configured\n"
11945
fi
12046
}
12147

122-
function configure_claude_for_mcpm_aider() {
123-
echo "configuring claude for mcpm-adier"
124-
mkdir -p $HOME/.config/claude
125-
cat $HOME/.claude.json > $HOME/.config/claude/claude_desktop_config.json
126-
}
127-
12848
install_aider
129-
install_mcpm-aider
13049
configure_aider_settings
131-
report_tasks

registry/coder/modules/aider/scripts/start.sh

Lines changed: 12 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ set -euo pipefail
44
# Ensure pipx-installed apps are in PATH
55
export PATH="$HOME/.local/bin:$PATH"
66

7-
source "$HOME/.bashrc"
8-
# shellcheck source=/dev/null
9-
if [ -f "$HOME/.nvm/nvm.sh" ]; then
10-
source "$HOME"/.nvm/nvm.sh
11-
else
12-
export PATH="$HOME/.npm-global/bin:$PATH"
13-
fi
14-
15-
167
ARG_WORKDIR=${ARG_WORKDIR:-/home/coder}
178
ARG_API_KEY=$(echo -n "${ARG_API_KEY:-}" | base64 -d)
189
ARG_SYSTEM_PROMPT=$(echo -n "${ARG_SYSTEM_PROMPT:-}" | base64 -d 2> /dev/null || echo "")
@@ -33,7 +24,7 @@ else
3324
printf "API key not provided\n"
3425
fi
3526

36-
function build_initial_prompt() {
27+
build_initial_prompt() {
3728
local initial_prompt=""
3829

3930
if [ -n "$ARG_AI_PROMPT" ]; then
@@ -47,67 +38,20 @@ function build_initial_prompt() {
4738
echo "$initial_prompt"
4839
}
4940

50-
function start_agentapi() {
51-
echo "Starting agentAPI in directory: $ARG_WORKDIR"
41+
start_agentapi() {
42+
echo "Starting in directory: $ARG_WORKDIR"
5243
cd "$ARG_WORKDIR"
53-
touch ".aider.model.settings.yml"
54-
echo "- name: $ARG_MODEL
55-
extra_params:
56-
api_key: $ARG_API_KEY
57-
api_base: http://localhost:8000/v1/" > "./.aider.model.settings.yml"
58-
agentapi server --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always
59-
}
60-
61-
function start_mcpm_aider_bridge_bg() {
62-
echo "Starting mcpm-aider bridge in background..."
63-
64-
# directory for logs/pid
65-
LOG_DIR="${ARG_WORKDIR:-.}/logs"
66-
mkdir -p "$LOG_DIR"
67-
68-
TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
69-
LOG_FILE="$LOG_DIR/mcpm-aider.$TIMESTAMP.log"
70-
PID_FILE="$LOG_DIR/mcpm-aider.pid"
7144

72-
# tool list
73-
printf "mcpm-aider tool list" "$(mcpm-aider list)"
74-
# start detached with nohup, capture PID
75-
nohup mcpm-aider start-bridge --server https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent >> "$LOG_FILE" 2>&1 &
76-
MC_PM_PID=$!
77-
echo "$MC_PM_PID" > "$PID_FILE"
78-
79-
# simple health check: ensure process started
80-
sleep 1
81-
if kill -0 "$MC_PM_PID" 2>/dev/null; then
82-
echo "mcpm-aider started (pid $MC_PM_PID). Logs: $LOG_FILE"
45+
local initial_prompt
46+
initial_prompt=$(build_initial_prompt)
47+
if [ -n "$initial_prompt" ]; then
48+
echo "Using Initial Prompt to Start agentapi with Task Prompt"
49+
agentapi server -I="$initial_prompt" --type aider --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always
8350
else
84-
echo "mcpm-aider failed to start. Check $LOG_FILE" >&2
85-
# optional: exit here if you want to abort
86-
# exit 1
87-
fi
88-
89-
# optional: when this script exits before agentapi finishes, kill background
90-
# (If you want mcpm-aider to keep running after agentapi exits, remove this trap.)
91-
trap 'echo "Stopping background mcpm-aider (pid $MC_PM_PID)"; kill "$MC_PM_PID" 2>/dev/null || true' EXIT
51+
agentapi server --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always
52+
fi
9253
}
9354

55+
# TODO: Implement MCP server for coder when Aider support MCP servers.
9456

95-
96-
# function start_agentapi() {
97-
# echo "Starting in directory: $ARG_WORKDIR"
98-
# cd "$ARG_WORKDIR"
99-
100-
# local initial_prompt
101-
# initial_prompt=$(build_initial_prompt)
102-
# if [ -n "$initial_prompt" ]; then
103-
# echo "Using Initial Prompt to Start agentapi with Task Prompt"
104-
# agentapi server -I="$initial_prompt" --type aider --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always
105-
# else
106-
# agentapi server --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always
107-
# fi
108-
# }
109-
110-
111-
112-
start_mcpm_aider_bridge_bg
113-
start_agentapi
57+
start_agentapi

0 commit comments

Comments
 (0)