@aipermission/mcp 0.2.15 → 0.2.17
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 +27 -7
- package/dist/resources/aipermission-operator/SKILL.md +30 -0
- package/dist/server.js +48 -0
- package/dist/vault-tools.js +17 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@ credentials, or other connector secrets.
|
|
|
8
8
|
|
|
9
9
|
The gateway is intentionally local-only. Run it on the developer machine and
|
|
10
10
|
keep the URL on `localhost`; remote systems are connector targets, not places
|
|
11
|
-
to host the gateway for LAN or internet users. SSH, Postgres,
|
|
12
|
-
Docker, and Kubernetes are built-in connectors that use the same
|
|
11
|
+
to host the gateway for LAN or internet users. SSH, Postgres, ClickHouse,
|
|
12
|
+
Redis / Valkey, RabbitMQ, S3, Docker, and Kubernetes are built-in connectors that use the same
|
|
13
13
|
target/profile/action permission model as future connectors.
|
|
14
14
|
|
|
15
15
|

|
|
@@ -60,9 +60,13 @@ The generated MCP config contains a bearer token. Keep it private. For project-l
|
|
|
60
60
|
- `get_connector_actions`
|
|
61
61
|
- `call_connector_action`
|
|
62
62
|
- `get_connector_action_request`
|
|
63
|
+
- `list_vault_items`
|
|
64
|
+
- `call_vault_action`
|
|
65
|
+
- `get_vault_action_request`
|
|
66
|
+
- `cancel_vault_action_request`
|
|
63
67
|
|
|
64
|
-
All integration work goes through connector targets. SSH, Postgres,
|
|
65
|
-
RabbitMQ, Docker, Kubernetes, and future connectors share the same model: target,
|
|
68
|
+
All integration work goes through connector targets. SSH, Postgres, ClickHouse,
|
|
69
|
+
Redis / Valkey, RabbitMQ, S3, Docker, Kubernetes, and future connectors share the same model: target,
|
|
66
70
|
credential profile, connector action, token action permission, approval,
|
|
67
71
|
history, and audit.
|
|
68
72
|
|
|
@@ -72,6 +76,19 @@ from disabled projects are omitted from discovery and rejected on direct calls;
|
|
|
72
76
|
their saved action grants are preserved for later re-enablement. Projects are
|
|
73
77
|
not multi-user or hosted RBAC.
|
|
74
78
|
|
|
79
|
+
Project Vault stores project-scoped secret values in the encrypted local
|
|
80
|
+
database. MCP can list non-secret item metadata only when the token has
|
|
81
|
+
`vault.metadata.read`. Secret generation and supported console-session
|
|
82
|
+
application use explicit Disabled, Prompt, or Always project capabilities.
|
|
83
|
+
Prompt creates a local approval request; Always executes immediately through
|
|
84
|
+
the same tracked context-validation path. Poll `get_vault_action_request` for
|
|
85
|
+
pending requests, which expire after 15 minutes and may be declined, canceled,
|
|
86
|
+
expired, or stale. Raw values are never returned by this package.
|
|
87
|
+
Session item input is strict: only `item_id`, `source_project_id`, and optional
|
|
88
|
+
`replace_existing` are accepted. Lease expiry ends MCP authorization for the
|
|
89
|
+
exact session but cannot guarantee that a remote process erased inherited
|
|
90
|
+
environment values.
|
|
91
|
+
|
|
75
92
|
For SSH, call `get_connector_actions(target_ref)` to discover actions such as
|
|
76
93
|
`exec`, `read_console`, `restart_console_session`, `browse_remote_files`, and
|
|
77
94
|
`start_file_download`. SSH `exec` is intended for non-interactive commands. Use
|
|
@@ -82,9 +99,12 @@ table, and bounded read-only query actions. Postgres targets can connect
|
|
|
82
99
|
directly from the gateway or over an SSH connector profile when the database is
|
|
83
100
|
reachable only from a remote server.
|
|
84
101
|
|
|
85
|
-
For Redis, call `get_connector_actions(target_ref)` to discover
|
|
86
|
-
browser actions such as `scan_keys`, `get_key`, `set_string`,
|
|
87
|
-
`delete_keys`.
|
|
102
|
+
For Redis or Valkey, call `get_connector_actions(target_ref)` to discover
|
|
103
|
+
bounded key-browser actions such as `scan_keys`, `get_key`, `set_string`,
|
|
104
|
+
`expire_key`, and `delete_keys`. Both products intentionally use the `redis`
|
|
105
|
+
connector kind and target-ref prefix; no separate Valkey MCP tool family is
|
|
106
|
+
required. The current connector uses RESP2 against one configured endpoint and
|
|
107
|
+
does not provide Cluster or Sentinel routing.
|
|
88
108
|
|
|
89
109
|
For RabbitMQ, call `get_connector_actions(target_ref)` to discover queue
|
|
90
110
|
browser actions such as `overview`, `list_vhosts`, `list_queues`, `get_queue`,
|
|
@@ -187,3 +187,33 @@ files or environment files.
|
|
|
187
187
|
|
|
188
188
|
If a secret appears in output, do not repeat it. Summarize the finding and ask
|
|
189
189
|
the operator how to rotate or redact it.
|
|
190
|
+
|
|
191
|
+
## Project Vault Practice
|
|
192
|
+
|
|
193
|
+
Use Project Vault only through its dedicated tools:
|
|
194
|
+
|
|
195
|
+
1. Call `list_vault_items(project_ref)` to discover names and non-secret
|
|
196
|
+
metadata. Never ask the gateway to reveal values.
|
|
197
|
+
2. Use `call_vault_action` with `generate_item` only when the operator asked for
|
|
198
|
+
a new secret. Use a stable, unique `idempotency_key`. Send `tags` as a string
|
|
199
|
+
array, `shared_project_ids` as an integer array, and `usage_notes` as an
|
|
200
|
+
array of `{location, notes}` objects containing non-secret context.
|
|
201
|
+
3. Use `restart_session_with_environment` only for the exact target/profile and
|
|
202
|
+
item assignments needed for the task. This closes the target profile's
|
|
203
|
+
current console session and starts a replacement session; do not use it
|
|
204
|
+
during unrelated interactive work without warning the operator. Each item
|
|
205
|
+
entry may contain only `item_id`, `source_project_id`, and optional
|
|
206
|
+
`replace_existing`. Cross-project use is allowed only when the token can
|
|
207
|
+
access both the target and source projects.
|
|
208
|
+
4. If the response is `approval_pending`, wait for local approval and poll
|
|
209
|
+
`get_vault_action_request`. Prompt approvals expire after 15 minutes. An
|
|
210
|
+
Always grant may return a terminal result immediately.
|
|
211
|
+
5. Use `cancel_vault_action_request` when an approval is no longer needed.
|
|
212
|
+
|
|
213
|
+
Vault actions follow the configured Disabled, Prompt, or Always project
|
|
214
|
+
capability. A completed response contains metadata, never the secret. Do not
|
|
215
|
+
try to recover a value by printing the environment. Prompt and Always sessions
|
|
216
|
+
can still send a secret elsewhere, so use the narrowest item set and
|
|
217
|
+
least-privilege service credentials.
|
|
218
|
+
Lease expiry ends agent access to the exact session; it does not guarantee that
|
|
219
|
+
the remote shell or detached child processes erased inherited values.
|
package/dist/server.js
CHANGED
|
@@ -10,6 +10,7 @@ import { readFileSync } from "node:fs";
|
|
|
10
10
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
11
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
|
+
import { callVaultActionSchema, listVaultItemsSchema, vaultActionRequestSchema } from "./vault-tools.js";
|
|
13
14
|
import { normalizeLocalAPIURL } from "./local-url.js";
|
|
14
15
|
import { jsonToolResult } from "./results.js";
|
|
15
16
|
|
|
@@ -90,6 +91,53 @@ server.tool(
|
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
|
|
94
|
+
server.tool(
|
|
95
|
+
"list_vault_items",
|
|
96
|
+
"List secret names and bounded non-secret Vault metadata for projects this token can read. Secret values are never returned.",
|
|
97
|
+
listVaultItemsSchema,
|
|
98
|
+
async ({ project_ref }) => {
|
|
99
|
+
return jsonToolResult(() => {
|
|
100
|
+
const params = new URLSearchParams();
|
|
101
|
+
if (project_ref) params.set("project_ref", project_ref);
|
|
102
|
+
const query = params.toString();
|
|
103
|
+
return apiGet(`/api/mcp/vault-items${query ? `?${query}` : ""}`);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
server.tool(
|
|
109
|
+
"call_vault_action",
|
|
110
|
+
"Run a Vault action under the configured project capability. Prompt waits for local approval; Always executes immediately through the same tracked request path. generate_item input accepts name, secret_type, generator_kind, provider, environment, description, expires_at, expiry_warning_days, tags (string array), usage_notes (array of {location, notes}), and shared_project_ids (integer array). restart_session_with_environment input requires target_ref and items with item_id, source_project_id, and optional replace_existing. Never include raw secret values.",
|
|
111
|
+
callVaultActionSchema,
|
|
112
|
+
async ({ project_ref, action_name, input, reason, idempotency_key }) => {
|
|
113
|
+
return jsonToolResult(() => apiPost("/api/mcp/vault-actions/call", {
|
|
114
|
+
project_ref,
|
|
115
|
+
action_name,
|
|
116
|
+
input,
|
|
117
|
+
reason,
|
|
118
|
+
idempotency_key,
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
server.tool(
|
|
124
|
+
"get_vault_action_request",
|
|
125
|
+
"Read one Vault action request after call_vault_action returns approval_pending. Responses never include secret values.",
|
|
126
|
+
vaultActionRequestSchema,
|
|
127
|
+
async ({ request_id }) => {
|
|
128
|
+
return jsonToolResult(() => apiGet(`/api/mcp/vault-action-requests/${request_id}`));
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
server.tool(
|
|
133
|
+
"cancel_vault_action_request",
|
|
134
|
+
"Cancel one approval_pending Vault action request owned by this token. Running or terminal requests cannot be canceled.",
|
|
135
|
+
vaultActionRequestSchema,
|
|
136
|
+
async ({ request_id }) => {
|
|
137
|
+
return jsonToolResult(() => apiPost(`/api/mcp/vault-action-requests/${request_id}/cancel`, {}));
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
|
|
93
141
|
const transport = new StdioServerTransport();
|
|
94
142
|
await server.connect(transport);
|
|
95
143
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const listVaultItemsSchema = {
|
|
4
|
+
project_ref: z.string().min(1).optional().describe("Optional project id or slug. Omit to list every readable project."),
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const callVaultActionSchema = {
|
|
8
|
+
project_ref: z.string().min(1).describe("Owning project id or slug."),
|
|
9
|
+
action_name: z.enum(["generate_item", "restart_session_with_environment"]),
|
|
10
|
+
input: z.record(z.unknown()).describe("Action input. Never include raw secret values."),
|
|
11
|
+
reason: z.string().min(1).describe("Why this Vault action is needed."),
|
|
12
|
+
idempotency_key: z.string().min(1).max(128).describe("Caller-stable key used to prevent duplicate action requests."),
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const vaultActionRequestSchema = {
|
|
16
|
+
request_id: z.number().int().positive().describe("Request id returned by call_vault_action."),
|
|
17
|
+
};
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"name": "io.github.aipermission/aipermission-mcp",
|
|
4
4
|
"title": "AIPermission",
|
|
5
5
|
"description": "Local-first MCP bridge for the AIPermission gateway.",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.17",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "@aipermission/mcp",
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.17",
|
|
12
12
|
"transport": {
|
|
13
13
|
"type": "stdio"
|
|
14
14
|
}
|