tru-mcp 0.3.1 → 0.5.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/dist/api-client.d.ts +25 -3
- package/dist/api-client.js +49 -2
- package/dist/api-client.js.map +1 -1
- package/dist/config.d.ts +18 -0
- package/dist/config.js +76 -0
- package/dist/config.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +164 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/authenticate.d.ts +18 -0
- package/dist/tools/authenticate.js +92 -0
- package/dist/tools/authenticate.js.map +1 -0
- package/dist/tools/connect_stripe.d.ts +4 -4
- package/dist/tools/connect_stripe.js +56 -30
- package/dist/tools/connect_stripe.js.map +1 -1
- package/dist/tools/create_charge.d.ts +4 -0
- package/dist/tools/create_charge.js +47 -1
- package/dist/tools/create_charge.js.map +1 -1
- package/dist/tools/discover_api.d.ts +6 -4
- package/dist/tools/discover_api.js +42 -13
- package/dist/tools/discover_api.js.map +1 -1
- package/dist/tools/get_started.js +91 -176
- package/dist/tools/get_started.js.map +1 -1
- package/dist/tools/initiate_oauth.js +1 -4
- package/dist/tools/initiate_oauth.js.map +1 -1
- package/dist/tools/register_app.d.ts +2 -4
- package/dist/tools/register_app.js +41 -8
- package/dist/tools/register_app.js.map +1 -1
- package/dist/tools/request_virtual_card.d.ts +4 -0
- package/dist/tools/request_virtual_card.js +47 -1
- package/dist/tools/request_virtual_card.js.map +1 -1
- package/package.json +1 -1
package/dist/api-client.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface ChargeResponse {
|
|
|
41
41
|
};
|
|
42
42
|
[key: string]: unknown;
|
|
43
43
|
}
|
|
44
|
-
export declare function createCharge(email: string, amountCents: number, description?: string, type?: string, interval?: string, currency?: string, paymentMode?: string, action?: string): Promise<ChargeResponse>;
|
|
44
|
+
export declare function createCharge(email: string, amountCents: number, description?: string, type?: string, interval?: string, currency?: string, paymentMode?: string, action?: string, appId?: string, sourceLabel?: string): Promise<ChargeResponse>;
|
|
45
45
|
export interface AgentCardResponse {
|
|
46
46
|
status: "issued" | "escalated";
|
|
47
47
|
charge_request_id: string;
|
|
@@ -74,7 +74,7 @@ export declare function lookupAppByServiceName(serviceName: string): Promise<App
|
|
|
74
74
|
export interface RegisterAppParams {
|
|
75
75
|
service_name: string;
|
|
76
76
|
display_name: string;
|
|
77
|
-
owner_email
|
|
77
|
+
owner_email?: string;
|
|
78
78
|
description?: string;
|
|
79
79
|
website?: string;
|
|
80
80
|
allowed_fields?: string[];
|
|
@@ -114,6 +114,7 @@ export interface ConnectOAuthResponse {
|
|
|
114
114
|
payouts_enabled?: boolean;
|
|
115
115
|
}
|
|
116
116
|
export declare function getConnectOAuthUrl(serviceName: string): Promise<ConnectOAuthResponse>;
|
|
117
|
+
export declare function updateAppWebsite(appId: string, website: string): Promise<void>;
|
|
117
118
|
export interface DiscoverApiResponse {
|
|
118
119
|
endpoints_found: number;
|
|
119
120
|
pages_crawled: number;
|
|
@@ -131,5 +132,26 @@ export interface AppCredentialsResponse {
|
|
|
131
132
|
}
|
|
132
133
|
export declare function provisionUser(email: string, serviceName: string): Promise<ProvisionResponse>;
|
|
133
134
|
export declare function getAppCredentials(email: string, serviceName: string): Promise<AppCredentialsResponse>;
|
|
134
|
-
export declare function requestAgentCard(email: string, amountCents: number, description?: string, targetService?: string, currency?: string, action?: string): Promise<AgentCardResponse>;
|
|
135
|
+
export declare function requestAgentCard(email: string, amountCents: number, description?: string, targetService?: string, currency?: string, action?: string, appId?: string, sourceLabel?: string): Promise<AgentCardResponse>;
|
|
136
|
+
export interface McpSessionResponse {
|
|
137
|
+
code: string;
|
|
138
|
+
login_url: string;
|
|
139
|
+
}
|
|
140
|
+
export interface McpSessionStatus {
|
|
141
|
+
status: "pending" | "complete";
|
|
142
|
+
token?: string;
|
|
143
|
+
user?: {
|
|
144
|
+
id: string;
|
|
145
|
+
email: string;
|
|
146
|
+
name: string;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare function createMcpSession(): Promise<McpSessionResponse>;
|
|
150
|
+
export declare function pollMcpSession(code: string): Promise<McpSessionStatus>;
|
|
151
|
+
export declare function verifyAuth(token: string): Promise<{
|
|
152
|
+
id: string;
|
|
153
|
+
email: string;
|
|
154
|
+
name: string;
|
|
155
|
+
}>;
|
|
156
|
+
export declare function registerAppAuthenticated(params: Omit<RegisterAppParams, "owner_email">, token: string): Promise<RegisterAppResponse>;
|
|
135
157
|
export {};
|
package/dist/api-client.js
CHANGED
|
@@ -35,7 +35,7 @@ export async function requestCredentials(email, service, fields) {
|
|
|
35
35
|
export async function getRequestStatus(id) {
|
|
36
36
|
return (await request(`/api/credentials/${encodeURIComponent(id)}`));
|
|
37
37
|
}
|
|
38
|
-
export async function createCharge(email, amountCents, description, type, interval, currency, paymentMode, action) {
|
|
38
|
+
export async function createCharge(email, amountCents, description, type, interval, currency, paymentMode, action, appId, sourceLabel) {
|
|
39
39
|
return (await request("/api/billing/charges", {
|
|
40
40
|
method: "POST",
|
|
41
41
|
body: JSON.stringify({
|
|
@@ -47,6 +47,8 @@ export async function createCharge(email, amountCents, description, type, interv
|
|
|
47
47
|
interval,
|
|
48
48
|
payment_mode: paymentMode || "direct",
|
|
49
49
|
action,
|
|
50
|
+
app_id: appId,
|
|
51
|
+
source_label: sourceLabel,
|
|
50
52
|
}),
|
|
51
53
|
}));
|
|
52
54
|
}
|
|
@@ -65,6 +67,13 @@ export async function getChargeStatus(id) {
|
|
|
65
67
|
export async function getConnectOAuthUrl(serviceName) {
|
|
66
68
|
return (await request(`/api/connect/by-service/${encodeURIComponent(serviceName)}/oauth-url`));
|
|
67
69
|
}
|
|
70
|
+
// ─── App Update ─────────────────────────────────────────────────
|
|
71
|
+
export async function updateAppWebsite(appId, website) {
|
|
72
|
+
await request(`/api/apps/${encodeURIComponent(appId)}`, {
|
|
73
|
+
method: "PUT",
|
|
74
|
+
body: JSON.stringify({ website }),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
68
77
|
export async function discoverApi(serviceName) {
|
|
69
78
|
const url = `${BASE_URL}/apps/${encodeURIComponent(serviceName)}/discover`;
|
|
70
79
|
const res = await fetch(url, {
|
|
@@ -112,7 +121,7 @@ export async function provisionUser(email, serviceName) {
|
|
|
112
121
|
export async function getAppCredentials(email, serviceName) {
|
|
113
122
|
return (await request(`/api/apps/by-service/${encodeURIComponent(serviceName)}/credentials/${encodeURIComponent(email)}`));
|
|
114
123
|
}
|
|
115
|
-
export async function requestAgentCard(email, amountCents, description, targetService, currency, action) {
|
|
124
|
+
export async function requestAgentCard(email, amountCents, description, targetService, currency, action, appId, sourceLabel) {
|
|
116
125
|
return (await request("/api/billing/agent-card", {
|
|
117
126
|
method: "POST",
|
|
118
127
|
body: JSON.stringify({
|
|
@@ -122,7 +131,45 @@ export async function requestAgentCard(email, amountCents, description, targetSe
|
|
|
122
131
|
description,
|
|
123
132
|
target_service: targetService,
|
|
124
133
|
action,
|
|
134
|
+
app_id: appId,
|
|
135
|
+
source_label: sourceLabel,
|
|
125
136
|
}),
|
|
126
137
|
}));
|
|
127
138
|
}
|
|
139
|
+
export async function createMcpSession() {
|
|
140
|
+
return (await request("/api/auth/mcp-session", {
|
|
141
|
+
method: "POST",
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
export async function pollMcpSession(code) {
|
|
145
|
+
return (await request(`/api/auth/mcp-session/${encodeURIComponent(code)}`));
|
|
146
|
+
}
|
|
147
|
+
export async function verifyAuth(token) {
|
|
148
|
+
const url = `${BASE_URL}/api/auth/me`;
|
|
149
|
+
const res = await fetch(url, {
|
|
150
|
+
headers: {
|
|
151
|
+
"Authorization": `Bearer ${token}`,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
if (!res.ok) {
|
|
155
|
+
throw new Error(`Auth verification failed: ${res.status}`);
|
|
156
|
+
}
|
|
157
|
+
return res.json();
|
|
158
|
+
}
|
|
159
|
+
export async function registerAppAuthenticated(params, token) {
|
|
160
|
+
const url = `${BASE_URL}/api/apps`;
|
|
161
|
+
const res = await fetch(url, {
|
|
162
|
+
method: "POST",
|
|
163
|
+
headers: {
|
|
164
|
+
"Content-Type": "application/json",
|
|
165
|
+
"Authorization": `Bearer ${token}`,
|
|
166
|
+
},
|
|
167
|
+
body: JSON.stringify(params),
|
|
168
|
+
});
|
|
169
|
+
if (!res.ok) {
|
|
170
|
+
const body = await res.text();
|
|
171
|
+
throw new Error(`API error ${res.status}: ${body}`);
|
|
172
|
+
}
|
|
173
|
+
return res.json();
|
|
174
|
+
}
|
|
128
175
|
//# sourceMappingURL=api-client.js.map
|
package/dist/api-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,uBAAuB,CAAC;AAEpE,oEAAoE;AACpE,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;AACvC,CAAC;AA8BD,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,UAAuB,EAAE;IAC5D,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAC;IACjC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,GAAG,OAAO;QACV,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,WAAW,EAAE,SAAS,EAAE;YACxB,GAAG,OAAO,CAAC,OAAO;SACnB;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CA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E,CAAC;AACpB,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function readConfig(): Record<string, unknown>;
|
|
2
|
+
export declare function writeConfig(config: Record<string, unknown>): void;
|
|
3
|
+
export declare function getStoredAuth(): {
|
|
4
|
+
token: string;
|
|
5
|
+
email: string;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare function saveAuth(token: string, email: string): void;
|
|
8
|
+
export interface StoredApp {
|
|
9
|
+
id: string;
|
|
10
|
+
service_name: string;
|
|
11
|
+
display_name: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function getStoredApp(): StoredApp | null;
|
|
14
|
+
export declare function saveApp(app: StoredApp): void;
|
|
15
|
+
export declare function setClientName(name: string): void;
|
|
16
|
+
export declare function getSourceLabel(): string | null;
|
|
17
|
+
export declare function saveSourceLabel(label: string): void;
|
|
18
|
+
export declare function getSuggestedLabel(): string;
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import path from "path";
|
|
5
|
+
const CONFIG_PATH = path.join(os.homedir(), ".tru", "config.json");
|
|
6
|
+
export function readConfig() {
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(fs.readFileSync(CONFIG_PATH, "utf-8"));
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function writeConfig(config) {
|
|
15
|
+
const dir = path.dirname(CONFIG_PATH);
|
|
16
|
+
if (!fs.existsSync(dir))
|
|
17
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
18
|
+
fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));
|
|
19
|
+
}
|
|
20
|
+
// ─── Auth helpers ────────────────────────────────────────────────
|
|
21
|
+
export function getStoredAuth() {
|
|
22
|
+
const config = readConfig();
|
|
23
|
+
const auth = config.auth;
|
|
24
|
+
if (auth?.token && auth?.email) {
|
|
25
|
+
return { token: auth.token, email: auth.email };
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
export function saveAuth(token, email) {
|
|
30
|
+
const config = readConfig();
|
|
31
|
+
config.auth = { token, email };
|
|
32
|
+
writeConfig(config);
|
|
33
|
+
}
|
|
34
|
+
export function getStoredApp() {
|
|
35
|
+
const config = readConfig();
|
|
36
|
+
const app = config.app;
|
|
37
|
+
if (app?.id && app?.service_name) {
|
|
38
|
+
return app;
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
export function saveApp(app) {
|
|
43
|
+
const config = readConfig();
|
|
44
|
+
config.app = app;
|
|
45
|
+
writeConfig(config);
|
|
46
|
+
}
|
|
47
|
+
// ─── Source label helpers ────────────────────────────────────────
|
|
48
|
+
function getComputerName() {
|
|
49
|
+
try {
|
|
50
|
+
return execSync("scutil --get ComputerName", { encoding: "utf-8" }).trim();
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return os.hostname();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let clientName = "Unknown Client";
|
|
57
|
+
export function setClientName(name) {
|
|
58
|
+
clientName = name;
|
|
59
|
+
}
|
|
60
|
+
export function getSourceLabel() {
|
|
61
|
+
const config = readConfig();
|
|
62
|
+
const labels = (config.source_labels || {});
|
|
63
|
+
return labels[clientName] || null;
|
|
64
|
+
}
|
|
65
|
+
export function saveSourceLabel(label) {
|
|
66
|
+
const config = readConfig();
|
|
67
|
+
const labels = (config.source_labels || {});
|
|
68
|
+
labels[clientName] = label;
|
|
69
|
+
config.source_labels = labels;
|
|
70
|
+
writeConfig(config);
|
|
71
|
+
}
|
|
72
|
+
export function getSuggestedLabel() {
|
|
73
|
+
const computerName = getComputerName();
|
|
74
|
+
return `${clientName} \u2014 ${computerName}`;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=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IAAI,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,CAA2B,CAAC;IACtE,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;IAC3B,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC;IAC9B,WAAW,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,GAAG,UAAU,WAAW,YAAY,EAAE,CAAC;AAChD,CAAC"}
|
package/dist/server.d.ts
CHANGED
package/dist/server.js
CHANGED
|
@@ -14,11 +14,16 @@ import { connectStripeTool } from "./tools/connect_stripe.js";
|
|
|
14
14
|
import { getStartedTool } from "./tools/get_started.js";
|
|
15
15
|
import { discoverApiTool } from "./tools/discover_api.js";
|
|
16
16
|
import { provisionUserTool } from "./tools/provision_user.js";
|
|
17
|
+
import { authenticateTool } from "./tools/authenticate.js";
|
|
18
|
+
import { setClientName, getSourceLabel, saveSourceLabel, getSuggestedLabel, } from "./config.js";
|
|
19
|
+
// Re-export source label functions so existing tool imports work
|
|
20
|
+
export { getSourceLabel, saveSourceLabel, getSuggestedLabel };
|
|
17
21
|
const server = new McpServer({
|
|
18
22
|
name: "tru-identity",
|
|
19
23
|
version: "0.1.0",
|
|
20
24
|
});
|
|
21
25
|
// Register tools
|
|
26
|
+
server.tool(authenticateTool.name, authenticateTool.description, authenticateTool.inputSchema, authenticateTool.handler);
|
|
22
27
|
server.tool(checkIdentityTool.name, checkIdentityTool.description, checkIdentityTool.inputSchema, checkIdentityTool.handler);
|
|
23
28
|
server.tool(requestUserDataTool.name, requestUserDataTool.description, requestUserDataTool.inputSchema, requestUserDataTool.handler);
|
|
24
29
|
server.tool(checkRequestStatusTool.name, checkRequestStatusTool.description, checkRequestStatusTool.inputSchema, checkRequestStatusTool.handler);
|
|
@@ -33,9 +38,168 @@ server.tool(connectStripeTool.name, connectStripeTool.description, connectStripe
|
|
|
33
38
|
server.tool(getStartedTool.name, getStartedTool.description, getStartedTool.inputSchema, getStartedTool.handler);
|
|
34
39
|
server.tool(discoverApiTool.name, discoverApiTool.description, discoverApiTool.inputSchema, discoverApiTool.handler);
|
|
35
40
|
server.tool(provisionUserTool.name, provisionUserTool.description, provisionUserTool.inputSchema, provisionUserTool.handler);
|
|
41
|
+
// ─── Prompts (show up as /tru:prompt-name in Claude Code) ──────
|
|
42
|
+
const BASE_URL = process.env.TRU_API_URL || "http://localhost:3000";
|
|
43
|
+
server.prompt("get-started", "Full walkthrough for integrating tru into your app — auth, billing, identity verification, and agent discoverability", async () => {
|
|
44
|
+
let guide;
|
|
45
|
+
try {
|
|
46
|
+
const res = await fetch(`${BASE_URL}/agent.md`);
|
|
47
|
+
guide = await res.text();
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
guide =
|
|
51
|
+
"Could not fetch agent guide. Visit the tru dashboard for documentation.";
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
messages: [
|
|
55
|
+
{
|
|
56
|
+
role: "user",
|
|
57
|
+
content: {
|
|
58
|
+
type: "text",
|
|
59
|
+
text: `Follow this guide to integrate tru into the current project. Explore the codebase first to understand the stack, then apply each step.\n\n${guide}`,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
server.prompt("add-login", "Add 'Login with tru' OAuth to your app — redirect-based auth with popup flow", async () => ({
|
|
66
|
+
messages: [
|
|
67
|
+
{
|
|
68
|
+
role: "user",
|
|
69
|
+
content: {
|
|
70
|
+
type: "text",
|
|
71
|
+
text: `You are adding "Login with tru" to this project. tru uses OAuth 2.0 with a simplified flow — redirect_uri is configured server-side, never passed in URLs.
|
|
72
|
+
|
|
73
|
+
## Steps
|
|
74
|
+
|
|
75
|
+
1. **Register the app on tru** (if not already done)
|
|
76
|
+
- Use the register_app tool or visit the tru dashboard
|
|
77
|
+
- Set redirect_uris to your OAuth callback URL (e.g. /api/auth/callback/tru)
|
|
78
|
+
|
|
79
|
+
2. **Add environment variables**
|
|
80
|
+
- TRU_API_URL — the tru instance URL
|
|
81
|
+
- TRU_CLIENT_ID — your app's ID from tru
|
|
82
|
+
- TRU_CLIENT_SECRET — your API key (same as TRU_API_KEY)
|
|
83
|
+
|
|
84
|
+
3. **Add a login button** that opens tru's authorize endpoint:
|
|
85
|
+
\`\`\`javascript
|
|
86
|
+
const url = new URL(\`\${TRU_URL}/api/oauth/authorize\`);
|
|
87
|
+
url.searchParams.set('client_id', TRU_CLIENT_ID);
|
|
88
|
+
url.searchParams.set('state', crypto.randomUUID());
|
|
89
|
+
window.open(url, 'tru-login', 'width=480,height=640');
|
|
90
|
+
\`\`\`
|
|
91
|
+
Note: redirect_uri is NOT passed in the URL — it's configured in your app settings on tru.
|
|
92
|
+
|
|
93
|
+
4. **Add a callback route** (e.g. /api/auth/callback/tru):
|
|
94
|
+
- Receives ?code=AUTH_CODE&state=STATE
|
|
95
|
+
- Exchanges code for user info:
|
|
96
|
+
POST {TRU_URL}/api/oauth/token
|
|
97
|
+
Body: { "code": "...", "client_id": "...", "client_secret": "..." }
|
|
98
|
+
Response: { "user": { "id": "...", "email": "...", "name": "..." } }
|
|
99
|
+
- Creates/finds local user, sets session, closes popup
|
|
100
|
+
|
|
101
|
+
5. **Add agent auth (403 response)** for bot detection:
|
|
102
|
+
Return a 403 with signup_url pointing to tru's authorize endpoint
|
|
103
|
+
|
|
104
|
+
Explore the codebase to understand the existing auth setup, then implement these steps.`,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
}));
|
|
109
|
+
server.prompt("add-billing", "Add tru billing to your app — one-time charges and subscriptions via Stripe Connect", async () => ({
|
|
110
|
+
messages: [
|
|
111
|
+
{
|
|
112
|
+
role: "user",
|
|
113
|
+
content: {
|
|
114
|
+
type: "text",
|
|
115
|
+
text: `You are adding tru billing to this project. tru handles payments via Stripe Connect — money goes to the developer's Stripe account.
|
|
116
|
+
|
|
117
|
+
## Prerequisites
|
|
118
|
+
- App must be registered on tru (use register_app tool)
|
|
119
|
+
- Stripe must be connected (use connect_stripe tool)
|
|
120
|
+
|
|
121
|
+
## Creating charges
|
|
122
|
+
|
|
123
|
+
POST {TRU_URL}/api/billing/charges
|
|
124
|
+
Headers: X-API-Key: {api_key}, Content-Type: application/json
|
|
125
|
+
Body: {
|
|
126
|
+
"email": "user@example.com",
|
|
127
|
+
"amount_cents": 2999,
|
|
128
|
+
"description": "Pro Plan",
|
|
129
|
+
"type": "one_time"
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
For subscriptions: "type": "recurring", "interval": "month"
|
|
133
|
+
|
|
134
|
+
## Checking charge status
|
|
135
|
+
|
|
136
|
+
GET {TRU_URL}/api/billing/charges/{id}
|
|
137
|
+
Headers: X-API-Key: {api_key}
|
|
138
|
+
|
|
139
|
+
Returns: pending → approved → completed (or rejected/cancelled)
|
|
140
|
+
|
|
141
|
+
## User experience
|
|
142
|
+
Users approve charges on their tru wallet dashboard. They can set auto-approve rules (e.g. "auto-approve charges under $10 from this app").
|
|
143
|
+
|
|
144
|
+
Explore the codebase to find where billing should be integrated, then implement.`,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
}));
|
|
149
|
+
server.prompt("check-user", "Add tru identity verification — check if a user is verified and access risk signals", async () => ({
|
|
150
|
+
messages: [
|
|
151
|
+
{
|
|
152
|
+
role: "user",
|
|
153
|
+
content: {
|
|
154
|
+
type: "text",
|
|
155
|
+
text: `You are adding tru identity verification to this project. tru lets you check if a user is verified and access their risk signals — no user action needed.
|
|
156
|
+
|
|
157
|
+
## Check identity (free, instant)
|
|
158
|
+
|
|
159
|
+
GET {TRU_URL}/api/credentials/check/{email}
|
|
160
|
+
Headers: X-API-Key: {api_key}
|
|
161
|
+
|
|
162
|
+
Response: {
|
|
163
|
+
"verified": true,
|
|
164
|
+
"name": "Jane Doe",
|
|
165
|
+
"risk": {
|
|
166
|
+
"level": "low",
|
|
167
|
+
"score": 12,
|
|
168
|
+
"card_funding": "debit",
|
|
169
|
+
"card_country": "US",
|
|
170
|
+
"fingerprint_reuse": false
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
## Request credentials (user approval required)
|
|
175
|
+
|
|
176
|
+
POST {TRU_URL}/api/credentials
|
|
177
|
+
Headers: X-API-Key: {api_key}
|
|
178
|
+
Body: { "email": "user@example.com", "fields": ["name", "email", "phone"] }
|
|
179
|
+
|
|
180
|
+
Then poll GET /api/credentials/{id} until status is "approved" or "rejected".
|
|
181
|
+
|
|
182
|
+
## Use cases
|
|
183
|
+
- Gate features by risk level
|
|
184
|
+
- Set trial length based on risk score
|
|
185
|
+
- Block duplicate signups via fingerprint_reuse
|
|
186
|
+
- Verify identity before high-value actions
|
|
187
|
+
|
|
188
|
+
Explore the codebase to find where identity checks should be added, then implement.`,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
}));
|
|
36
193
|
export async function run() {
|
|
37
194
|
const transport = new StdioServerTransport();
|
|
38
195
|
await server.connect(transport);
|
|
196
|
+
// Capture client info (e.g. "Claude Code", "Cursor") for source label
|
|
197
|
+
try {
|
|
198
|
+
const info = server.server?.getClientVersion?.();
|
|
199
|
+
if (info?.name)
|
|
200
|
+
setClientName(info.name);
|
|
201
|
+
}
|
|
202
|
+
catch { }
|
|
39
203
|
console.error("tru-identity MCP server running on stdio");
|
|
40
204
|
}
|
|
41
205
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;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AE,MAAe;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFA6BiE;aACxE;SACF;KACF;CACF,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,CACX,YAAY,EACZ,qFAAqF,EACrF,KAAK,IAAI,EAAE,CAAC,CAAC;IACX,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,MAAe;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oFAiCoE;aAC3E;SACF;KACF;CACF,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,GAAG;IACvB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,sEAAsE;IACtE,IAAI,CAAC;QACH,MAAM,IAAI,GAAI,MAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,CAAC;QAC1D,IAAI,IAAI,EAAE,IAAI;YAAE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const authenticateTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {};
|
|
5
|
+
handler: (_args: Record<string, never>) => Promise<{
|
|
6
|
+
content: {
|
|
7
|
+
type: "text";
|
|
8
|
+
text: string;
|
|
9
|
+
}[];
|
|
10
|
+
isError?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
content: {
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
isError: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { exec } from "child_process";
|
|
2
|
+
import { getStoredAuth, saveAuth } from "../config.js";
|
|
3
|
+
import { createMcpSession, pollMcpSession, verifyAuth } from "../api-client.js";
|
|
4
|
+
function sleep(ms) {
|
|
5
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
+
}
|
|
7
|
+
function openBrowser(url) {
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
const cmd = platform === "darwin" ? "open" :
|
|
10
|
+
platform === "win32" ? "start" :
|
|
11
|
+
"xdg-open";
|
|
12
|
+
exec(`${cmd} "${url}"`);
|
|
13
|
+
}
|
|
14
|
+
export const authenticateTool = {
|
|
15
|
+
name: "authenticate",
|
|
16
|
+
description: "Authenticate with tru via the browser. " +
|
|
17
|
+
"Opens a browser window where you verify your identity, then waits until authentication is complete. " +
|
|
18
|
+
"Credentials are stored locally for future sessions.",
|
|
19
|
+
inputSchema: {},
|
|
20
|
+
handler: async (_args) => {
|
|
21
|
+
try {
|
|
22
|
+
// Check if already authenticated
|
|
23
|
+
const stored = getStoredAuth();
|
|
24
|
+
if (stored) {
|
|
25
|
+
try {
|
|
26
|
+
const user = await verifyAuth(stored.token);
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: "text",
|
|
31
|
+
text: `Already authenticated as ${user.email}.`,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Token expired or invalid, continue to re-authenticate
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Create a new MCP session
|
|
41
|
+
const session = await createMcpSession();
|
|
42
|
+
// Auto-open the browser
|
|
43
|
+
openBrowser(session.login_url);
|
|
44
|
+
// Poll for completion (every 2s, up to 5 min)
|
|
45
|
+
const maxAttempts = 150;
|
|
46
|
+
let attempts = 0;
|
|
47
|
+
while (attempts < maxAttempts) {
|
|
48
|
+
await sleep(2000);
|
|
49
|
+
attempts++;
|
|
50
|
+
try {
|
|
51
|
+
const status = await pollMcpSession(session.code);
|
|
52
|
+
if (status.status === "complete" && status.token && status.user) {
|
|
53
|
+
saveAuth(status.token, status.user.email);
|
|
54
|
+
return {
|
|
55
|
+
content: [
|
|
56
|
+
{
|
|
57
|
+
type: "text",
|
|
58
|
+
text: `Authenticated successfully as ${status.user.email}. Credentials saved locally.`,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Session might have expired, keep trying
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
content: [
|
|
70
|
+
{
|
|
71
|
+
type: "text",
|
|
72
|
+
text: `Authentication timed out. If the browser didn't open, go to: ${session.login_url}`,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
isError: true,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: `Error during authentication: ${message}`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
isError: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=authenticate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../src/tools/authenticate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhF,SAAS,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3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
5
|
inputSchema: {
|
|
6
|
-
service_name: z.ZodString
|
|
6
|
+
service_name: z.ZodOptional<z.ZodString>;
|
|
7
7
|
};
|
|
8
8
|
handler: (args: {
|
|
9
|
-
service_name
|
|
9
|
+
service_name?: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
content: {
|
|
12
12
|
type: "text";
|
|
13
13
|
text: string;
|
|
14
14
|
}[];
|
|
15
|
-
isError
|
|
15
|
+
isError: boolean;
|
|
16
16
|
} | {
|
|
17
17
|
content: {
|
|
18
18
|
type: "text";
|
|
19
19
|
text: string;
|
|
20
20
|
}[];
|
|
21
|
-
isError
|
|
21
|
+
isError?: undefined;
|
|
22
22
|
}>;
|
|
23
23
|
};
|