@atlasauth/pca-mcp 0.1.0 → 0.2.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 +21 -0
- package/README.md +32 -10
- package/package.json +26 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atlas Authorization
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,37 +1,59 @@
|
|
|
1
1
|
# @atlasauth/pca-mcp
|
|
2
2
|
|
|
3
|
-
Model Context Protocol adapter for Proof-Carrying Authority
|
|
3
|
+
Model Context Protocol adapter for Proof-Carrying Authority (PCA). `withPCA` wraps an MCP tool handler so every call first builds a signed PCActn (failing fast if the agent's own grant does not permit it), hands you the proof to forward to the resource server, and then runs the original handler.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm i @atlasauth/pca-mcp
|
|
9
|
-
# peer dependency
|
|
10
|
-
npm i @modelcontextprotocol/sdk
|
|
8
|
+
npm i @atlasauth/pca-mcp @atlasauth/pca
|
|
9
|
+
npm i @modelcontextprotocol/sdk # optional peer dependency (^1)
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
`@modelcontextprotocol/sdk` (^1) is an optional peer dependency.
|
|
14
|
-
|
|
15
12
|
## Usage
|
|
16
13
|
|
|
17
14
|
```ts
|
|
15
|
+
import { agent, generateKeyPair } from '@atlasauth/pca';
|
|
18
16
|
import { withPCA } from '@atlasauth/pca-mcp';
|
|
19
17
|
|
|
18
|
+
const pcaAgent = agent({
|
|
19
|
+
principal: generateKeyPair(),
|
|
20
|
+
goal: 'process refunds',
|
|
21
|
+
permissions: { stripe: ['refund'] },
|
|
22
|
+
limits: { refund: '$500/day' },
|
|
23
|
+
aud: 'ins_acme',
|
|
24
|
+
});
|
|
25
|
+
|
|
20
26
|
server.tool(
|
|
21
27
|
'refund',
|
|
22
28
|
schema,
|
|
23
29
|
withPCA(
|
|
24
|
-
|
|
30
|
+
pcaAgent,
|
|
25
31
|
{
|
|
26
32
|
verb: 'stripe.refund',
|
|
27
33
|
resource: (args) => `ch_${args.chargeId}`,
|
|
28
|
-
onProof: (pca) => {
|
|
34
|
+
onProof: (pca, args) => {
|
|
35
|
+
// forward pca.headers (PCA-Action) to the resource server with your request
|
|
36
|
+
},
|
|
29
37
|
},
|
|
30
38
|
async (args) => ({ content: [{ type: 'text', text: await doRefund(args) }] }),
|
|
31
39
|
),
|
|
32
40
|
);
|
|
33
41
|
```
|
|
34
42
|
|
|
35
|
-
The wrapped handler keeps the MCP handler shape
|
|
43
|
+
The wrapped handler keeps the MCP handler shape `(args, extra?) => result`. When the local dry-run denies the action it returns an MCP error result (`isError: true`) instead of throwing, so the model can see the refusal.
|
|
44
|
+
|
|
45
|
+
## API
|
|
46
|
+
|
|
47
|
+
- `withPCA(agent, spec, handler)` - spec is `{ verb, resource, aud?, failFast?, onProof? }`.
|
|
48
|
+
- `guardToolResult(pca, result)` - adds the encoded PCActn to a tool result's `_meta['x-pca-action']`, keeping existing content.
|
|
49
|
+
- Re-exports `bridgeToolCall`, `pcaHeaders`, and the `PcaCall` type from `@atlasauth/pca`.
|
|
50
|
+
|
|
51
|
+
To make the server that receives these calls an OAuth resource server, see `@atlasauth/pca-mcp-rs`.
|
|
52
|
+
|
|
53
|
+
## Status
|
|
54
|
+
|
|
55
|
+
This package does not authorize anything. It attaches a proof-carrying action; the resource server's verifier (see `@atlasauth/pca`) decides. The MCP SDK is matched structurally and never imported. PCA cryptography has not been independently audited.
|
|
56
|
+
|
|
57
|
+
## License
|
|
36
58
|
|
|
37
|
-
|
|
59
|
+
MIT - see LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Model Context Protocol adapter for Proof-Carrying Authority: wrap an MCP tool handler so every call emits a PCActn (and attaches the proof) before the handler runs.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model context protocol",
|
|
8
|
+
"tool calling",
|
|
9
|
+
"agent authorization",
|
|
10
|
+
"proof-carrying authority",
|
|
11
|
+
"pca",
|
|
12
|
+
"ai agents"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
22
|
+
"directory": "packages/pca-mcp"
|
|
23
|
+
},
|
|
5
24
|
"main": "./dist/index.js",
|
|
6
25
|
"types": "./dist/index.d.ts",
|
|
7
26
|
"exports": {
|
|
@@ -12,7 +31,7 @@
|
|
|
12
31
|
"./package.json": "./package.json"
|
|
13
32
|
},
|
|
14
33
|
"dependencies": {
|
|
15
|
-
"@atlasauth/pca": "0.
|
|
34
|
+
"@atlasauth/pca": "0.2.0"
|
|
16
35
|
},
|
|
17
36
|
"peerDependencies": {
|
|
18
37
|
"@modelcontextprotocol/sdk": "^1"
|
|
@@ -28,8 +47,12 @@
|
|
|
28
47
|
},
|
|
29
48
|
"files": [
|
|
30
49
|
"dist",
|
|
31
|
-
"README.md"
|
|
50
|
+
"README.md",
|
|
51
|
+
"LICENSE"
|
|
32
52
|
],
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=20"
|
|
55
|
+
},
|
|
33
56
|
"publishConfig": {
|
|
34
57
|
"access": "public"
|
|
35
58
|
},
|