indusagi-coding-agent 0.1.31 → 0.1.33
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 +35 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +11 -9
- package/dist/core/sdk.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +47 -4
- package/dist/main.js.map +1 -1
- package/dist/utils/array.d.ts +62 -13
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +129 -22
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/color-formatter.d.ts.map +1 -1
- package/dist/utils/color-formatter.js +32 -5
- package/dist/utils/color-formatter.js.map +1 -1
- package/dist/utils/data-transformer.d.ts +72 -7
- package/dist/utils/data-transformer.d.ts.map +1 -1
- package/dist/utils/data-transformer.js +102 -10
- package/dist/utils/data-transformer.js.map +1 -1
- package/dist/utils/date-formatter.d.ts +35 -0
- package/dist/utils/date-formatter.d.ts.map +1 -1
- package/dist/utils/date-formatter.js +50 -0
- package/dist/utils/date-formatter.js.map +1 -1
- package/dist/utils/error-handler.js +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/file-operations.d.ts +32 -5
- package/dist/utils/file-operations.d.ts.map +1 -1
- package/dist/utils/file-operations.js +48 -10
- package/dist/utils/file-operations.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +4 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +89 -14
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/json-formatter.d.ts +8 -0
- package/dist/utils/json-formatter.d.ts.map +1 -1
- package/dist/utils/json-formatter.js +17 -1
- package/dist/utils/json-formatter.js.map +1 -1
- package/dist/utils/markdown-formatter.d.ts +24 -0
- package/dist/utils/markdown-formatter.d.ts.map +1 -1
- package/dist/utils/markdown-formatter.js +175 -24
- package/dist/utils/markdown-formatter.js.map +1 -1
- package/dist/utils/path-validator.d.ts.map +1 -1
- package/dist/utils/path-validator.js +38 -13
- package/dist/utils/path-validator.js.map +1 -1
- package/dist/utils/string-formatter.d.ts +3 -3
- package/dist/utils/string-formatter.d.ts.map +1 -1
- package/dist/utils/string-formatter.js +6 -5
- package/dist/utils/string-formatter.js.map +1 -1
- package/dist/utils/type-guards.d.ts +6 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/dist/utils/type-guards.js +11 -2
- package/dist/utils/type-guards.js.map +1 -1
- package/docs/FEATURES.md +306 -0
- package/docs/MCP.md +341 -0
- package/docs/MEMORY.md +443 -0
- package/package.json +2 -2
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
|