fluxy-bot 0.5.24 → 0.5.26
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/package.json
CHANGED
|
@@ -169,6 +169,20 @@ export async function startFluxyAgentQuery(
|
|
|
169
169
|
}
|
|
170
170
|
} catch {}
|
|
171
171
|
|
|
172
|
+
// Load MCP server config from workspace/MCP.json if it exists
|
|
173
|
+
let mcpServers: any[] | undefined;
|
|
174
|
+
try {
|
|
175
|
+
const mcpConfigPath = path.join(WORKSPACE_DIR, 'MCP.json');
|
|
176
|
+
const mcpConfig = JSON.parse(fs.readFileSync(mcpConfigPath, 'utf-8'));
|
|
177
|
+
if (Array.isArray(mcpConfig) && mcpConfig.length) {
|
|
178
|
+
mcpServers = mcpConfig;
|
|
179
|
+
const names = mcpConfig.map((s: any) => Object.keys(s).join(',')).join(', ');
|
|
180
|
+
log.info(`Loaded MCP server(s): [${names}]`);
|
|
181
|
+
}
|
|
182
|
+
} catch {}
|
|
183
|
+
|
|
184
|
+
log.info(`Starting agent query${mcpServers ? ` with ${mcpServers.length} MCP server(s)` : ''}...`);
|
|
185
|
+
|
|
172
186
|
const claudeQuery = query({
|
|
173
187
|
prompt: sdkPrompt,
|
|
174
188
|
options: {
|
|
@@ -180,6 +194,7 @@ export async function startFluxyAgentQuery(
|
|
|
180
194
|
abortController,
|
|
181
195
|
systemPrompt: enrichedPrompt,
|
|
182
196
|
plugins: plugins.length ? plugins : undefined,
|
|
197
|
+
mcpServers,
|
|
183
198
|
env: {
|
|
184
199
|
...process.env as Record<string, string>,
|
|
185
200
|
CLAUDE_CODE_OAUTH_TOKEN: oauthToken,
|
|
@@ -188,6 +203,7 @@ export async function startFluxyAgentQuery(
|
|
|
188
203
|
});
|
|
189
204
|
|
|
190
205
|
onMessage('bot:typing', { conversationId });
|
|
206
|
+
log.info('Agent query created, waiting for first message...');
|
|
191
207
|
|
|
192
208
|
for await (const msg of claudeQuery) {
|
|
193
209
|
if (abortController.signal.aborted) break;
|
|
@@ -238,6 +238,32 @@ The supervisor manages the backend process. You don't need to manage it yourself
|
|
|
238
238
|
- Never run `npm start` or `node backend/index.ts` directly — the supervisor handles it
|
|
239
239
|
- If something is truly broken and won't self-heal, tell your human to restart fluxy
|
|
240
240
|
|
|
241
|
+
## MCP Servers (Model Context Protocol)
|
|
242
|
+
|
|
243
|
+
You can connect to external tools via MCP servers. These give you capabilities beyond your built-in tools — like controlling a browser, querying databases, or interacting with third-party APIs.
|
|
244
|
+
|
|
245
|
+
**Config file:** `MCP.json` (in your workspace root)
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
[
|
|
249
|
+
{
|
|
250
|
+
"server-name": {
|
|
251
|
+
"command": "npx",
|
|
252
|
+
"args": ["@some/mcp-server"],
|
|
253
|
+
"env": {}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Each entry is an object where the key is the server name and the value has `command`, optional `args`, and optional `env`. The array is read fresh on every turn — add, remove, or edit entries anytime.
|
|
260
|
+
|
|
261
|
+
**Your human can ask you to add MCP servers.** When they do, read `MCP.json` (create it if missing), add the new server config, and write it back. Common examples:
|
|
262
|
+
- **Playwright** (browser control): `{ "playwright": { "command": "npx", "args": ["@playwright/mcp@latest", "--headless", "--browser", "chromium"] } }`
|
|
263
|
+
- **Fetch** (HTTP requests): `{ "fetch": { "command": "npx", "args": ["@anthropic-ai/mcp-fetch@latest"] } }`
|
|
264
|
+
|
|
265
|
+
When an MCP server is configured, its tools appear alongside your built-in tools. Use them naturally — no special syntax needed.
|
|
266
|
+
|
|
241
267
|
## Sacred Files — NEVER Modify
|
|
242
268
|
- `supervisor/` — chat UI, proxy, process management
|
|
243
269
|
- `worker/` — platform APIs and database
|