@acepaste/ingress-mcp 0.0.0-stage → 0.8.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/LICENSE +105 -0
- package/README.md +20 -2
- package/dist/server.js +90 -0
- package/package.json +53 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 ThinkWell Labs LLC
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @acepaste/ingress-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AcePaste Ingress as a Model Context Protocol server. Put it in front of an agent's web access: hostile pages are refused and never reach the model; every verdict leaves a signed receipt.
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"mcpServers": {
|
|
8
|
+
"acepaste-ingress": {
|
|
9
|
+
"command": "npx",
|
|
10
|
+
"args": ["-y", "@acepaste/ingress-mcp"],
|
|
11
|
+
"env": { "INGRESS_SANDBOX": "off" }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Tools: `ingress_fetch(url, override?)`, `ingress_scan(content, source?, contentType?, override?)`, `ingress_status()`, `ingress_confirm()`, `ingress_verify_receipt(receipt)`.
|
|
18
|
+
|
|
19
|
+
Environment: `INGRESS_SIGNING_KEY`, `INGRESS_HOSTILE`, `INGRESS_SUSPECT`, `INGRESS_CLOAKING=0`, `INGRESS_SANDBOX=off|escalate|always`, `INGRESS_POLICY=path`, `INGRESS_LOG=path`.
|
|
20
|
+
|
|
21
|
+
Full documentation: https://github.com/sugarcypher/acepasteINGRESS
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AcePaste Ingress — Model Context Protocol server (stdio).
|
|
4
|
+
*
|
|
5
|
+
* Tools:
|
|
6
|
+
* ingress_fetch(url, override?) gate a web page
|
|
7
|
+
* ingress_scan(content, ...) gate text/HTML/markdown/JSON already in hand
|
|
8
|
+
* ingress_status() taint state of this session
|
|
9
|
+
* ingress_confirm() human confirmed a side-effect while tainted
|
|
10
|
+
* ingress_verify_receipt(receipt) check a receipt's digest and signature
|
|
11
|
+
*
|
|
12
|
+
* Environment:
|
|
13
|
+
* INGRESS_SIGNING_PRIVATE_KEY_FILE ECDSA P-256 key for publicly verifiable receipts (preferred; or INGRESS_SIGNING_PRIVATE_KEY as PEM)
|
|
14
|
+
* INGRESS_SIGNING_KEY HMAC key for receipts (fallback: whoever can verify can also forge)
|
|
15
|
+
* INGRESS_VERIFY_PUBLIC_KEY PEM used by ingress_verify_receipt for receipts from another instance
|
|
16
|
+
* INGRESS_HOSTILE=0.7 hostile threshold
|
|
17
|
+
* INGRESS_SUSPECT=0.25 suspect threshold
|
|
18
|
+
* INGRESS_CLOAKING=1 set 0 to disable the second fetch
|
|
19
|
+
* INGRESS_SANDBOX=escalate off | escalate | always
|
|
20
|
+
* INGRESS_POLICY=path policy JSON (thresholds, net, domains)
|
|
21
|
+
* INGRESS_LOG=path append attack log (JSON lines) to a file
|
|
22
|
+
*/
|
|
23
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
24
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
25
|
+
import { z } from "zod";
|
|
26
|
+
import { appendFileSync, readFileSync } from "node:fs";
|
|
27
|
+
import { IngressEngine, createTaintGuard, loadPolicyFile, cloakingConfigFromEnv, HONEST_USER_AGENT, ENGINE_VERSION } from "@acepaste/ingress";
|
|
28
|
+
const env = process.env;
|
|
29
|
+
const logPath = env.INGRESS_LOG;
|
|
30
|
+
const cfg = env.INGRESS_POLICY ? loadPolicyFile(env.INGRESS_POLICY) : {};
|
|
31
|
+
if (env.INGRESS_SIGNING_KEY)
|
|
32
|
+
cfg.signingKey = env.INGRESS_SIGNING_KEY;
|
|
33
|
+
// ECDSA P-256 private key (PEM, or a path to one). Preferred: receipts become verifiable by anyone with the public key.
|
|
34
|
+
{
|
|
35
|
+
const k = env.INGRESS_SIGNING_PRIVATE_KEY_FILE ? readFileSync(env.INGRESS_SIGNING_PRIVATE_KEY_FILE, "utf8") : env.INGRESS_SIGNING_PRIVATE_KEY;
|
|
36
|
+
if (k)
|
|
37
|
+
cfg.signingPrivateKey = k.includes("BEGIN") ? k.replace(/\\n/g, "\n") : readFileSync(k, "utf8");
|
|
38
|
+
}
|
|
39
|
+
if (env.INGRESS_HOSTILE)
|
|
40
|
+
cfg.hostileThreshold = Number(env.INGRESS_HOSTILE);
|
|
41
|
+
if (env.INGRESS_SUSPECT)
|
|
42
|
+
cfg.suspectThreshold = Number(env.INGRESS_SUSPECT);
|
|
43
|
+
Object.assign(cfg, cloakingConfigFromEnv(env, HONEST_USER_AGENT));
|
|
44
|
+
if (env.INGRESS_CLOAKING === "0")
|
|
45
|
+
cfg.cloakingCheck = false;
|
|
46
|
+
if (env.INGRESS_SANDBOX === "off" || env.INGRESS_SANDBOX === "escalate" || env.INGRESS_SANDBOX === "always")
|
|
47
|
+
cfg.sandbox = env.INGRESS_SANDBOX;
|
|
48
|
+
const engine = new IngressEngine(cfg, {
|
|
49
|
+
log: (e) => {
|
|
50
|
+
const line = JSON.stringify(e) + "\n";
|
|
51
|
+
if (logPath)
|
|
52
|
+
appendFileSync(logPath, line);
|
|
53
|
+
else
|
|
54
|
+
process.stderr.write(line);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
const guard = createTaintGuard();
|
|
58
|
+
const server = new McpServer({ name: "acepaste-ingress", version: ENGINE_VERSION });
|
|
59
|
+
const present = (r) => {
|
|
60
|
+
const taint = guard.ingest(r);
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: r.envelope }],
|
|
63
|
+
structuredContent: { tier: r.tier, score: r.score, contentKind: r.contentKind, overridden: r.overridden, receipt: r.receipt, findings: r.findings, taint, timings: r.timings },
|
|
64
|
+
isError: r.tier !== "clean" && !r.overridden,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
server.registerTool("ingress_fetch", {
|
|
68
|
+
title: "Fetch a web page through AcePaste Ingress",
|
|
69
|
+
description: "Fetches a URL and returns its text inside a provenance envelope. Clean pages pass. Suspect and hostile pages are refused and only the attack classification is returned. A suspect refusal may be overridden with override=true ONLY when the human has explicitly asked for that page anyway; hostile is never overridable. Use this instead of any raw fetch tool.",
|
|
70
|
+
inputSchema: { url: z.string().url(), override: z.boolean().optional().describe("Set true only when the human explicitly asked to fetch a suspect page anyway") },
|
|
71
|
+
}, async ({ url, override }) => present(await engine.fetch(url, { override })));
|
|
72
|
+
server.registerTool("ingress_scan", {
|
|
73
|
+
title: "Scan content through AcePaste Ingress",
|
|
74
|
+
description: "Gate content already in hand (a tool result, a pasted document, a file): HTML, markdown, JSON or plain text. Same verdict policy as ingress_fetch.",
|
|
75
|
+
inputSchema: {
|
|
76
|
+
content: z.string().max(5_000_000),
|
|
77
|
+
source: z.string().optional().describe("where the content came from, for the receipt"),
|
|
78
|
+
contentType: z.string().optional().describe("MIME type if known"),
|
|
79
|
+
isHtml: z.boolean().optional(),
|
|
80
|
+
override: z.boolean().optional(),
|
|
81
|
+
},
|
|
82
|
+
}, async ({ content, source, contentType, isHtml, override }) => present(await engine.scan(content, { url: source, contentType, isHtml, override })));
|
|
83
|
+
server.registerTool("ingress_status", { title: "Taint state of this session", description: "Whether untrusted content has been ingested and which sources caused it.", inputSchema: {} }, async () => ({ content: [{ type: "text", text: JSON.stringify(guard.state) }], structuredContent: { ...guard.state } }));
|
|
84
|
+
server.registerTool("ingress_confirm", { title: "Confirm a side-effect while tainted", description: "Call only after the human has explicitly approved the pending side-effecting action.", inputSchema: {} }, async () => { guard.confirm(); return { content: [{ type: "text", text: "confirmed for 60 seconds" }] }; });
|
|
85
|
+
server.registerTool("ingress_verify_receipt", { title: "Verify a gate receipt", description: "Checks a receipt's digest and, its signature against this server's public key (ECDSA) or shared secret (HMAC).", inputSchema: { receipt: z.record(z.string(), z.any()) } }, async ({ receipt }) => {
|
|
86
|
+
const v = IngressEngine.verifyReceipt(receipt, receipt.signatureAlg === "ecdsa-p256-sha256" ? (env.INGRESS_VERIFY_PUBLIC_KEY ?? engine.publicKey()?.publicKeyPem) : env.INGRESS_SIGNING_KEY);
|
|
87
|
+
return { content: [{ type: "text", text: JSON.stringify(v) }], structuredContent: v };
|
|
88
|
+
});
|
|
89
|
+
const transport = new StdioServerTransport();
|
|
90
|
+
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acepaste/ingress-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "AcePaste Ingress as a Model Context Protocol server: ingress_fetch and ingress_scan tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/server.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"ingress-mcp": "dist/server.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json",
|
|
12
|
+
"start": "node dist/server.js"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@acepaste/ingress": "0.8.0",
|
|
16
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
17
|
+
"zod": "^4.6.7"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^22.0.0",
|
|
21
|
+
"typescript": "^5.5.0"
|
|
22
|
+
},
|
|
23
|
+
"license": "FSL-1.1-ALv2",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/sugarcypher/acepasteINGRESS.git",
|
|
27
|
+
"directory": "packages/mcp"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/sugarcypher/acepasteINGRESS#readme",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/sugarcypher/acepasteINGRESS/issues"
|
|
32
|
+
},
|
|
33
|
+
"author": "Briar Morgan Greenway (ThinkWell Labs LLC)",
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=20"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"prompt-injection",
|
|
42
|
+
"ai-security",
|
|
43
|
+
"llm",
|
|
44
|
+
"mcp",
|
|
45
|
+
"model-context-protocol",
|
|
46
|
+
"unicode",
|
|
47
|
+
"supply-chain",
|
|
48
|
+
"acepaste"
|
|
49
|
+
],
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE"
|
|
54
|
+
]
|
|
55
|
+
}
|