@kasarlabs/braavos-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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kasar Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Snak - Braavos Plugin
2
+
3
+ The Braavos Plugin provides tools for creating and deploying Braavos wallet accounts on the Starknet blockchain.
4
+
5
+ ## Features
6
+
7
+ This plugin adds the following tools:
8
+
9
+ - **create_new_braavos_account**: Create a new Braavos account and return the privateKey, publicKey, and contractAddress.
10
+ - **deploy_existing_braavos_account**: Deploy an existing Braavos Account and return the privateKey, publicKey, and contractAddress.
11
+
12
+ ## Usage
13
+
14
+ The Braavos Plugin is used internally by the Starknet Agent and doesn't need to be called directly. When the agent is initialized, it automatically registers these tools, making them available for use.
15
+
16
+ ## Example
17
+
18
+ When asking the agent to perform Braavos-related tasks, it will use the appropriate tool from this plugin:
19
+
20
+ ```
21
+ "Create a new Braavos wallet for me" // Uses create_new_braavos_account
22
+ "Deploy my existing Braavos account" // Uses deploy_existing_braavos_account
23
+ ```
24
+
25
+ ## Development
26
+
27
+ To extend this plugin, add new tools in the `src/tools` directory and register them in the `registerTools` function in `src/tools/index.ts`.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import('../build/index.js').catch(console.error);
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export declare const RegisterToolInServer: () => Promise<void>;
package/build/index.js ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { registerToolsWithServer, getOnchainRead, } from '@kasarlabs/ask-starknet-core';
5
+ import dotenv from 'dotenv';
6
+ import { accountDetailsSchema } from './schemas/index.js';
7
+ import { DeployBraavosAccount } from './tools/deployAccount.js';
8
+ import { CreateBraavosAccount } from './tools/createAccount.js';
9
+ dotenv.config();
10
+ const server = new McpServer({
11
+ name: 'starknet-braavos-mcp',
12
+ version: '0.0.1',
13
+ });
14
+ const registerTools = (BraavosToolRegistry) => {
15
+ BraavosToolRegistry.push({
16
+ name: 'create_new_braavos_account',
17
+ description: 'Create a new Braavos account and return the privateKey/publicKey/contractAddress',
18
+ execute: async () => {
19
+ return await CreateBraavosAccount();
20
+ },
21
+ });
22
+ BraavosToolRegistry.push({
23
+ name: 'deploy_existing_braavos_account',
24
+ description: 'Deploy an existing Braavos Account return the privateKey/publicKey/contractAddress',
25
+ schema: accountDetailsSchema,
26
+ execute: async (params) => {
27
+ const onchainRead = getOnchainRead();
28
+ return await DeployBraavosAccount(onchainRead, params);
29
+ },
30
+ });
31
+ };
32
+ export const RegisterToolInServer = async () => {
33
+ const tools = [];
34
+ registerTools(tools);
35
+ await registerToolsWithServer(server, tools);
36
+ };
37
+ async function main() {
38
+ const transport = new StdioServerTransport();
39
+ await RegisterToolInServer();
40
+ await server.connect(transport);
41
+ console.error('Starknet Braavos MCP Server running on stdio');
42
+ }
43
+ main().catch((error) => {
44
+ console.error('Fatal error in main():', error);
45
+ process.exit(1);
46
+ });
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAEL,uBAAuB,EACvB,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,mBAA8B,EAAE,EAAE;IACvD,mBAAmB,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACT,kFAAkF;QACpF,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,MAAM,oBAAoB,EAAE,CAAC;QACtC,CAAC;KACF,CAAC,CAAC;IAEH,mBAAmB,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,iCAAiC;QACvC,WAAW,EACT,oFAAoF;QACtF,MAAM,EAAE,oBAAoB;QAC5B,OAAO,EAAE,KAAK,EAAE,MAAW,EAAE,EAAE;YAC7B,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;YACrC,OAAO,MAAM,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACzD,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE;IAC7C,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,aAAa,CAAC,KAAK,CAAC,CAAC;IACrB,MAAM,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,MAAM,oBAAoB,EAAE,CAAC;IAC7B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;AAChE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,89 @@
1
+ export declare const BRAAVOS_ACCOUNT_ABI: ({
2
+ type: string;
3
+ name: string;
4
+ interface_name: string;
5
+ members?: undefined;
6
+ variants?: undefined;
7
+ items?: undefined;
8
+ inputs?: undefined;
9
+ kind?: undefined;
10
+ } | {
11
+ type: string;
12
+ name: string;
13
+ members: {
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ interface_name?: undefined;
18
+ variants?: undefined;
19
+ items?: undefined;
20
+ inputs?: undefined;
21
+ kind?: undefined;
22
+ } | {
23
+ type: string;
24
+ name: string;
25
+ variants: {
26
+ name: string;
27
+ type: string;
28
+ }[];
29
+ interface_name?: undefined;
30
+ members?: undefined;
31
+ items?: undefined;
32
+ inputs?: undefined;
33
+ kind?: undefined;
34
+ } | {
35
+ type: string;
36
+ name: string;
37
+ items: {
38
+ type: string;
39
+ name: string;
40
+ inputs: {
41
+ name: string;
42
+ type: string;
43
+ }[];
44
+ outputs: {
45
+ type: string;
46
+ }[];
47
+ state_mutability: string;
48
+ }[];
49
+ interface_name?: undefined;
50
+ members?: undefined;
51
+ variants?: undefined;
52
+ inputs?: undefined;
53
+ kind?: undefined;
54
+ } | {
55
+ type: string;
56
+ name: string;
57
+ inputs: never[];
58
+ interface_name?: undefined;
59
+ members?: undefined;
60
+ variants?: undefined;
61
+ items?: undefined;
62
+ kind?: undefined;
63
+ } | {
64
+ type: string;
65
+ name: string;
66
+ kind: string;
67
+ members: {
68
+ name: string;
69
+ type: string;
70
+ kind: string;
71
+ }[];
72
+ interface_name?: undefined;
73
+ variants?: undefined;
74
+ items?: undefined;
75
+ inputs?: undefined;
76
+ } | {
77
+ type: string;
78
+ name: string;
79
+ kind: string;
80
+ variants: {
81
+ name: string;
82
+ type: string;
83
+ kind: string;
84
+ }[];
85
+ interface_name?: undefined;
86
+ members?: undefined;
87
+ items?: undefined;
88
+ inputs?: undefined;
89
+ })[];