@dashclaw/mcp-server 1.0.1 → 1.0.2
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/lib/server.js +1 -1
- package/lib/tools.js +9 -1
- package/package.json +1 -1
package/lib/server.js
CHANGED
package/lib/tools.js
CHANGED
|
@@ -397,7 +397,15 @@ export const TOOL_DEFINITIONS = [
|
|
|
397
397
|
* @returns {Object<string, function>}
|
|
398
398
|
*/
|
|
399
399
|
export function createToolHandlers(client) {
|
|
400
|
-
|
|
400
|
+
// Priority: server-configured agent_id (DASHCLAW_AGENT_ID / --agent-id /
|
|
401
|
+
// auto-derived from MCP clientInfo) wins over anything the LLM passes in the
|
|
402
|
+
// tool call. This is deliberate: agent identity is a governance primitive,
|
|
403
|
+
// and letting the LLM pick its own agent_id based on prompt context (e.g.
|
|
404
|
+
// it sees "smoke test" and picks "claude-mcp-smoketest") breaks attribution
|
|
405
|
+
// and lets a single misbehaving prompt impersonate a different agent. The
|
|
406
|
+
// input.agent_id field is preserved only as a last-resort fallback for
|
|
407
|
+
// configurations that intentionally run without a server-level default.
|
|
408
|
+
const agentId = (input) => client.agentId || input.agent_id;
|
|
401
409
|
|
|
402
410
|
return {
|
|
403
411
|
async dashclaw_optimal_files_preview(input) {
|