kredit-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.
- package/README.md +27 -0
- package/bin/kredit-mcp +34 -0
- package/dist/api.d.ts +69 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +59 -0
- package/dist/api.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +35 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +186 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# kredit-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for Kredit. Bring agent spend controls to Claude Code and Claude Desktop.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g kredit-mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage with Claude Code
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
claude mcp add kredit -- kredit-mcp serve --api-key=kr_live_...
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Tools
|
|
18
|
+
|
|
19
|
+
- `kredit_check` — risk evaluation before an action
|
|
20
|
+
- `kredit_report` — report outcome after action
|
|
21
|
+
- `kredit_balance` — check agent wallet and score
|
|
22
|
+
- `kredit_agents` — list agents
|
|
23
|
+
|
|
24
|
+
## Environment variables
|
|
25
|
+
|
|
26
|
+
- `KREDIT_API_KEY` — API key for kredit-server
|
|
27
|
+
- `KREDIT_API_URL` — API base URL (default: `https://api.kredit.sh`)
|
package/bin/kredit-mcp
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { resolve, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
// The "serve" subcommand starts the MCP server.
|
|
9
|
+
// All other flags (--api-key, --api-url) are forwarded to the server entry point.
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
|
|
12
|
+
const command = args[0];
|
|
13
|
+
|
|
14
|
+
if (!command || command === "serve") {
|
|
15
|
+
// Import and run the server entry point — it reads config from process.argv
|
|
16
|
+
await import(resolve(__dirname, "../dist/index.js"));
|
|
17
|
+
} else if (command === "--help" || command === "-h") {
|
|
18
|
+
console.log(`kredit-mcp — MCP server for Kredit
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
kredit-mcp serve [options]
|
|
22
|
+
|
|
23
|
+
Options:
|
|
24
|
+
--api-key=KEY Kredit API key (or set KREDIT_API_KEY env)
|
|
25
|
+
--api-url=URL Kredit API URL (or set KREDIT_API_URL env, default: https://api.kredit.sh)
|
|
26
|
+
|
|
27
|
+
Example:
|
|
28
|
+
claude mcp add kredit -- kredit-mcp serve --api-key=kr_live_...
|
|
29
|
+
`);
|
|
30
|
+
} else {
|
|
31
|
+
console.error(`Unknown command: ${command}`);
|
|
32
|
+
console.error("Usage: kredit-mcp serve [--api-key=KEY] [--api-url=URL]");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Config } from "./config.js";
|
|
2
|
+
export interface CheckRequest {
|
|
3
|
+
agent_id: string;
|
|
4
|
+
action: string;
|
|
5
|
+
estimated_cost: number;
|
|
6
|
+
}
|
|
7
|
+
export interface CheckResponse {
|
|
8
|
+
allow: boolean;
|
|
9
|
+
risk_level: "low" | "medium" | "high" | "critical";
|
|
10
|
+
txn_id: string;
|
|
11
|
+
status: "allowed" | "blocked" | "flagged";
|
|
12
|
+
block_reason: string | null;
|
|
13
|
+
agent: {
|
|
14
|
+
status: "active" | "throttled" | "frozen";
|
|
15
|
+
score: number;
|
|
16
|
+
wallet_balance: number;
|
|
17
|
+
wallet_budget: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface ReportRequest {
|
|
21
|
+
agent_id: string;
|
|
22
|
+
txn_id: string;
|
|
23
|
+
outcome: "success" | "failure" | "partial";
|
|
24
|
+
actual_cost: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ReportResponse {
|
|
27
|
+
txn_id: string;
|
|
28
|
+
score_before: number;
|
|
29
|
+
score_after: number;
|
|
30
|
+
status: "active" | "throttled" | "frozen";
|
|
31
|
+
}
|
|
32
|
+
export interface AgentInfo {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
org_id: string;
|
|
36
|
+
status: "active" | "throttled" | "frozen";
|
|
37
|
+
wallet: {
|
|
38
|
+
balance: number;
|
|
39
|
+
budget: number;
|
|
40
|
+
rate_limit: number;
|
|
41
|
+
rate_used: number;
|
|
42
|
+
};
|
|
43
|
+
credit: {
|
|
44
|
+
score: number;
|
|
45
|
+
task_success_rate: number;
|
|
46
|
+
cost_efficiency: number;
|
|
47
|
+
violation_count: number;
|
|
48
|
+
total_tasks: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface AgentListItem {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
org_id: string;
|
|
55
|
+
status: "active" | "throttled" | "frozen";
|
|
56
|
+
score: number;
|
|
57
|
+
wallet_balance: number;
|
|
58
|
+
}
|
|
59
|
+
export declare class KreditAPI {
|
|
60
|
+
private baseUrl;
|
|
61
|
+
private apiKey;
|
|
62
|
+
constructor(config: Config);
|
|
63
|
+
private request;
|
|
64
|
+
check(req: CheckRequest): Promise<CheckResponse>;
|
|
65
|
+
report(req: ReportRequest): Promise<ReportResponse>;
|
|
66
|
+
getAgent(agentId: string): Promise<AgentInfo>;
|
|
67
|
+
listAgents(orgId?: string): Promise<AgentListItem[]>;
|
|
68
|
+
}
|
|
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GAAG,QAAQ,CAAC;IAC1C,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CACxB;AAID,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;YAMZ,OAAO;IA+Cf,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAIhD,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAInD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI7C,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAI3D"}
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const TIMEOUT_MS = 5_000;
|
|
2
|
+
// ---- API client ----
|
|
3
|
+
export class KreditAPI {
|
|
4
|
+
baseUrl;
|
|
5
|
+
apiKey;
|
|
6
|
+
constructor(config) {
|
|
7
|
+
// Strip trailing slash
|
|
8
|
+
this.baseUrl = config.apiUrl.replace(/\/+$/, "");
|
|
9
|
+
this.apiKey = config.apiKey;
|
|
10
|
+
}
|
|
11
|
+
async request(method, path, body) {
|
|
12
|
+
const url = `${this.baseUrl}${path}`;
|
|
13
|
+
const headers = {
|
|
14
|
+
"Content-Type": "application/json",
|
|
15
|
+
};
|
|
16
|
+
if (this.apiKey) {
|
|
17
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
18
|
+
}
|
|
19
|
+
const controller = new AbortController();
|
|
20
|
+
const timeout = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
21
|
+
try {
|
|
22
|
+
const response = await fetch(url, {
|
|
23
|
+
method,
|
|
24
|
+
headers,
|
|
25
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
26
|
+
signal: controller.signal,
|
|
27
|
+
});
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
const text = await response.text().catch(() => "");
|
|
30
|
+
throw new Error(`Kredit API error: ${response.status} ${response.statusText}${text ? ` — ${text}` : ""}`);
|
|
31
|
+
}
|
|
32
|
+
return (await response.json());
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
if (err instanceof Error &&
|
|
36
|
+
(err.name === "AbortError" || err.name === "TimeoutError")) {
|
|
37
|
+
throw new Error(`Kredit API timeout: ${method} ${path} exceeded ${TIMEOUT_MS}ms`);
|
|
38
|
+
}
|
|
39
|
+
throw err;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
clearTimeout(timeout);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async check(req) {
|
|
46
|
+
return this.request("POST", "/check", req);
|
|
47
|
+
}
|
|
48
|
+
async report(req) {
|
|
49
|
+
return this.request("POST", "/report", req);
|
|
50
|
+
}
|
|
51
|
+
async getAgent(agentId) {
|
|
52
|
+
return this.request("GET", `/agents/${encodeURIComponent(agentId)}`);
|
|
53
|
+
}
|
|
54
|
+
async listAgents(orgId) {
|
|
55
|
+
const query = orgId ? `?org_id=${encodeURIComponent(orgId)}` : "";
|
|
56
|
+
return this.request("GET", `/agents${query}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,KAAK,CAAC;AAmEzB,uBAAuB;AAEvB,MAAM,OAAO,SAAS;IACZ,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,MAAc;QACxB,uBAAuB;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,MAAsB,EACtB,IAAY,EACZ,IAAc;QAEd,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;QAErC,MAAM,OAAO,GAA2B;YACtC,cAAc,EAAE,kBAAkB;SACnC,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC;QACrD,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,UAAU,CAAC,CAAC;QAEjE,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;gBAChC,MAAM;gBACN,OAAO;gBACP,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC7C,MAAM,EAAE,UA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K,CAAC,UAAU,CAAC,KAAc;QAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAkB,KAAK,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACF"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
apiUrl: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Resolve configuration from env + CLI flags.
|
|
7
|
+
* CLI flags take precedence over env vars.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveConfig(argv?: string[]): Config;
|
|
10
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AA4BD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,MAAM,CAOnE"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const DEFAULT_API_URL = "https://api.kredit.sh";
|
|
2
|
+
/**
|
|
3
|
+
* Parse --api-key=VALUE and --api-url=VALUE from argv.
|
|
4
|
+
*/
|
|
5
|
+
function parseCLIFlags(argv) {
|
|
6
|
+
let apiKey;
|
|
7
|
+
let apiUrl;
|
|
8
|
+
for (let i = 0; i < argv.length; i++) {
|
|
9
|
+
const arg = argv[i];
|
|
10
|
+
if (arg.startsWith("--api-key=")) {
|
|
11
|
+
apiKey = arg.slice("--api-key=".length);
|
|
12
|
+
}
|
|
13
|
+
else if (arg === "--api-key" && i + 1 < argv.length) {
|
|
14
|
+
apiKey = argv[++i];
|
|
15
|
+
}
|
|
16
|
+
if (arg.startsWith("--api-url=")) {
|
|
17
|
+
apiUrl = arg.slice("--api-url=".length);
|
|
18
|
+
}
|
|
19
|
+
else if (arg === "--api-url" && i + 1 < argv.length) {
|
|
20
|
+
apiUrl = argv[++i];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { apiKey, apiUrl };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolve configuration from env + CLI flags.
|
|
27
|
+
* CLI flags take precedence over env vars.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveConfig(argv = process.argv) {
|
|
30
|
+
const flags = parseCLIFlags(argv);
|
|
31
|
+
const apiKey = flags.apiKey || process.env.KREDIT_API_KEY || "";
|
|
32
|
+
const apiUrl = flags.apiUrl || process.env.KREDIT_API_URL || DEFAULT_API_URL;
|
|
33
|
+
return { apiKey, apiUrl };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAOhD;;GAEG;AACH,SAAS,aAAa,CAAC,IAAc;IACnC,IAAI,MAA0B,CAAC;IAC/B,IAAI,MAA0B,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;aAAM,IAAI,GAAG,KAAK,WAAW,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,C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usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { KreditAPI } from "./api.js";
|
|
6
|
+
import { resolveConfig } from "./config.js";
|
|
7
|
+
function createServer(api) {
|
|
8
|
+
const server = new McpServer({
|
|
9
|
+
name: "kredit",
|
|
10
|
+
version: "0.1.0",
|
|
11
|
+
});
|
|
12
|
+
// ---- kredit_check ----
|
|
13
|
+
server.tool("kredit_check", "Risk evaluation before an action. Call this to check if an agent is allowed to perform a costly action. Returns allow/deny, risk level, and agent status.", {
|
|
14
|
+
agent_id: z.string().describe("The agent ID to check"),
|
|
15
|
+
action: z.string().describe("The action to evaluate (e.g. 'openai.chat', 'aws.ec2.run')"),
|
|
16
|
+
estimated_cost: z.number().int().min(0).describe("Estimated cost in cents"),
|
|
17
|
+
}, async ({ agent_id, action, estimated_cost }) => {
|
|
18
|
+
try {
|
|
19
|
+
const result = await api.check({ agent_id, action, estimated_cost });
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: JSON.stringify({
|
|
25
|
+
allow: result.allow,
|
|
26
|
+
risk_level: result.risk_level,
|
|
27
|
+
txn_id: result.txn_id,
|
|
28
|
+
status: result.status,
|
|
29
|
+
block_reason: result.block_reason,
|
|
30
|
+
agent_status: result.agent.status,
|
|
31
|
+
agent_score: result.agent.score,
|
|
32
|
+
wallet_balance_cents: result.agent.wallet_balance,
|
|
33
|
+
wallet_budget_cents: result.agent.wallet_budget,
|
|
34
|
+
}, null, 2),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
isError: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
// ---- kredit_report ----
|
|
52
|
+
server.tool("kredit_report", "Report outcome after an action completes. Call this after a costly action to report success/failure and actual cost. Updates the agent's credit score.", {
|
|
53
|
+
agent_id: z.string().describe("The agent ID"),
|
|
54
|
+
txn_id: z.string().describe("Transaction ID from the kredit_check response"),
|
|
55
|
+
outcome: z
|
|
56
|
+
.enum(["success", "failure", "partial"])
|
|
57
|
+
.describe("Outcome of the action"),
|
|
58
|
+
actual_cost: z.number().int().min(0).describe("Actual cost in cents"),
|
|
59
|
+
}, async ({ agent_id, txn_id, outcome, actual_cost }) => {
|
|
60
|
+
try {
|
|
61
|
+
const result = await api.report({ agent_id, txn_id, outcome, actual_cost });
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: JSON.stringify({
|
|
67
|
+
txn_id: result.txn_id,
|
|
68
|
+
score_before: result.score_before,
|
|
69
|
+
score_after: result.score_after,
|
|
70
|
+
agent_status: result.status,
|
|
71
|
+
}, null, 2),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
isError: true,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
// ---- kredit_balance ----
|
|
89
|
+
server.tool("kredit_balance", "Check agent wallet balance and credit score. Use this to understand an agent's current spending capacity and risk standing.", {
|
|
90
|
+
agent_id: z.string().describe("The agent ID to look up"),
|
|
91
|
+
}, async ({ agent_id }) => {
|
|
92
|
+
try {
|
|
93
|
+
const agent = await api.getAgent(agent_id);
|
|
94
|
+
return {
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: "text",
|
|
98
|
+
text: JSON.stringify({
|
|
99
|
+
id: agent.id,
|
|
100
|
+
name: agent.name,
|
|
101
|
+
status: agent.status,
|
|
102
|
+
wallet: {
|
|
103
|
+
balance_cents: agent.wallet.balance,
|
|
104
|
+
budget_cents: agent.wallet.budget,
|
|
105
|
+
rate_limit_cents_per_hour: agent.wallet.rate_limit,
|
|
106
|
+
rate_used_cents: agent.wallet.rate_used,
|
|
107
|
+
},
|
|
108
|
+
credit: {
|
|
109
|
+
score: agent.credit.score,
|
|
110
|
+
task_success_rate: agent.credit.task_success_rate,
|
|
111
|
+
cost_efficiency: agent.credit.cost_efficiency,
|
|
112
|
+
violation_count: agent.credit.violation_count,
|
|
113
|
+
total_tasks: agent.credit.total_tasks,
|
|
114
|
+
},
|
|
115
|
+
}, null, 2),
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
return {
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: "text",
|
|
125
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
isError: true,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
// ---- kredit_agents ----
|
|
133
|
+
server.tool("kredit_agents", "List agents and their statuses. Optionally filter by organization.", {
|
|
134
|
+
org_id: z
|
|
135
|
+
.string()
|
|
136
|
+
.optional()
|
|
137
|
+
.describe("Organization ID to filter by (optional)"),
|
|
138
|
+
}, async ({ org_id }) => {
|
|
139
|
+
try {
|
|
140
|
+
const agents = await api.listAgents(org_id);
|
|
141
|
+
return {
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
type: "text",
|
|
145
|
+
text: JSON.stringify(agents.map((a) => ({
|
|
146
|
+
id: a.id,
|
|
147
|
+
name: a.name,
|
|
148
|
+
org_id: a.org_id,
|
|
149
|
+
status: a.status,
|
|
150
|
+
score: a.score,
|
|
151
|
+
wallet_balance_cents: a.wallet_balance,
|
|
152
|
+
})), null, 2),
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
return {
|
|
159
|
+
content: [
|
|
160
|
+
{
|
|
161
|
+
type: "text",
|
|
162
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
isError: true,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return server;
|
|
170
|
+
}
|
|
171
|
+
async function main() {
|
|
172
|
+
const config = resolveConfig();
|
|
173
|
+
if (!config.apiKey) {
|
|
174
|
+
console.error("Warning: No KREDIT_API_KEY set. Provide via env or --api-key flag.");
|
|
175
|
+
}
|
|
176
|
+
const api = new KreditAPI(config);
|
|
177
|
+
const server = createServer(api);
|
|
178
|
+
const transport = new StdioServerTransport();
|
|
179
|
+
await server.connect(transport);
|
|
180
|
+
}
|
|
181
|
+
main().catch((err) => {
|
|
182
|
+
console.error("Fatal:", err);
|
|
183
|
+
process.exit(1);
|
|
184
|
+
});
|
|
185
|
+
export { createServer, KreditAPI };
|
|
186
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,SA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AAC,cAAc;yBACvC,CAAC,CAAC,EACH,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;qBACnE;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CACX,oEAAoE,CACrE,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kredit-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Kredit — bring agent spend controls to Claude Code and Claude Desktop",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"kredit-mcp": "./bin/kredit-mcp"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"lint": "biome check src/ test/",
|
|
17
|
+
"format": "biome format --write src/ test/"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"bin"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"mcp",
|
|
25
|
+
"kredit",
|
|
26
|
+
"claude",
|
|
27
|
+
"agent",
|
|
28
|
+
"risk"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.12.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@biomejs/biome": "^1.9.4",
|
|
36
|
+
"@types/node": "^25.5.2",
|
|
37
|
+
"typescript": "^5.7.3",
|
|
38
|
+
"vitest": "^3.1.1"
|
|
39
|
+
}
|
|
40
|
+
}
|