aipou-mcp-server 0.3.0 → 0.3.1
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 +5 -5
- package/dist/index.js +2 -1
- package/dist/version.d.ts +1 -0
- package/dist/version.js +10 -0
- package/dist/version.test.d.ts +1 -0
- package/dist/version.test.js +26 -0
- package/package.json +2 -2
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -6,21 +6,21 @@ It does not detect hidden AI use, prove task quality, replace payment rails, or
|
|
|
6
6
|
|
|
7
7
|
## Fast Local Adoption Test
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Create and verify one disposable local receipt without cloning anything:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
13
|
-
npm run demo -w mcp-server
|
|
12
|
+
npx -y aipou-mcp-server --demo
|
|
14
13
|
```
|
|
15
14
|
|
|
16
15
|
The command needs no wallet setup, funds, network, or claims. It prints a
|
|
17
16
|
framework-ready `workReceiptId` object and deletes its ephemeral wallet,
|
|
18
17
|
collector key, and receipt state before exiting.
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
From a source checkout, the same check runs with:
|
|
21
20
|
|
|
22
21
|
```bash
|
|
23
|
-
|
|
22
|
+
npm install
|
|
23
|
+
npm run demo -w mcp-server
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
For a complete framework lifecycle example, continue with the adapter below.
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,14 @@ import { agentWallet } from "./identity.js";
|
|
|
11
11
|
import { beginTask, completeTask, exportReceipts } from "./receipts.js";
|
|
12
12
|
import { estimateReward } from "./rewards.js";
|
|
13
13
|
import { getAipouStatus } from "./status.js";
|
|
14
|
+
import { getPackageVersion } from "./version.js";
|
|
14
15
|
const bytes32 = z.string().regex(/^0x[a-fA-F0-9]{64}$/);
|
|
15
16
|
const usageCounts = {
|
|
16
17
|
inputTokens: z.number().int().min(0).max(10_000_000),
|
|
17
18
|
outputTokens: z.number().int().min(0).max(10_000_000),
|
|
18
19
|
durationSeconds: z.number().int().min(0).max(86_400)
|
|
19
20
|
};
|
|
20
|
-
const server = new McpServer({ name: "aipou-mcp", version:
|
|
21
|
+
const server = new McpServer({ name: "aipou-mcp", version: await getPackageVersion() }, {
|
|
21
22
|
instructions: "For meaningful AI tasks, call begin_ai_task before work and complete_ai_task after work using hashes, never raw prompts or outputs. " +
|
|
22
23
|
"Use the dedicated farming identity only. Never reveal private keys or local collector state. " +
|
|
23
24
|
"Call settle_all_ai_rewards after a broad user request such as 'claim my AIPOU' or 'settle all pending AIPOU'. " +
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPackageVersion(): Promise<string>;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
const SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
3
|
+
export async function getPackageVersion() {
|
|
4
|
+
const packageUrl = new URL("../package.json", import.meta.url);
|
|
5
|
+
const metadata = JSON.parse(await readFile(packageUrl, "utf8"));
|
|
6
|
+
if (typeof metadata.version !== "string" || !SEMVER.test(metadata.version)) {
|
|
7
|
+
throw new Error("mcp-server/package.json must contain a valid semantic version");
|
|
8
|
+
}
|
|
9
|
+
return metadata.version;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
6
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
7
|
+
import { getPackageVersion } from "./version.js";
|
|
8
|
+
test("MCP handshake version comes from the published package metadata", async () => {
|
|
9
|
+
const metadata = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
|
|
10
|
+
assert.equal(await getPackageVersion(), metadata.version);
|
|
11
|
+
});
|
|
12
|
+
test("MCP initialization advertises the published package version", async () => {
|
|
13
|
+
const transport = new StdioClientTransport({
|
|
14
|
+
command: process.execPath,
|
|
15
|
+
args: [fileURLToPath(new URL("./index.js", import.meta.url))],
|
|
16
|
+
stderr: "pipe"
|
|
17
|
+
});
|
|
18
|
+
const client = new Client({ name: "aipou-version-test", version: "1.0.0" });
|
|
19
|
+
await client.connect(transport);
|
|
20
|
+
try {
|
|
21
|
+
assert.equal(client.getServerVersion()?.version, await getPackageVersion());
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
await transport.close();
|
|
25
|
+
}
|
|
26
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aipou-mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"mcpName": "io.github.0xddneto/ai-proof-of-us",
|
|
5
5
|
"description": "MCP server for private, signed AI task receipts and optional validated AIPOU claims.",
|
|
6
6
|
"author": "0xddneto",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -p tsconfig.json",
|
|
39
|
-
"test": "npm run build && node --test dist/protocol.test.js dist/rewards.test.js dist/canonical.test.js dist/demo.test.js",
|
|
39
|
+
"test": "npm run build && node --test dist/protocol.test.js dist/rewards.test.js dist/canonical.test.js dist/demo.test.js dist/version.test.js",
|
|
40
40
|
"pack:check": "npm test && npm pack --dry-run",
|
|
41
41
|
"demo": "npm run build && node dist/index.js --demo",
|
|
42
42
|
"dev": "tsx src/index.ts",
|
package/server.json
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"source": "github",
|
|
10
10
|
"subfolder": "mcp-server"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.3.
|
|
12
|
+
"version": "0.3.1",
|
|
13
13
|
"packages": [
|
|
14
14
|
{
|
|
15
15
|
"registryType": "npm",
|
|
16
16
|
"identifier": "aipou-mcp-server",
|
|
17
|
-
"version": "0.3.
|
|
17
|
+
"version": "0.3.1",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|