@andrewkimjoseph/celina 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.
Files changed (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +225 -0
  3. package/bin/cli.js +2 -0
  4. package/build/clients/celo-client.d.ts +14 -0
  5. package/build/clients/celo-client.js +58 -0
  6. package/build/clients/celo-client.js.map +1 -0
  7. package/build/config/chains.d.ts +932 -0
  8. package/build/config/chains.js +236 -0
  9. package/build/config/chains.js.map +1 -0
  10. package/build/config/env.d.ts +5 -0
  11. package/build/config/env.js +7 -0
  12. package/build/config/env.js.map +1 -0
  13. package/build/context/app-context.d.ts +16 -0
  14. package/build/context/app-context.js +17 -0
  15. package/build/context/app-context.js.map +1 -0
  16. package/build/crypto/wallet-key-crypto.d.ts +11 -0
  17. package/build/crypto/wallet-key-crypto.js +57 -0
  18. package/build/crypto/wallet-key-crypto.js.map +1 -0
  19. package/build/http.d.ts +2 -0
  20. package/build/http.js +14 -0
  21. package/build/http.js.map +1 -0
  22. package/build/index.d.ts +2 -0
  23. package/build/index.js +14 -0
  24. package/build/index.js.map +1 -0
  25. package/build/schemas/common.d.ts +4 -0
  26. package/build/schemas/common.js +16 -0
  27. package/build/schemas/common.js.map +1 -0
  28. package/build/server/create-http-app.d.ts +1 -0
  29. package/build/server/create-http-app.js +134 -0
  30. package/build/server/create-http-app.js.map +1 -0
  31. package/build/server/create-server.d.ts +2 -0
  32. package/build/server/create-server.js +21 -0
  33. package/build/server/create-server.js.map +1 -0
  34. package/build/server/instructions.d.ts +1 -0
  35. package/build/server/instructions.js +13 -0
  36. package/build/server/instructions.js.map +1 -0
  37. package/build/services/account.service.d.ts +13 -0
  38. package/build/services/account.service.js +23 -0
  39. package/build/services/account.service.js.map +1 -0
  40. package/build/services/blockchain.service.d.ts +40 -0
  41. package/build/services/blockchain.service.js +81 -0
  42. package/build/services/blockchain.service.js.map +1 -0
  43. package/build/services/token.service.d.ts +54 -0
  44. package/build/services/token.service.js +147 -0
  45. package/build/services/token.service.js.map +1 -0
  46. package/build/services/transaction.service.d.ts +33 -0
  47. package/build/services/transaction.service.js +126 -0
  48. package/build/services/transaction.service.js.map +1 -0
  49. package/build/tools/blockchain.tools.d.ts +3 -0
  50. package/build/tools/blockchain.tools.js +88 -0
  51. package/build/tools/blockchain.tools.js.map +1 -0
  52. package/build/tools/helpers.d.ts +3 -0
  53. package/build/tools/helpers.js +16 -0
  54. package/build/tools/helpers.js.map +1 -0
  55. package/build/tools/index.d.ts +5 -0
  56. package/build/tools/index.js +17 -0
  57. package/build/tools/index.js.map +1 -0
  58. package/build/tools/token.tools.d.ts +2 -0
  59. package/build/tools/token.tools.js +62 -0
  60. package/build/tools/token.tools.js.map +1 -0
  61. package/build/tools/transaction.tools.d.ts +2 -0
  62. package/build/tools/transaction.tools.js +68 -0
  63. package/build/tools/transaction.tools.js.map +1 -0
  64. package/build/tools/types.d.ts +5 -0
  65. package/build/tools/types.js +2 -0
  66. package/build/tools/types.js.map +1 -0
  67. package/build/tools/wallet.tools.d.ts +2 -0
  68. package/build/tools/wallet.tools.js +23 -0
  69. package/build/tools/wallet.tools.js.map +1 -0
  70. package/package.json +54 -0
@@ -0,0 +1,16 @@
1
+ export function ok(data) {
2
+ const text = JSON.stringify(data, null, 2);
3
+ return {
4
+ content: [{ type: "text", text }],
5
+ structuredContent: typeof data === "object" && data !== null
6
+ ? data
7
+ : { value: data },
8
+ };
9
+ }
10
+ export function err(message) {
11
+ return {
12
+ content: [{ type: "text", text: message }],
13
+ isError: true,
14
+ };
15
+ }
16
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/tools/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,EAAE,CAAC,IAAa;IAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3C,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACjC,iBAAiB,EACf,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;YACvC,CAAC,CAAE,IAAgC;YACnC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;KACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,OAAe;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { AppContext } from "../context/app-context.js";
3
+ import type { ToolModule } from "./types.js";
4
+ export declare const toolModules: ToolModule[];
5
+ export declare function registerAllTools(server: McpServer, ctx: AppContext): void;
@@ -0,0 +1,17 @@
1
+ import { accountTools, blockchainTools } from "./blockchain.tools.js";
2
+ import { tokenTools } from "./token.tools.js";
3
+ import { transactionTools } from "./transaction.tools.js";
4
+ import { walletTools } from "./wallet.tools.js";
5
+ export const toolModules = [
6
+ blockchainTools,
7
+ accountTools,
8
+ tokenTools,
9
+ walletTools,
10
+ transactionTools,
11
+ ];
12
+ export function registerAllTools(server, ctx) {
13
+ for (const module of toolModules) {
14
+ module.register(server, ctx);
15
+ }
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,eAAe;IACf,YAAY;IACZ,UAAU;IACV,WAAW;IACX,gBAAgB;CACjB,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,GAAe;IACjE,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ToolModule } from "./types.js";
2
+ export declare const tokenTools: ToolModule;
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ import { addressSchema, tokenSymbolSchema } from "../schemas/common.js";
3
+ import { err, ok } from "./helpers.js";
4
+ export const tokenTools = {
5
+ register(server, ctx) {
6
+ server.registerTool("get_celo_balances", {
7
+ title: "Get Celo Balances",
8
+ description: "Returns native CELO and ERC-20 balances for an address on mainnet. Defaults to CELO + USDm.",
9
+ inputSchema: z.object({
10
+ address: addressSchema,
11
+ tokens: z.array(tokenSymbolSchema).optional(),
12
+ }),
13
+ annotations: { readOnlyHint: true, idempotentHint: true },
14
+ }, async ({ address, tokens }) => {
15
+ try {
16
+ return ok(await ctx.token.getBalances(address, tokens));
17
+ }
18
+ catch (error) {
19
+ return err(error instanceof Error ? error.message : String(error));
20
+ }
21
+ });
22
+ server.registerTool("get_stablecoin_balances", {
23
+ title: "Get Stablecoin Balances",
24
+ description: "Returns balances for Celo mainnet local stablecoins (Mento, USDC, USDT, etc.). Checks all stablecoins by default and omits zero balances.",
25
+ inputSchema: z.object({
26
+ address: addressSchema,
27
+ stablecoins: z
28
+ .array(z.string())
29
+ .optional()
30
+ .describe("Stablecoin symbols to check (e.g. USDm, USDC). Defaults to all mainnet stablecoins."),
31
+ includeZero: z
32
+ .boolean()
33
+ .optional()
34
+ .describe("Include stablecoins with zero balance"),
35
+ }),
36
+ annotations: { readOnlyHint: true, idempotentHint: true },
37
+ }, async ({ address, stablecoins, includeZero }) => {
38
+ try {
39
+ return ok(await ctx.token.getStablecoinBalances(address, { stablecoins, includeZero }));
40
+ }
41
+ catch (error) {
42
+ return err(error instanceof Error ? error.message : String(error));
43
+ }
44
+ });
45
+ server.registerTool("get_token_info", {
46
+ title: "Get Token Info",
47
+ description: "Returns metadata for a known or custom ERC-20 token on mainnet.",
48
+ inputSchema: z.object({
49
+ token: tokenSymbolSchema,
50
+ }),
51
+ annotations: { readOnlyHint: true, idempotentHint: true },
52
+ }, async ({ token }) => {
53
+ try {
54
+ return ok(await ctx.token.getTokenInfo(token));
55
+ }
56
+ catch (error) {
57
+ return err(error instanceof Error ? error.message : String(error));
58
+ }
59
+ });
60
+ },
61
+ };
62
+ //# sourceMappingURL=token.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.tools.js","sourceRoot":"","sources":["../../src/tools/token.tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAe;IACpC,QAAQ,CAAC,MAAiB,EAAE,GAAe;QACzC,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;YACE,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,6FAA6F;YAC/F,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,OAAO,EAAE,aAAa;gBACtB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;aAC9C,CAAC;YACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;SAC1D,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,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M,CAAC,YAAY,CACjB,gBAAgB,EAChB;YACE,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,iEAAiE;YAC9E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,KAAK,EAAE,iBAAiB;aACzB,CAAC;YACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;SAC1D,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YAClB,IAAI,CAAC;gBACH,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;YACjD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ToolModule } from "./types.js";
2
+ export declare const transactionTools: ToolModule;
@@ -0,0 +1,68 @@
1
+ import { z } from "zod";
2
+ import { addressSchema, tokenSymbolSchema } from "../schemas/common.js";
3
+ import { err, ok } from "./helpers.js";
4
+ const encryptedPrivateKeySchema = z
5
+ .string()
6
+ .optional()
7
+ .describe("RSA-OAEP encrypted private key (base64). Encrypt locally with get_wallet_encryption_public_key.");
8
+ export const transactionTools = {
9
+ register(server, ctx) {
10
+ server.registerTool("estimate_send", {
11
+ title: "Estimate Send",
12
+ description: "Estimates gas for sending CELO or an ERC-20 token on mainnet. Requires encryptedPrivateKey (hosted) or CELO_PRIVATE_KEY (local).",
13
+ inputSchema: z.object({
14
+ to: addressSchema,
15
+ token: tokenSymbolSchema.default("CELO"),
16
+ amount: z.string().describe("Human-readable amount, e.g. 1.5"),
17
+ encryptedPrivateKey: encryptedPrivateKeySchema,
18
+ }),
19
+ annotations: { readOnlyHint: true },
20
+ }, async ({ to, token, amount, encryptedPrivateKey }) => {
21
+ try {
22
+ return ok(await ctx.transaction.estimateSend(to, token, amount, encryptedPrivateKey));
23
+ }
24
+ catch (error) {
25
+ return err(error instanceof Error ? error.message : String(error));
26
+ }
27
+ });
28
+ server.registerTool("send_token", {
29
+ title: "Send Token",
30
+ description: "Send CELO or an ERC-20 token on mainnet. User must encrypt their private key with the server's public key (get_wallet_encryption_public_key) before calling.",
31
+ inputSchema: z.object({
32
+ to: addressSchema,
33
+ token: tokenSymbolSchema.default("CELO"),
34
+ amount: z.string().describe("Human-readable amount, e.g. 0.01"),
35
+ encryptedPrivateKey: encryptedPrivateKeySchema,
36
+ }),
37
+ annotations: {
38
+ destructiveHint: true,
39
+ openWorldHint: true,
40
+ },
41
+ }, async ({ to, token, amount, encryptedPrivateKey }) => {
42
+ try {
43
+ return ok(await ctx.transaction.sendToken(to, token, amount, encryptedPrivateKey));
44
+ }
45
+ catch (error) {
46
+ return err(error instanceof Error ? error.message : String(error));
47
+ }
48
+ });
49
+ server.registerTool("get_swap_quote", {
50
+ title: "Get Swap Quote",
51
+ description: "Preview a token swap on Celo mainnet. Routing integration is stubbed for v0.1.",
52
+ inputSchema: z.object({
53
+ fromToken: tokenSymbolSchema,
54
+ toToken: tokenSymbolSchema,
55
+ amount: z.string(),
56
+ }),
57
+ annotations: { readOnlyHint: true },
58
+ }, async ({ fromToken, toToken, amount }) => {
59
+ try {
60
+ return ok(await ctx.transaction.getSwapQuote(fromToken, toToken, amount));
61
+ }
62
+ catch (error) {
63
+ return err(error instanceof Error ? error.message : String(error));
64
+ }
65
+ });
66
+ },
67
+ };
68
+ //# sourceMappingURL=transaction.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.tools.js","sourceRoot":"","sources":["../../src/tools/transaction.tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE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C;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { AppContext } from "../context/app-context.js";
3
+ export interface ToolModule {
4
+ register(server: McpServer, ctx: AppContext): void;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import type { ToolModule } from "./types.js";
2
+ export declare const walletTools: ToolModule;
@@ -0,0 +1,23 @@
1
+ import { getEncryptionInfo, isWalletEncryptionConfigured, } from "../crypto/wallet-key-crypto.js";
2
+ import { err, ok } from "./helpers.js";
3
+ export const walletTools = {
4
+ register(server, _ctx) {
5
+ server.registerTool("get_wallet_encryption_public_key", {
6
+ title: "Get Wallet Encryption Public Key",
7
+ description: "Returns the server's RSA public key for encrypting private keys before write operations.",
8
+ inputSchema: {},
9
+ annotations: { readOnlyHint: true },
10
+ }, async () => {
11
+ try {
12
+ if (!isWalletEncryptionConfigured()) {
13
+ return err("Wallet encryption is not configured. For local stdio mode, set CELO_PRIVATE_KEY instead.");
14
+ }
15
+ return ok(getEncryptionInfo());
16
+ }
17
+ catch (error) {
18
+ return err(error instanceof Error ? error.message : String(error));
19
+ }
20
+ });
21
+ },
22
+ };
23
+ //# sourceMappingURL=wallet.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.tools.js","sourceRoot":"","sources":["../../src/tools/wallet.tools.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,QAAQ,CAAC,MAAiB,EAAE,IAAgB;QAC1C,MAAM,CAAC,YAAY,CACjB,kCAAkC,EAClC;YACE,KAAK,EAAE,kCAAkC;YACzC,WAAW,EACT,0FAA0F;YAC5F,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;SACpC,EACD,KAAK,IAAI,EAAE;YACT,IAAI,CAAC;gBACH,IAAI,CAAC,4BAA4B,EAAE,EAAE,CAAC;oBACpC,OAAO,GAAG,CACR,0FAA0F,CAC3F,CAAC;gBACJ,CAAC;gBACD,OAAO,EAAE,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACjC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@andrewkimjoseph/celina",
3
+ "version": "0.2.0",
4
+ "description": "Celina — MCP server for Celo mainnet. Balances, transfers, swaps, and chain reads for LLM agents.",
5
+ "type": "module",
6
+ "main": "build/index.js",
7
+ "bin": {
8
+ "celina": "bin/cli.js"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "files": [
14
+ "build/",
15
+ "bin/",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "scripts": {
20
+ "build": "rm -rf build && tsc",
21
+ "start": "node build/index.js",
22
+ "start:http": "node build/http.js",
23
+ "dev": "tsc --watch",
24
+ "prepare": "npm run build",
25
+ "inspect": "npx @modelcontextprotocol/inspector node build/index.js",
26
+ "encrypt-key": "tsx scripts/encrypt-key.ts"
27
+ },
28
+ "engines": {
29
+ "node": ">=20.0.0"
30
+ },
31
+ "keywords": [
32
+ "mcp",
33
+ "celina",
34
+ "celo",
35
+ "blockchain",
36
+ "web3",
37
+ "ai",
38
+ "agent"
39
+ ],
40
+ "author": "Andrew Kim Joseph",
41
+ "license": "MIT",
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.22.0",
44
+ "express": "^5.2.1",
45
+ "viem": "^2.39.3",
46
+ "zod": "^3.24.3"
47
+ },
48
+ "devDependencies": {
49
+ "@types/express": "^5.0.6",
50
+ "@types/node": "^22.0.0",
51
+ "tsx": "^4.22.3",
52
+ "typescript": "^5.8.2"
53
+ }
54
+ }