@agent-workspace/mcp-server 0.2.0 → 0.4.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 ADDED
@@ -0,0 +1,103 @@
1
+ # @agent-workspace/mcp-server
2
+
3
+ MCP server for the [Agent Workspace Protocol](https://github.com/marcoloco23/awp) — plug any AWP workspace into Claude Code, Cursor, or any MCP-compatible client.
4
+
5
+ ## Setup
6
+
7
+ ### Claude Code
8
+
9
+ ```bash
10
+ claude mcp add awp-workspace -- npx @agent-workspace/mcp-server
11
+ ```
12
+
13
+ ### With a specific workspace path
14
+
15
+ ```bash
16
+ AWP_WORKSPACE=/path/to/workspace npx @agent-workspace/mcp-server
17
+ ```
18
+
19
+ ### Generic MCP client
20
+
21
+ The server communicates over stdio using the [Model Context Protocol](https://modelcontextprotocol.io). Point any MCP client at:
22
+
23
+ ```bash
24
+ npx @agent-workspace/mcp-server
25
+ ```
26
+
27
+ It will auto-discover the AWP workspace from the current directory (or use `AWP_WORKSPACE` env var).
28
+
29
+ ## Tools
30
+
31
+ ### Core Identity & Context
32
+
33
+ | Tool | Description |
34
+ |------|-------------|
35
+ | `awp_read_identity` | Read agent identity (name, capabilities, DID) |
36
+ | `awp_read_soul` | Read behavioral constraints (values, boundaries, governance) |
37
+ | `awp_read_user` | Read human profile |
38
+ | `awp_read_agents` | Read operations config (AGENTS.md) |
39
+ | `awp_read_tools` | Read tools config (TOOLS.md) |
40
+ | `awp_read_heartbeat` | Read heartbeat config (HEARTBEAT.md) |
41
+
42
+ ### Memory Operations
43
+
44
+ | Tool | Description |
45
+ |------|-------------|
46
+ | `awp_read_memory` | Read memory (daily, longterm, or recent logs) |
47
+ | `awp_write_memory` | Log structured memory entries to daily log |
48
+
49
+ ### Knowledge Artifacts (SMP)
50
+
51
+ | Tool | Description |
52
+ |------|-------------|
53
+ | `awp_artifact_read` | Read a knowledge artifact by slug |
54
+ | `awp_artifact_write` | Create or update a knowledge artifact with versioning |
55
+ | `awp_artifact_list` | List all artifacts (optional tag filter) |
56
+ | `awp_artifact_search` | Search artifacts by content, title, or tags |
57
+
58
+ ### Reputation (RDP)
59
+
60
+ | Tool | Description |
61
+ |------|-------------|
62
+ | `awp_reputation_query` | Query reputation profiles with time-based decay applied |
63
+ | `awp_reputation_signal` | Log reputation signals (uses EWMA with decay) |
64
+
65
+ ### Delegation Contracts (RDP)
66
+
67
+ | Tool | Description |
68
+ |------|-------------|
69
+ | `awp_contract_create` | Create delegation contracts between agents |
70
+ | `awp_contract_evaluate` | Evaluate contracts and generate reputation signals |
71
+ | `awp_contract_list` | List all contracts with optional status filter |
72
+
73
+ ### Workspace Management
74
+
75
+ | Tool | Description |
76
+ |------|-------------|
77
+ | `awp_workspace_status` | Workspace health check (files present, stats) |
78
+
79
+ ## How It Works
80
+
81
+ The MCP server reads and writes AWP workspace files directly — no database, no daemon. Your agent's identity, memory, knowledge artifacts, and reputation profiles are just Markdown files with YAML frontmatter, stored in a directory and compatible with Git.
82
+
83
+ When an AI agent connects via MCP, it can:
84
+ - **Read** its identity, soul, and user context at the start of each session
85
+ - **Write** memory entries as it works
86
+ - **Create and update** knowledge artifacts with full provenance tracking
87
+ - **Search** its accumulated knowledge
88
+ - **Query and update** reputation profiles for itself and other agents
89
+ - **Create and evaluate** delegation contracts for multi-agent coordination
90
+
91
+ ## Part of AWP
92
+
93
+ This package is part of the [Agent Workspace Protocol](https://github.com/marcoloco23/awp) monorepo:
94
+
95
+ | Package | Description |
96
+ |---------|-------------|
97
+ | [@agent-workspace/core](https://www.npmjs.com/package/@agent-workspace/core) | Types, constants, JSON schemas |
98
+ | [@agent-workspace/cli](https://www.npmjs.com/package/@agent-workspace/cli) | CLI tool |
99
+ | **@agent-workspace/mcp-server** | MCP server |
100
+
101
+ ## License
102
+
103
+ Apache-2.0
package/dist/index.d.ts CHANGED
@@ -1,3 +1,19 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ /**
3
+ * Validate that a path is within the workspace root (prevents directory traversal).
4
+ * Returns the normalized absolute path if valid, or throws an error.
5
+ * @internal Available for future use in tool handlers
6
+ */
7
+ export declare function _validatePath(root: string, targetPath: string): string;
8
+ /**
9
+ * Validate and sanitize a slug.
10
+ * Slugs must be lowercase alphanumeric with hyphens, not starting with hyphen.
11
+ * @internal Available for future use in tool handlers
12
+ */
13
+ export declare function _validateSlug(slug: string): string;
14
+ /**
15
+ * Read a file with size limit check.
16
+ * @internal Available for future use in tool handlers
17
+ */
18
+ export declare function _safeReadFile(path: string): Promise<string>;
3
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAkCA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAUtE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYlD;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMjE"}