Skip to content

Commit 11e0bbb

Browse files
committed
Fix MCP servers: use npx instead of uvx
- Install MCP servers via npm in Dockerfile - Update agent.toml to use npx commands instead of uvx - Fix MCP server connection issues by using Node.js package manager - Keep all four MCP servers (filesystem, git, memory, sequential-thinking) - Fix some bugs in demo
1 parent fcd8dc5 commit 11e0bbb

File tree

8 files changed

+94
-65
lines changed

8 files changed

+94
-65
lines changed

community/archmind/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Env vars
2+
.env.*
3+
4+
# Example repo
5+
target-repo

community/archmind/Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,18 @@ FROM node:18-alpine
44
RUN apk add --no-cache git python3 py3-pip
55

66
# Install Qodo CLI
7-
RUN npm install -g @qodo/cli
7+
RUN npm install -g @qodo/command
88

9-
# Install MCP servers
10-
RUN pip3 install mcp-server-filesystem mcp-server-git mcp-server-memory
9+
# Install MCP servers via npm
10+
RUN npm install -g @modelcontextprotocol/server-memory @modelcontextprotocol/server-filesystem @modelcontextprotocol/server-git
1111

1212
# Create working directory
1313
WORKDIR /workspace
1414

15-
# Copy agent configuration
16-
COPY agent.toml /workspace/
15+
# Copy agent configuration to working directory
16+
COPY agent.toml /workspace/agent.toml
1717
COPY README.md /workspace/
1818
COPY examples/ /workspace/examples/
1919

20-
# Set up environment
21-
ENV NODE_ENV=production
22-
ENV MCP_SERVERS_PATH=/workspace
23-
2420
# Default command
25-
CMD ["qodo", "archmind", "--help"]
21+
CMD ["qodo", "archmind", "--help"]

community/archmind/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ This agent is submitted for the **"Best Agent for Complex Codebases"** category
2323
### Prerequisites
2424
- Docker and Docker Compose
2525
- Git
26+
- **Qodo API Key** (required for analysis)
27+
- Set environment variable: `export QODO_API_KEY=your_key_here`
28+
29+
### Setup API Key
30+
```bash
31+
# Get API key from https://qodo.ai
32+
export QODO_API_KEY=your_api_key_here
33+
34+
# Or create .env file
35+
echo "QODO_API_KEY=your_key_here" > .env
36+
```
2637

2738
### Demo Analysis (Next.js Framework)
2839

community/archmind/agent.toml

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -203,33 +203,23 @@ arguments = [
203203
{ name = "framework_mode", type = "boolean", required = false, default = false, description = "Enable framework extensibility documentation" }
204204
]
205205

206-
# MCP servers for comprehensive analysis
206+
# MCP servers for comprehensive analysis (using npx)
207207
mcpServers = """
208208
{
209-
"filesystem": {
210-
"command": "uvx",
211-
"args": ["mcp-server-filesystem", "."],
212-
"env": {}
213-
},
214-
"git": {
215-
"command": "uvx",
216-
"args": ["mcp-server-git", "--repository", "."],
217-
"env": {}
218-
},
219209
"memory": {
220-
"command": "uvx",
221-
"args": ["mcp-server-memory"],
210+
"command": "npx",
211+
"args": ["@modelcontextprotocol/server-memory"],
222212
"env": {}
223213
},
224214
"sequential-thinking": {
225-
"command": "uvx",
226-
"args": ["mcp-server-sequential-thinking"],
215+
"command": "npx",
216+
"args": ["@modelcontextprotocol/server-sequential-thinking"],
227217
"env": {}
228218
}
229219
}
230220
"""
231221

232-
# Available tools for the agent
222+
# Available tools for the agent (use built-in filesystem and git)
233223
tools = ["filesystem", "git", "memory", "sequential-thinking"]
234224

235225
# Execution strategy for complex analysis
@@ -242,6 +232,7 @@ output_schema = """
242232
"properties": {
243233
"analysis_metadata": {
244234
"type": "object",
235+
"description": "Metadata about the analysis execution including repository info and timing",
245236
"properties": {
246237
"repository_name": {"type": "string"},
247238
"analysis_date": {"type": "string"},
@@ -255,6 +246,7 @@ output_schema = """
255246
},
256247
"executive_summary": {
257248
"type": "object",
249+
"description": "High-level summary of architectural findings and key metrics",
258250
"properties": {
259251
"architecture_type": {"type": "string"},
260252
"complexity_score": {"type": "number", "minimum": 1, "maximum": 10},
@@ -267,6 +259,7 @@ output_schema = """
267259
},
268260
"repository_structure": {
269261
"type": "object",
262+
"description": "Analysis of repository organization and file structure patterns",
270263
"properties": {
271264
"components": {"type": "array", "items": {"type": "object"}},
272265
"directory_patterns": {"type": "array", "items": {"type": "object"}},
@@ -277,6 +270,7 @@ output_schema = """
277270
},
278271
"patterns_detected": {
279272
"type": "object",
273+
"description": "Architectural and design patterns identified in the codebase",
280274
"properties": {
281275
"architectural_patterns": {"type": "array", "items": {"type": "string"}},
282276
"design_patterns_inferred": {"type": "array", "items": {"type": "string"}},
@@ -285,17 +279,9 @@ output_schema = """
285279
"pattern_confidence": {"type": "object"}
286280
}
287281
},
288-
"historical_analysis": {
289-
"type": "object",
290-
"properties": {
291-
"evolution_timeline": {"type": "array", "items": {"type": "object"}},
292-
"change_hotspots": {"type": "array", "items": {"type": "object"}},
293-
"contributor_patterns": {"type": "object"},
294-
"architectural_decisions": {"type": "array", "items": {"type": "object"}}
295-
}
296-
},
297282
"quality_metrics": {
298283
"type": "object",
284+
"description": "Quantitative metrics about code structure and organization quality",
299285
"properties": {
300286
"structure_organization_score": {"type": "number"},
301287
"pattern_consistency_score": {"type": "number"},
@@ -305,6 +291,7 @@ output_schema = """
305291
},
306292
"recommendations": {
307293
"type": "array",
294+
"description": "Prioritized list of actionable improvement suggestions",
308295
"items": {
309296
"type": "object",
310297
"properties": {
@@ -318,31 +305,34 @@ output_schema = """
318305
}
319306
}
320307
},
321-
"framework_capabilities": {
322-
"type": "object",
323-
"properties": {
324-
"current_phase": {"type": "string"},
325-
"available_integrations": {"type": "array", "items": {"type": "string"}},
326-
"extension_opportunities": {"type": "array", "items": {"type": "string"}},
327-
"roadmap_items": {"type": "array", "items": {"type": "object"}}
328-
}
329-
},
330308
"documentation_generated": {
331309
"type": "object",
310+
"description": "Information about documentation files and artifacts created",
332311
"properties": {
333312
"files_created": {"type": "array", "items": {"type": "string"}},
334313
"diagrams_generated": {"type": "array", "items": {"type": "string"}},
335314
"total_documentation_size": {"type": "string"},
336315
"framework_documentation": {"type": "boolean"}
337316
}
338317
},
339-
"success": {"type": "boolean"},
340-
"errors": {"type": "array", "items": {"type": "string"}},
341-
"warnings": {"type": "array", "items": {"type": "string"}}
318+
"success": {
319+
"type": "boolean",
320+
"description": "Whether the analysis completed successfully"
321+
},
322+
"errors": {
323+
"type": "array",
324+
"description": "List of errors encountered during analysis",
325+
"items": {"type": "string"}
326+
},
327+
"warnings": {
328+
"type": "array",
329+
"description": "List of warnings or non-critical issues found",
330+
"items": {"type": "string"}
331+
}
342332
},
343333
"required": ["analysis_metadata", "executive_summary", "success"]
344334
}
345335
"""
346336

347-
# Success condition for CI/CD integration
348-
exit_expression = "success && executive_summary.health_score >= 6"
337+
# Success condition for CI/CD integration (fixed JMESPath)
338+
exit_expression = "success == `true` && executive_summary.health_score >= `6`"
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
version: '3.8'
21
services:
32
archmind:
43
build: .
54
volumes:
6-
- ./target-repo:/workspace
5+
- ./target-repo:/workspace/repo
6+
- ./agent.toml:/workspace/agent.toml
77
- ./output:/workspace/analysis
88
working_dir: /workspace
99
environment:
10-
- QODO_MODEL=claude-3-5-sonnet-20241022
11-
command: qodo archmind --analysis-depth=deep --generate-docs=true
10+
- QODO_MODEL=claude-sonnet-4@20250514
11+
- QODO_API_KEY=${QODO_API_KEY}
12+
command: qodo archmind --agent-file=agent.toml --analysis-depth=deep --generate-docs=true
1213

1314
archmind-interactive:
1415
build: .
1516
volumes:
16-
- ./target-repo:/workspace
17+
- ./target-repo:/workspace/repo
18+
- ./agent.toml:/workspace/agent.toml
1719
- ./output:/workspace/analysis
1820
working_dir: /workspace
1921
stdin_open: true
2022
tty: true
2123
environment:
2224
- QODO_MODEL=claude-sonnet-4@20250514
25+
- QODO_API_KEY=${QODO_API_KEY}
2326
command: /bin/sh

community/archmind/examples/ci-cd-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
-v ${{ github.workspace }}/analysis:/workspace/analysis \
4141
ghcr.io/qodo-ai/archmind:latest \
4242
qodo archmind \
43+
--agent-file=agent.toml \
4344
--analysis-depth=deep \
4445
--generate-docs=true \
4546
--include-diagrams=true \
@@ -170,6 +171,7 @@ jobs:
170171
-v ${{ github.workspace }}:/workspace \
171172
ghcr.io/qodo-ai/archmind:latest \
172173
qodo archmind \
174+
--agent-file=agent.toml \
173175
--focus-area=dependencies \
174176
--output-format=json > dependency-changes.json
175177

community/archmind/examples/local-development.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ docker run --rm \
2525
-v $PWD/architecture-analysis:/workspace/analysis \
2626
ghcr.io/qodo-ai/archmind:latest \
2727
qodo archmind \
28+
--agent-file=agent.toml \
2829
--analysis-depth=expert \
2930
--include-diagrams=true \
3031
--focus-area=all \
@@ -42,22 +43,22 @@ docker run --rm -it \
4243
ghcr.io/qodo-ai/archmind:latest /bin/sh
4344

4445
# Inside container, run various analyses
45-
qodo archmind --analysis-depth=quick --focus-area=dependencies
46-
qodo archmind --analysis-depth=deep --focus-area=patterns
47-
qodo archmind --analysis-depth=expert --include-diagrams=true
46+
qodo archmind --agent-file=agent.toml --analysis-depth=quick --focus-area=dependencies
47+
qodo archmind --agent-file=agent.toml --analysis-depth=deep --focus-area=patterns
48+
qodo archmind --agent-file=agent.toml --analysis-depth=expert --include-diagrams=true
4849
```
4950

5051
### Multiple Analysis Runs
5152
```bash
5253
# Run different analyses for different purposes
5354
docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
54-
qodo archmind --analysis-depth=quick --output-format=json > quick-metrics.json
55+
qodo archmind --agent-file=agent.toml --analysis-depth=quick --output-format=json > quick-metrics.json
5556

5657
docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
57-
qodo archmind --focus-area=security --output-format=markdown > security-report.md
58+
qodo archmind --agent-file=agent.toml --focus-area=security --output-format=markdown > security-report.md
5859

5960
docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
60-
qodo archmind --focus-area=performance --include-diagrams=true
61+
qodo archmind --agent-file=agent.toml --focus-area=performance --include-diagrams=true
6162
```
6263

6364
## Continuous Analysis
@@ -74,7 +75,7 @@ docker run --rm \
7475
-v $PWD:/workspace \
7576
-v $PWD/.architecture:/workspace/analysis \
7677
ghcr.io/qodo-ai/archmind:latest \
77-
qodo archmind --analysis-depth=quick --generate-docs=false
78+
qodo archmind --agent-file=agent.toml --analysis-depth=quick --generate-docs=false
7879

7980
# Check for significant architectural changes
8081
if [ -f ".architecture/metrics.json" ]; then
@@ -101,7 +102,7 @@ echo "Validating architecture before push..."
101102
docker run --rm \
102103
-v $PWD:/workspace \
103104
ghcr.io/qodo-ai/archmind:latest \
104-
qodo archmind --analysis-depth=standard --output-format=json > /tmp/arch-check.json
105+
qodo archmind --agent-file=agent.toml --analysis-depth=standard --output-format=json > /tmp/arch-check.json
105106

106107
# Check if architecture meets standards
107108
complexity=$(grep -o '"complexity_score":[0-9]*' /tmp/arch-check.json | cut -d: -f2)
@@ -181,6 +182,7 @@ max_complexity_score = 6
181182
```bash
182183
docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
183184
qodo archmind \
185+
--agent-file=agent.toml \
184186
--exclude-patterns="node_modules,dist,build,.next" \
185187
--focus-area=patterns \
186188
--max-file-count=10000
@@ -190,6 +192,7 @@ docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
190192
```bash
191193
docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
192194
qodo archmind \
195+
--agent-file=agent.toml \
193196
--exclude-patterns="__pycache__,.venv,venv,*.pyc" \
194197
--focus-area=dependencies \
195198
--analysis-depth=deep
@@ -199,6 +202,7 @@ docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
199202
```bash
200203
docker run --rm -v $PWD:/workspace ghcr.io/qodo-ai/archmind:latest \
201204
qodo archmind \
205+
--agent-file=agent.toml \
202206
--exclude-patterns="target/,*.class,.gradle" \
203207
--focus-area=all \
204208
--include-diagrams=true
@@ -221,6 +225,7 @@ docker run --rm -m 4g \
221225
-v $PWD:/workspace \
222226
ghcr.io/qodo-ai/archmind:latest \
223227
qodo archmind \
228+
--agent-file=agent.toml \
224229
--max-file-count=5000 \
225230
--exclude-patterns="vendor,node_modules,dist,build"
226231
```

community/archmind/run-demo.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22
set -e
33

44
echo "ArchMind Demo - Analyzing Next.js Framework"
5-
echo "==========================================="
5+
echo "=============================================="
6+
7+
# Check if API key is set
8+
if [ -z "$QODO_API_KEY" ]; then
9+
echo ""
10+
echo "ERROR: Qodo API key required"
11+
echo "Please set QODO_API_KEY environment variable"
12+
echo "Get your key from https://qodo.ai"
13+
echo ""
14+
echo "Example: export QODO_API_KEY=your_key_here"
15+
echo ""
16+
exit 1
17+
fi
618

719
# Clone Next.js repository if not exists
820
if [ ! -d "target-repo" ]; then
@@ -14,12 +26,17 @@ fi
1426
mkdir -p output
1527

1628
echo "Starting ArchMind Docker container..."
17-
docker-compose up --build archmind
29+
30+
# Run with explicit agent file specification
31+
docker-compose run --rm archmind qodo archmind \
32+
--agent-file=/workspace/agent.toml \
33+
--analysis-depth=deep \
34+
--generate-docs=true
1835

1936
echo "Analysis complete! Check the output directory for results."
2037
echo "Generated files:"
2138
ls -la output/
2239

2340
echo ""
2441
echo "To run interactive analysis:"
25-
echo "docker-compose run --rm archmind-interactive"
42+
echo "docker-compose run --rm archmind-interactive"

0 commit comments

Comments
 (0)