indusagi-coding-agent 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/cli/args.d.ts +12 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli.js +25 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +88 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +257 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/sdk.d.ts +19 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +75 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +39 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +54 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +44 -19
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/index.d.ts +57 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +101 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/memory.d.ts +83 -0
- package/dist/core/tools/memory.d.ts.map +1 -0
- package/dist/core/tools/memory.js +154 -0
- package/dist/core/tools/memory.js.map +1 -0
- package/dist/core/tools/registry.d.ts +18 -2
- package/dist/core/tools/registry.d.ts.map +1 -1
- package/dist/core/tools/registry.js +47 -1
- package/dist/core/tools/registry.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +113 -5
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +20 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +154 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/FEATURES.md +306 -0
- package/docs/MCP.md +341 -0
- package/docs/MEMORY.md +443 -0
- package/examples/mcp-servers.example.json +50 -0
- package/package.json +2 -3
package/docs/FEATURES.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# New Features in v0.1.31
|
|
2
|
+
|
|
3
|
+
This document outlines the major features added in indusagi-coding-agent v0.1.31.
|
|
4
|
+
|
|
5
|
+
## 🎯 Quick Start
|
|
6
|
+
|
|
7
|
+
- **[MCP Guide](./MCP.md)** - Learn how to use Model Context Protocol for external integrations
|
|
8
|
+
- **[Memory Guide](./MEMORY.md)** - Learn how Memory helps the assistant remember context
|
|
9
|
+
|
|
10
|
+
## 📦 Feature Summary
|
|
11
|
+
|
|
12
|
+
### 1. Model Context Protocol (MCP)
|
|
13
|
+
|
|
14
|
+
Connect your AI assistant to external tools and services.
|
|
15
|
+
|
|
16
|
+
**What it enables:**
|
|
17
|
+
- 🔧 Access external APIs and tools
|
|
18
|
+
- 📁 Filesystem operations
|
|
19
|
+
- 🐙 GitHub integration
|
|
20
|
+
- 🔍 Web search and scraping
|
|
21
|
+
- 🗄️ Database queries
|
|
22
|
+
- 🌐 Real-time web access
|
|
23
|
+
|
|
24
|
+
**Quick setup:**
|
|
25
|
+
```bash
|
|
26
|
+
# Create ~/.indusagi/mcp-servers.json
|
|
27
|
+
indusagi
|
|
28
|
+
# Tools are automatically available!
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Examples:**
|
|
32
|
+
```
|
|
33
|
+
User: "Read my README.md"
|
|
34
|
+
# Uses filesystem MCP
|
|
35
|
+
|
|
36
|
+
User: "Search GitHub for open issues"
|
|
37
|
+
# Uses GitHub MCP
|
|
38
|
+
|
|
39
|
+
User: "What's the latest Node.js update?"
|
|
40
|
+
# Uses web search MCP
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
👉 [**Read Full MCP Guide →**](./MCP.md)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### 2. Memory System
|
|
48
|
+
|
|
49
|
+
The assistant now remembers important context across sessions.
|
|
50
|
+
|
|
51
|
+
**What it enables:**
|
|
52
|
+
- 💾 Persistent conversation history
|
|
53
|
+
- 🧠 Semantic understanding of past decisions
|
|
54
|
+
- 🎯 Context-aware responses
|
|
55
|
+
- ⚡ Faster problem-solving
|
|
56
|
+
- 📚 Project knowledge accumulation
|
|
57
|
+
|
|
58
|
+
**Automatic setup:**
|
|
59
|
+
Memory works out of the box. Just start using indusagi!
|
|
60
|
+
|
|
61
|
+
**Examples:**
|
|
62
|
+
```
|
|
63
|
+
Session 1:
|
|
64
|
+
User: "I prefer TypeScript for all projects"
|
|
65
|
+
|
|
66
|
+
Session 2 (days later):
|
|
67
|
+
User: "Create a new API"
|
|
68
|
+
Assistant: "I'll use TypeScript as you prefer..."
|
|
69
|
+
# Assistant remembers your preference!
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
👉 [**Read Full Memory Guide →**](./MEMORY.md)
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🚀 Feature Comparison
|
|
77
|
+
|
|
78
|
+
| Feature | Before v0.1.31 | After v0.1.31 |
|
|
79
|
+
|---------|----------------|---------------|
|
|
80
|
+
| **External Tools** | Limited to built-in tools | Full MCP ecosystem |
|
|
81
|
+
| **GitHub Integration** | Manual instructions | Automatic via MCP |
|
|
82
|
+
| **Web Access** | Web fetch only | Web search, fetch, scraping |
|
|
83
|
+
| **Context Memory** | Session-only | Persistent across sessions |
|
|
84
|
+
| **Semantic Search** | Not available | Full vector-based search |
|
|
85
|
+
| **Database Access** | No direct access | Multiple DB systems supported |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 📋 Configuration Files
|
|
90
|
+
|
|
91
|
+
### MCP Configuration
|
|
92
|
+
**Location**: `~/.indusagi/mcp-servers.json`
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"servers": {
|
|
97
|
+
"filesystem": {
|
|
98
|
+
"command": "npx",
|
|
99
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "$HOME"]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Memory Configuration
|
|
106
|
+
**Location**: `~/.indusagi/memory.json`
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"enabled": true,
|
|
111
|
+
"storage": "in-memory",
|
|
112
|
+
"vectorStore": "in-memory",
|
|
113
|
+
"maxMemoryItems": 1000,
|
|
114
|
+
"similarityThreshold": 0.7
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 🛠️ Common Use Cases
|
|
121
|
+
|
|
122
|
+
### Use Case 1: Code Review with Context
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
User: "Review my TypeScript code. Remember, we prefer functional patterns."
|
|
126
|
+
|
|
127
|
+
Memory: Recalls your functional programming preference
|
|
128
|
+
MCP: Accesses your GitHub to fetch the code
|
|
129
|
+
Result: Context-aware, personalized review
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Use Case 2: Project Management
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
User: "Update the project status"
|
|
136
|
+
|
|
137
|
+
Memory: Recalls previous project decisions
|
|
138
|
+
MCP: Accesses GitHub to update issues
|
|
139
|
+
Result: Consistent with past architectural decisions
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Use Case 3: Research with Memory
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
Session 1: "We're building a real-time chat app"
|
|
146
|
+
Session 2: "What database should we use?"
|
|
147
|
+
|
|
148
|
+
Memory: Recalls the chat app context
|
|
149
|
+
MCP: Searches for latest solutions
|
|
150
|
+
Result: Recommendations tailored to your use case
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 📊 Architecture
|
|
156
|
+
|
|
157
|
+
### MCP Integration
|
|
158
|
+
```
|
|
159
|
+
indusagi
|
|
160
|
+
↓
|
|
161
|
+
MCP Client Pool
|
|
162
|
+
├─→ Filesystem Server
|
|
163
|
+
├─→ GitHub Server
|
|
164
|
+
├─→ Web Search Server
|
|
165
|
+
└─→ Custom Servers
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Memory Integration
|
|
169
|
+
```
|
|
170
|
+
Conversation
|
|
171
|
+
↓
|
|
172
|
+
Memory System
|
|
173
|
+
├─→ Store as vector embedding
|
|
174
|
+
├─→ Search for relevant context
|
|
175
|
+
└─→ Inject into conversation
|
|
176
|
+
↓
|
|
177
|
+
Enhanced Response
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## ⚙️ Environment Variables
|
|
183
|
+
|
|
184
|
+
### MCP
|
|
185
|
+
```bash
|
|
186
|
+
INDUSAGI_DEBUG=1 # Enable MCP debug output
|
|
187
|
+
MCP_CONFIG_PATH=~/.indusagi/ # Custom config location
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Memory
|
|
191
|
+
```bash
|
|
192
|
+
MEMORY_ENABLED=true # Enable/disable memory
|
|
193
|
+
MEMORY_THRESHOLD=0.7 # Similarity threshold
|
|
194
|
+
OPENAI_API_KEY=sk-... # For semantic embeddings
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🔗 Integration with Other Features
|
|
200
|
+
|
|
201
|
+
### GPT-5.4 Models
|
|
202
|
+
v0.1.31 includes full support for GPT-5.4:
|
|
203
|
+
- `gpt-5.4` - Base model
|
|
204
|
+
- `gpt-5.4-codex` - Coding optimized (default for openai-codex)
|
|
205
|
+
|
|
206
|
+
These work seamlessly with MCP and Memory!
|
|
207
|
+
|
|
208
|
+
### Clean CLI Output
|
|
209
|
+
MCP debug messages are suppressed by default for a clean terminal experience.
|
|
210
|
+
|
|
211
|
+
Enable with: `INDUSAGI_DEBUG=1 indusagi`
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 🚀 Getting Started
|
|
216
|
+
|
|
217
|
+
### Step 1: Update to v0.1.31
|
|
218
|
+
```bash
|
|
219
|
+
npm install -g indusagi-coding-agent@0.1.31
|
|
220
|
+
indusagi --version
|
|
221
|
+
# Should show: 0.1.31
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Step 2: Enable MCP (Optional)
|
|
225
|
+
```bash
|
|
226
|
+
# Copy example config
|
|
227
|
+
cp ~/.npm-global/lib/node_modules/indusagi-coding-agent/examples/mcp-servers.example.json ~/.indusagi/mcp-servers.json
|
|
228
|
+
|
|
229
|
+
# Edit to customize
|
|
230
|
+
nano ~/.indusagi/mcp-servers.json
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Step 3: Set Environment Variables
|
|
234
|
+
```bash
|
|
235
|
+
export GITHUB_TOKEN="your_token"
|
|
236
|
+
export BRAVE_API_KEY="your_key"
|
|
237
|
+
export OPENAI_API_KEY="sk-..."
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Step 4: Start Using!
|
|
241
|
+
```bash
|
|
242
|
+
indusagi
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Memory and MCP are ready to use!
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 📚 Documentation Index
|
|
250
|
+
|
|
251
|
+
| Topic | Document |
|
|
252
|
+
|-------|----------|
|
|
253
|
+
| **MCP Setup & Usage** | [MCP.md](./MCP.md) |
|
|
254
|
+
| **Memory System** | [MEMORY.md](./MEMORY.md) |
|
|
255
|
+
| **Installation** | [../README.md](../README.md) |
|
|
256
|
+
| **Troubleshooting** | [../README.md#troubleshooting](../README.md) |
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 💡 Tips & Tricks
|
|
261
|
+
|
|
262
|
+
### MCP Tips
|
|
263
|
+
- Start with filesystem and web search for maximum value
|
|
264
|
+
- Set up GitHub if you work with repos
|
|
265
|
+
- Use environment variables for secrets
|
|
266
|
+
|
|
267
|
+
### Memory Tips
|
|
268
|
+
- Be explicit about preferences and constraints
|
|
269
|
+
- Reference past decisions to strengthen memory
|
|
270
|
+
- Start sessions with relevant context
|
|
271
|
+
- Search memory with `indusagi --search-memory "query"`
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## ❓ FAQ
|
|
276
|
+
|
|
277
|
+
**Q: Is my memory data stored online?**
|
|
278
|
+
A: No! Memory is stored locally in `~/.indusagi/memory/`. Only OpenAI embeddings API may be called (if enabled).
|
|
279
|
+
|
|
280
|
+
**Q: Can I use MCP without Memory?**
|
|
281
|
+
A: Yes! They work independently. Enable only what you need.
|
|
282
|
+
|
|
283
|
+
**Q: Does Memory slow down indusagi?**
|
|
284
|
+
A: Minimal impact (<5% overhead). Memory retrieval is <100ms.
|
|
285
|
+
|
|
286
|
+
**Q: Can I share Memory across machines?**
|
|
287
|
+
A: Export and import: `indusagi --export-memory` and `indusagi --import-memory file.json`
|
|
288
|
+
|
|
289
|
+
**Q: How often should I clear Memory?**
|
|
290
|
+
A: You don't need to! Memory automatically manages old items. Clear only if privacy is a concern.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 🐛 Getting Help
|
|
295
|
+
|
|
296
|
+
If you encounter issues:
|
|
297
|
+
|
|
298
|
+
1. **MCP Issues**: See [MCP.md Troubleshooting](./MCP.md#troubleshooting)
|
|
299
|
+
2. **Memory Issues**: See [MEMORY.md Troubleshooting](./MEMORY.md#troubleshooting)
|
|
300
|
+
3. **General Issues**: Check [../README.md](../README.md)
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
**Version**: 0.1.31
|
|
305
|
+
**Released**: March 2026
|
|
306
|
+
**Status**: ✅ Production Ready
|
package/docs/MCP.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# Model Context Protocol (MCP) Guide
|
|
2
|
+
|
|
3
|
+
## What is MCP?
|
|
4
|
+
|
|
5
|
+
**Model Context Protocol (MCP)** is a standard that allows AI models to interact with external tools and data sources seamlessly. It enables indusagi to connect with third-party services, databases, and APIs through a unified interface.
|
|
6
|
+
|
|
7
|
+
In indusagi, MCP provides:
|
|
8
|
+
- **External Tool Integration**: Connect to filesystems, APIs, databases
|
|
9
|
+
- **Automatic Tool Registration**: Servers expose tools that are automatically available
|
|
10
|
+
- **Real-time Data Access**: Query live data from external sources
|
|
11
|
+
- **Environment Configuration**: Secure credential management
|
|
12
|
+
|
|
13
|
+
## Features Added in v0.1.31
|
|
14
|
+
|
|
15
|
+
✅ **Multiple MCP Server Support**: Run multiple MCP servers simultaneously
|
|
16
|
+
✅ **Auto-Tool Registration**: Tools from MCP servers are automatically available
|
|
17
|
+
✅ **Clean Debug Output**: MCP debug messages suppressed by default (cleaner CLI)
|
|
18
|
+
✅ **Error Handling**: Improved connection management and error recovery
|
|
19
|
+
✅ **Configuration Flexibility**: Easy server setup via config file
|
|
20
|
+
|
|
21
|
+
## Available MCP Servers
|
|
22
|
+
|
|
23
|
+
### 1. **Filesystem Server**
|
|
24
|
+
Access and manipulate files on your system
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"servers": {
|
|
29
|
+
"filesystem": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Use cases:**
|
|
38
|
+
- Read files for context
|
|
39
|
+
- Create and edit files
|
|
40
|
+
- List directory contents
|
|
41
|
+
- Search files
|
|
42
|
+
|
|
43
|
+
### 2. **GitHub Server**
|
|
44
|
+
Interact with GitHub repositories and issues
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"github": {
|
|
49
|
+
"command": "npx",
|
|
50
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
51
|
+
"env": {
|
|
52
|
+
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Use cases:**
|
|
59
|
+
- Search repositories
|
|
60
|
+
- Read issues and pull requests
|
|
61
|
+
- Create issues
|
|
62
|
+
- Push commits
|
|
63
|
+
|
|
64
|
+
### 3. **Database Servers**
|
|
65
|
+
|
|
66
|
+
#### PostgreSQL
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"postgres": {
|
|
70
|
+
"command": "npx",
|
|
71
|
+
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
|
72
|
+
"env": {
|
|
73
|
+
"DATABASE_URL": "postgresql://user:password@localhost:5432/dbname"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 4. **Web Search Server**
|
|
80
|
+
|
|
81
|
+
#### Brave Search
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"brave-search": {
|
|
85
|
+
"command": "npx",
|
|
86
|
+
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
|
|
87
|
+
"env": {
|
|
88
|
+
"BRAVE_API_KEY": "${BRAVE_API_KEY}"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Use cases:**
|
|
95
|
+
- Search the web in real-time
|
|
96
|
+
- Get current news and information
|
|
97
|
+
- Fact-check information
|
|
98
|
+
|
|
99
|
+
### 5. **Browser Automation**
|
|
100
|
+
|
|
101
|
+
#### Puppeteer (Headless Browser)
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"puppeteer": {
|
|
105
|
+
"command": "npx",
|
|
106
|
+
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Use cases:**
|
|
112
|
+
- Screenshot websites
|
|
113
|
+
- Fill forms
|
|
114
|
+
- Scrape web content
|
|
115
|
+
- Test web applications
|
|
116
|
+
|
|
117
|
+
### 6. **Git Server**
|
|
118
|
+
Version control operations
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"git": {
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": ["-y", "@modelcontextprotocol/server-git", "--repository", "/path/to/git/repo"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 7. **Fetch Server**
|
|
130
|
+
HTTP/HTTPS requests
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"fetch": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": ["-y", "@modelcontextprotocol/server-fetch"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Setup Guide
|
|
142
|
+
|
|
143
|
+
### Step 1: Create Configuration File
|
|
144
|
+
|
|
145
|
+
Create `~/.indusagi/mcp-servers.json`:
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"servers": {
|
|
150
|
+
"filesystem": {
|
|
151
|
+
"command": "npx",
|
|
152
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "$HOME"],
|
|
153
|
+
"env": {}
|
|
154
|
+
},
|
|
155
|
+
"github": {
|
|
156
|
+
"command": "npx",
|
|
157
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
158
|
+
"env": {
|
|
159
|
+
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Step 2: Set Environment Variables
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# For GitHub
|
|
170
|
+
export GITHUB_TOKEN="your_github_token_here"
|
|
171
|
+
|
|
172
|
+
# For Brave Search
|
|
173
|
+
export BRAVE_API_KEY="your_brave_api_key_here"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Step 3: Start indusagi
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
indusagi
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
MCP servers will automatically load and tools will be available.
|
|
183
|
+
|
|
184
|
+
## Usage Examples
|
|
185
|
+
|
|
186
|
+
### Example 1: File Operations
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
User: Read the README.md file
|
|
190
|
+
Assistant: [Uses filesystem MCP to read file]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Example 2: GitHub Integration
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
User: Search for open issues in my repository related to "bug"
|
|
197
|
+
Assistant: [Uses GitHub MCP to search issues]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Example 3: Web Search
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
User: Search for latest Node.js updates
|
|
204
|
+
Assistant: [Uses Brave Search MCP for real-time web search]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Example 4: Browser Automation
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
User: Take a screenshot of https://example.com
|
|
211
|
+
Assistant: [Uses Puppeteer MCP to capture screenshot]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
### MCP Server Won't Connect
|
|
217
|
+
|
|
218
|
+
**Error**: `Failed to connect to [server-name]`
|
|
219
|
+
|
|
220
|
+
**Solution**:
|
|
221
|
+
1. Check if the command exists: `npx @modelcontextprotocol/server-[name]`
|
|
222
|
+
2. Verify environment variables are set correctly
|
|
223
|
+
3. Check that the command path is accessible
|
|
224
|
+
4. Enable debug mode: `INDUSAGI_DEBUG=1 indusagi`
|
|
225
|
+
|
|
226
|
+
### Tools Not Appearing
|
|
227
|
+
|
|
228
|
+
**Problem**: MCP server connected but tools not available
|
|
229
|
+
|
|
230
|
+
**Solution**:
|
|
231
|
+
1. Check server status: Look for `Connected to [server]` messages
|
|
232
|
+
2. Verify server configuration in `mcp-servers.json`
|
|
233
|
+
3. Reload indusagi (restart the application)
|
|
234
|
+
4. Check tool registry: `indusagi --help | grep -i tools`
|
|
235
|
+
|
|
236
|
+
### Authentication Issues
|
|
237
|
+
|
|
238
|
+
**Error**: `GITHUB_TOKEN not found` or similar
|
|
239
|
+
|
|
240
|
+
**Solution**:
|
|
241
|
+
1. Verify environment variable is set: `echo $GITHUB_TOKEN`
|
|
242
|
+
2. For `.env` file support, place in `~/.indusagi/.env`
|
|
243
|
+
3. Use environment variable syntax: `"${VARIABLE_NAME}"`
|
|
244
|
+
|
|
245
|
+
### Enable Debug Output
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Enable MCP debug messages
|
|
249
|
+
INDUSAGI_DEBUG=1 indusagi
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Best Practices
|
|
253
|
+
|
|
254
|
+
### 1. **Security**
|
|
255
|
+
- Never commit API tokens to git
|
|
256
|
+
- Use environment variables for secrets
|
|
257
|
+
- Restrict filesystem access to necessary directories only
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
{
|
|
261
|
+
"filesystem": {
|
|
262
|
+
"command": "npx",
|
|
263
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "$HOME/projects"],
|
|
264
|
+
"env": {}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 2. **Performance**
|
|
270
|
+
- Only enable servers you actually use
|
|
271
|
+
- Some servers (Puppeteer) consume significant resources
|
|
272
|
+
- Monitor memory usage with many servers
|
|
273
|
+
|
|
274
|
+
### 3. **Error Handling**
|
|
275
|
+
- MCP failures don't crash indusagi
|
|
276
|
+
- If a server is unavailable, its tools won't be available
|
|
277
|
+
- Check console messages for connection status
|
|
278
|
+
|
|
279
|
+
### 4. **Tool Awareness**
|
|
280
|
+
When requesting tasks, tell the assistant which tools are available:
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
I have these MCP tools available:
|
|
284
|
+
- Filesystem (read, write, list files)
|
|
285
|
+
- GitHub (search repos, issues)
|
|
286
|
+
- Web Search (real-time search)
|
|
287
|
+
|
|
288
|
+
Task: Find recent Python security CVEs
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## Advanced Configuration
|
|
292
|
+
|
|
293
|
+
### Multiple Instances of Same Server
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"servers": {
|
|
298
|
+
"filesystem-home": {
|
|
299
|
+
"command": "npx",
|
|
300
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "$HOME"]
|
|
301
|
+
},
|
|
302
|
+
"filesystem-projects": {
|
|
303
|
+
"command": "npx",
|
|
304
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "$HOME/projects"]
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Custom Environment Variables
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"postgres-production": {
|
|
315
|
+
"command": "npx",
|
|
316
|
+
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
|
317
|
+
"env": {
|
|
318
|
+
"DATABASE_URL": "postgresql://prod-user:${PROD_DB_PASSWORD}@prod.example.com:5432/main"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## Reference
|
|
325
|
+
|
|
326
|
+
- **MCP Specification**: https://modelcontextprotocol.io
|
|
327
|
+
- **Available Servers**: https://github.com/modelcontextprotocol/servers
|
|
328
|
+
- **Create Custom Server**: https://modelcontextprotocol.io/docs/tools/server
|
|
329
|
+
|
|
330
|
+
## Support
|
|
331
|
+
|
|
332
|
+
For issues with MCP:
|
|
333
|
+
1. Check if `mcp-servers.json` exists in `~/.indusagi/`
|
|
334
|
+
2. Run with debug: `INDUSAGI_DEBUG=1 indusagi`
|
|
335
|
+
3. Check console output for connection messages
|
|
336
|
+
4. Verify environment variables: `printenv | grep -i TOKEN`
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
**Version**: Introduced in indusagi-coding-agent v0.1.31
|
|
341
|
+
**Last Updated**: March 2026
|