@adrive/mcp-server 0.4.0 → 1.0.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @adrive/mcp-server
2
2
 
3
- MCP server for **AgentDrive** — the persistent workspace your agents share across Claude Code, Codex, Cursor, and LangGraph. Files, semantic search, run logging, and cross-platform memory.
3
+ MCP server for **AgentDrive** — the cross-agent artifact workspace with provenance and portable storage across Claude Code, Codex, Cursor, and LangGraph. Files, semantic recall, run logging, and cross-platform attribution.
4
4
 
5
5
  Drop this server into any MCP-compatible client and your agents get a shared filesystem with provenance, semantic search across artifacts written by other agents, and per-run audit. Memory is a feature of the workspace, not the headline.
6
6
 
@@ -66,7 +66,7 @@ env = { AGENTDRIVE_API_KEY = "agentdrive_live_...", AGENTDRIVE_AGENT_PLATFORM =
66
66
  }
67
67
  ```
68
68
 
69
- ## Tools (16)
69
+ ## Tools (20)
70
70
 
71
71
  **Files**
72
72
  - `drive_write` — create or update a file with versioning
@@ -38,7 +38,6 @@ export interface ContextRequestBody {
38
38
  task: string;
39
39
  workspace_id?: string;
40
40
  limit?: number;
41
- include_facts?: boolean;
42
41
  }
43
42
  export interface ContextArtifact extends SearchHit {
44
43
  }
package/dist/index.js CHANGED
@@ -22,10 +22,36 @@ import { driveSandboxCloneSchema, driveSandboxClone } from './tools/drive-sandbo
22
22
  import { driveSandboxExecSchema, driveSandboxExec } from './tools/drive-sandbox-exec.js';
23
23
  import { driveSandboxReadSchema, driveSandboxRead } from './tools/drive-sandbox-read.js';
24
24
  import { driveSandboxCommitSchema, driveSandboxCommit } from './tools/drive-sandbox-commit.js';
25
+ import { createRequire } from 'node:module';
26
+ const require = createRequire(import.meta.url);
27
+ const pkg = require('../package.json');
25
28
  const BASE_URL = process.env.AGENTDRIVE_API_URL || 'https://app.agentdrive.sh';
26
29
  const API_KEY = process.env.AGENTDRIVE_API_KEY;
27
30
  const AGENT_PLATFORM = process.env.AGENTDRIVE_AGENT_PLATFORM || 'claude-code';
28
31
  const AGENT_ROLE = process.env.AGENTDRIVE_AGENT_ROLE || '';
32
+ // Cross-host preamble shipped via MCP `instructions` so every MCP-aware
33
+ // client (Claude Code, Codex, Cursor, Zed, Cline, Continue, OpenClaw) gets
34
+ // the same usage guidance at session start without needing a per-host
35
+ // markdown file. Hosts that ALSO read a markdown rules file
36
+ // (~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, ~/.cursor/rules/agentdrive.mdc)
37
+ // continue to get the more verbose adrive init preamble via auto-context.ts.
38
+ const SERVER_INSTRUCTIONS = `AgentDrive — cross-agent artifact workspace with provenance for multi-agent workflows.
39
+
40
+ Reach for these tools without waiting to be asked:
41
+
42
+ - **Session start:** call \`drive_context\` with a short summary of the
43
+ current task. Returns the most relevant artifacts and last_run
44
+ summaries from prior agents' work in the same workspace, each with
45
+ an \`attribution\` block explaining *why* it was surfaced.
46
+ - **Cross-agent recall:** call \`drive_search\` (semantic) when the
47
+ user asks "what did Codex / Cursor / the last session do?"
48
+ - **Saving work:** call \`drive_write\` for any artifact worth keeping
49
+ so the next agent in the chain can read it back.
50
+ - **Provenance:** call \`drive_log_run\` at the end of meaningful
51
+ work so the cross-agent timeline stays accurate.
52
+
53
+ Privacy: if the user has Private Workspace on, written content is
54
+ encrypted client-side; the AgentDrive server only stores ciphertext.`;
29
55
  if (!API_KEY) {
30
56
  console.error('AGENTDRIVE_API_KEY environment variable is required');
31
57
  process.exit(1);
@@ -38,8 +64,10 @@ const client = new ApiClient({
38
64
  });
39
65
  const server = new McpServer({
40
66
  name: 'agentdrive',
41
- version: '0.4.0',
67
+ version: pkg.version,
42
68
  description: 'AgentDrive — the persistent workspace your agents share across Claude Code, Codex, Cursor, and LangGraph. Files, semantic search, run logging, cross-platform memory, and per-workspace Linux sandbox with git worktree.',
69
+ }, {
70
+ instructions: SERVER_INSTRUCTIONS,
43
71
  });
44
72
  server.tool('drive_write', 'Write a markdown file to a workspace. Creates or updates the file with automatic versioning.', driveWriteSchema, (args) => driveWrite(client, args));
45
73
  server.tool('drive_read', 'Read a file\'s content from a workspace.', driveReadSchema, (args) => driveRead(client, args));
@@ -57,10 +85,16 @@ server.tool('drive_search', "Semantic search across your org's artifacts in Agen
57
85
  server.tool('drive_recall', 'Recall persistent facts and preferences your agents have written. In v1 this returns semantic search results across artifacts; v1.5 will narrow to auto-extracted facts (preferences, decisions, key entities).', driveRecallSchema, (args) => driveRecall(client, args));
58
86
  server.tool('drive_log_run', "Log an agent run to AgentDrive's provenance store. Captures task, status, referenced/produced artifacts, and cross-platform identity (which agent on which tool). Used for retrospective context retrieval and team-wide audit.", driveLogRunSchema, (args) => driveLogRun(client, args));
59
87
  server.tool('drive_context', 'Auto-pull the most relevant artifacts from prior agent sessions for the task you are about to do. Combines semantic relevance with recency. Call this at the START of any non-trivial task to ground the agent in prior context — replaces manual copy-paste of artifacts between sessions.', driveContextSchema, (args) => driveContext(client, args));
60
- server.tool('drive_sandbox_clone', 'Clone a git repo into a per-workspace Linux sandbox. The sandbox persists across MCP sessions for the workspace. Use this to set up a real dev environment your other agents can also drive.', driveSandboxCloneSchema, (args) => driveSandboxClone(client, args));
61
- server.tool('drive_sandbox_exec', 'Run a shell command inside the per-workspace Linux sandbox. Captures stdout/stderr (64KB cap), exit code, and duration. Use for `npm install`, running tests, file ops — any real dev workflow.', driveSandboxExecSchema, (args) => driveSandboxExec(client, args));
62
- server.tool('drive_sandbox_read', 'Read a file from the per-workspace sandbox filesystem (e.g., generated build artifacts, test output, log files).', driveSandboxReadSchema, (args) => driveSandboxRead(client, args));
63
- server.tool('drive_sandbox_commit', 'Stage + commit the current sandbox worktree. The commit surfaces as an AgentDrive artifact at commits/<sha>.json with cross-agent provenance — other agents on other platforms can see who shipped what.', driveSandboxCommitSchema, (args) => driveSandboxCommit(client, args));
88
+ // The four drive_sandbox_* tools are EXPERIMENTAL. They require the
89
+ // Cloudflare Containers plan on the AgentDrive worker; without that
90
+ // binding the API returns 503 and these tools surface a clean
91
+ // "not configured" message. Marked experimental in the description
92
+ // so MCP-aware hosts that surface tool metadata can communicate the
93
+ // status; not part of the v1 cross-agent value prop.
94
+ server.tool('drive_sandbox_clone', '[EXPERIMENTAL] Clone a git repo into a per-workspace Linux sandbox. Requires Cloudflare Containers on the AgentDrive worker; gracefully degrades to a 503 with "sandbox not configured" otherwise.', driveSandboxCloneSchema, (args) => driveSandboxClone(client, args));
95
+ server.tool('drive_sandbox_exec', '[EXPERIMENTAL] Run a shell command inside the per-workspace Linux sandbox. Captures stdout/stderr (64 KB cap), exit code, duration. Requires Cloudflare Containers; degrades to 503 otherwise.', driveSandboxExecSchema, (args) => driveSandboxExec(client, args));
96
+ server.tool('drive_sandbox_read', '[EXPERIMENTAL] Read a file from the per-workspace sandbox filesystem (build artifacts, test output, logs). Requires Cloudflare Containers; degrades to 503 otherwise.', driveSandboxReadSchema, (args) => driveSandboxRead(client, args));
97
+ server.tool('drive_sandbox_commit', '[EXPERIMENTAL] Stage + commit the current sandbox worktree. Surfaces as an AgentDrive artifact at commits/<sha>.json. Requires Cloudflare Containers; degrades to 503 otherwise.', driveSandboxCommitSchema, (args) => driveSandboxCommit(client, args));
64
98
  async function main() {
65
99
  const transport = new StdioServerTransport();
66
100
  await server.connect(transport);
@@ -4,13 +4,11 @@ export declare const driveContextSchema: {
4
4
  task: z.ZodString;
5
5
  workspace_id: z.ZodOptional<z.ZodString>;
6
6
  limit: z.ZodOptional<z.ZodNumber>;
7
- include_facts: z.ZodOptional<z.ZodBoolean>;
8
7
  };
9
8
  export declare function driveContext(client: ApiClient, args: {
10
9
  task: string;
11
10
  workspace_id?: string;
12
11
  limit?: number;
13
- include_facts?: boolean;
14
12
  }): Promise<{
15
13
  content: {
16
14
  type: "text";
@@ -3,14 +3,12 @@ export const driveContextSchema = {
3
3
  task: z.string().min(1).max(2000).describe('What you are about to do — used to rank prior artifacts by relevance'),
4
4
  workspace_id: z.string().optional().describe('Scope to a single workspace; omit for org-wide context'),
5
5
  limit: z.number().int().positive().max(20).optional().describe('Max artifacts to return (default 5, max 20)'),
6
- include_facts: z.boolean().optional().describe('Include extracted facts alongside artifacts (v1.5+)'),
7
6
  };
8
7
  export async function driveContext(client, args) {
9
8
  const { artifacts } = await client.context({
10
9
  task: args.task,
11
10
  workspace_id: args.workspace_id,
12
11
  limit: args.limit ?? 5,
13
- include_facts: args.include_facts ?? false,
14
12
  });
15
13
  if (artifacts.length === 0) {
16
14
  return { content: [{ type: 'text', text: 'No prior context found.' }] };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adrive/mcp-server",
3
- "version": "0.4.0",
4
- "description": "MCP server for AgentDrive — the persistent workspace your agents share across Claude Code, Codex, Cursor, and LangGraph. Files, semantic search, run logging, cross-platform memory, and per-workspace agent sandboxing.",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for AgentDrive — cross-agent artifact workspace with provenance and portable storage across Claude Code, Codex, Cursor, and LangGraph.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "bin": {