thoughtproof-mcp 0.1.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.
Files changed (3) hide show
  1. package/README.md +56 -0
  2. package/dist/index.js +122 -0
  3. package/package.json +33 -0
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @thoughtproof/mcp-server
2
+
3
+ MCP server that exposes ThoughtProof reasoning verification as a tool for Claude, Cursor, and any MCP-compatible host.
4
+
5
+ ThoughtProof runs adversarial multi-model critique on a claim and returns a verdict (`ALLOW` / `HOLD` / `UNCERTAIN` / `DISSENT`), a confidence score, and up to 3 key objections.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npx @thoughtproof/mcp-server
11
+ ```
12
+
13
+ ## Claude Desktop config
14
+
15
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "thoughtproof": {
21
+ "command": "npx",
22
+ "args": ["-y", "@thoughtproof/mcp-server"]
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ ## Example
29
+
30
+ **User:** Verify this trade: "Buy 50k USDC of ARB/USDC at market, stop-loss at -8%, no hedge."
31
+
32
+ **Claude calls `verify_reasoning`:**
33
+ ```json
34
+ {
35
+ "claim": "Buy 50k USDC of ARB/USDC at market, stop-loss at -8%, no hedge.",
36
+ "stakeLevel": "high",
37
+ "domain": "financial"
38
+ }
39
+ ```
40
+
41
+ **Tool response:**
42
+ ```
43
+ Verdict: HOLD
44
+ Confidence: 41.2%
45
+
46
+ Key objections:
47
+ 1. Market-order entry on low-liquidity pair risks significant slippage on a $50k position.
48
+ 2. -8% stop-loss is within normal daily volatility for ARB; likely to be triggered without a directional move.
49
+ 3. No hedge leaves full downside exposure during high-beta drawdowns.
50
+
51
+ Verified in 18432ms
52
+ ```
53
+
54
+ ## Payment (x402)
55
+
56
+ ThoughtProof charges per verification via the [x402 protocol](https://x402.org) (Base USDC). If payment is not attached the tool returns a clear `paymentRequired` message with wallet and amount details.
package/dist/index.js ADDED
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
+ import {
7
+ CallToolRequestSchema,
8
+ ListToolsRequestSchema
9
+ } from "@modelcontextprotocol/sdk/types.js";
10
+ var API_URL = "https://api.thoughtproof.ai/v1/check";
11
+ var server = new Server(
12
+ { name: "thoughtproof-mcp", version: "0.1.0" },
13
+ { capabilities: { tools: {} } }
14
+ );
15
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
16
+ tools: [
17
+ {
18
+ name: "verify_reasoning",
19
+ description: "Verify a decision or reasoning claim using ThoughtProof adversarial multi-model critique. Returns a verdict (ALLOW/HOLD/UNCERTAIN/DISSENT), confidence score, and up to 3 key objections.",
20
+ inputSchema: {
21
+ type: "object",
22
+ properties: {
23
+ claim: {
24
+ type: "string",
25
+ description: "The decision or reasoning to verify"
26
+ },
27
+ stakeLevel: {
28
+ type: "string",
29
+ enum: ["low", "medium", "high", "critical"],
30
+ default: "medium",
31
+ description: "Stakes of the decision \u2014 affects confidence threshold"
32
+ },
33
+ domain: {
34
+ type: "string",
35
+ enum: ["financial", "medical", "legal", "code", "general"],
36
+ default: "general",
37
+ description: "Domain context for the verification"
38
+ }
39
+ },
40
+ required: ["claim"]
41
+ }
42
+ }
43
+ ]
44
+ }));
45
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
46
+ if (request.params.name !== "verify_reasoning") {
47
+ throw new Error(`Unknown tool: ${request.params.name}`);
48
+ }
49
+ const { claim, stakeLevel = "medium", domain = "general" } = request.params.arguments;
50
+ let response;
51
+ try {
52
+ response = await fetch(API_URL, {
53
+ method: "POST",
54
+ headers: { "Content-Type": "application/json" },
55
+ body: JSON.stringify({ claim, stakeLevel, domain })
56
+ });
57
+ } catch (err) {
58
+ return {
59
+ content: [
60
+ {
61
+ type: "text",
62
+ text: `Network error reaching ThoughtProof API: ${err.message}`
63
+ }
64
+ ],
65
+ isError: true
66
+ };
67
+ }
68
+ if (response.status === 402) {
69
+ const body = await response.json().catch(() => ({}));
70
+ const accepts = body?.accepts?.[0];
71
+ const amount = accepts?.maxAmountRequired ? `${Number(accepts.maxAmountRequired) / 1e6} USDC` : "a small USDC fee";
72
+ return {
73
+ content: [
74
+ {
75
+ type: "text",
76
+ text: [
77
+ "**Payment required (x402)**",
78
+ "",
79
+ `ThoughtProof requires ${amount} per verification, paid on-chain via the x402 protocol.`,
80
+ "",
81
+ "To use this tool programmatically, attach an `X-PAYMENT` header with a valid Base USDC payment payload.",
82
+ "See https://x402.org for client libraries.",
83
+ "",
84
+ accepts ? `Pay-to wallet: ${accepts.payTo}
85
+ Network: ${accepts.network}
86
+ Asset: ${accepts.asset}` : ""
87
+ ].join("\n").trim()
88
+ }
89
+ ],
90
+ isError: false
91
+ };
92
+ }
93
+ if (!response.ok) {
94
+ const text = await response.text().catch(() => `HTTP ${response.status}`);
95
+ return {
96
+ content: [{ type: "text", text: `ThoughtProof API error (${response.status}): ${text}` }],
97
+ isError: true
98
+ };
99
+ }
100
+ const result = await response.json();
101
+ const lines = [
102
+ `**Verdict:** ${result.verdict}`,
103
+ `**Confidence:** ${(result.confidence * 100).toFixed(1)}%`
104
+ ];
105
+ if (result.objections?.length) {
106
+ lines.push("", "**Key objections:**");
107
+ result.objections.forEach((o, i) => lines.push(`${i + 1}. ${o}`));
108
+ }
109
+ lines.push("", `*Verified in ${result.durationMs}ms*`);
110
+ return {
111
+ content: [{ type: "text", text: lines.join("\n") }],
112
+ isError: false
113
+ };
114
+ });
115
+ async function main() {
116
+ const transport = new StdioServerTransport();
117
+ await server.connect(transport);
118
+ }
119
+ main().catch((err) => {
120
+ console.error(err);
121
+ process.exit(1);
122
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "thoughtproof-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for ThoughtProof reasoning verification",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "thoughtproof-mcp": "dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsup",
12
+ "dev": "tsx src/index.ts"
13
+ },
14
+ "dependencies": {
15
+ "@modelcontextprotocol/sdk": "^1.0.0"
16
+ },
17
+ "devDependencies": {
18
+ "tsup": "^8.0.0",
19
+ "typescript": "^5.0.0",
20
+ "@types/node": "^20.0.0",
21
+ "tsx": "^4.0.0"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "engines": {
27
+ "node": ">=18"
28
+ },
29
+ "license": "MIT",
30
+ "publishConfig": {
31
+ "access": "public"
32
+ }
33
+ }