@kasarlabs/argent-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 +21 -0
- package/README.md +110 -0
- package/bin/argent-mcp.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +48 -0
- package/build/index.js.map +1 -0
- package/build/interfaces/index.d.ts +1 -0
- package/build/interfaces/index.js +2 -0
- package/build/interfaces/index.js.map +1 -0
- package/build/lib/abis/argentAbi.d.ts +92 -0
- package/build/lib/abis/argentAbi.js +1658 -0
- package/build/lib/abis/argentAbi.js.map +1 -0
- package/build/lib/constant/contract.d.ts +3 -0
- package/build/lib/constant/contract.js +4 -0
- package/build/lib/constant/contract.js.map +1 -0
- package/build/lib/dependances/types.d.ts +2 -0
- package/build/lib/dependances/types.js +45 -0
- package/build/lib/dependances/types.js.map +1 -0
- package/build/lib/types/accounts.d.ts +57 -0
- package/build/lib/types/accounts.js +2 -0
- package/build/lib/types/accounts.js.map +1 -0
- package/build/lib/utils/AccountManager.d.ts +9 -0
- package/build/lib/utils/AccountManager.js +93 -0
- package/build/lib/utils/AccountManager.js.map +1 -0
- package/build/schemas/schema.d.ts +14 -0
- package/build/schemas/schema.js +7 -0
- package/build/schemas/schema.js.map +1 -0
- package/build/tools/createAccount.d.ts +35 -0
- package/build/tools/createAccount.js +47 -0
- package/build/tools/createAccount.js.map +1 -0
- package/build/tools/deployAccount.d.ts +29 -0
- package/build/tools/deployAccount.js +41 -0
- package/build/tools/deployAccount.js.map +1 -0
- package/package.json +43 -0
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,110 @@
|
|
|
1
|
+
# Snak - ArgentX Plugin
|
|
2
|
+
|
|
3
|
+
A collection of Starknet tools for creating and deploying Argent accounts through the Kasarlabs ecosystem.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This package provides Starknet tools that allow developers to easily create and deploy Argent accounts on the Starknet network. These tools integrate with the Kasarlabs core framework to streamline account management operations.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Create new Argent accounts
|
|
12
|
+
- Deploy existing Argent accounts
|
|
13
|
+
- Manage account details securely
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @snakagent/argent-plugins
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Registering the Tools
|
|
24
|
+
|
|
25
|
+
Import and register the Argent tools in your application:
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import { registerTools } from '@snakagent/argent-plugins';
|
|
29
|
+
import { StarknetTool, SnakAgentInterface } from '@snakagent/core';
|
|
30
|
+
|
|
31
|
+
// Initialize your tools registry
|
|
32
|
+
const StarknetToolRegistry = [];
|
|
33
|
+
|
|
34
|
+
// Optional: Your agent implementation
|
|
35
|
+
const agent = yourSnakAgent;
|
|
36
|
+
|
|
37
|
+
// Register the Argent tools
|
|
38
|
+
registerTools(StarknetToolRegistry, agent);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Creating a New Argent Account
|
|
42
|
+
|
|
43
|
+
Once registered, you can use the tools to create a new Argent account:
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
// Assuming you have an agent instance
|
|
47
|
+
const result = await agent.execute('create_new_argent_account');
|
|
48
|
+
|
|
49
|
+
console.log('New Argent Account:', result);
|
|
50
|
+
// Output will include privateKey, publicKey, and contractAddress
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Deploying an Existing Argent Account
|
|
54
|
+
|
|
55
|
+
To deploy an existing account:
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
const accountDetails = {
|
|
59
|
+
privateKey: 'your_private_key',
|
|
60
|
+
// Other required account details according to accountDetailsSchema
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const deploymentResult = await agent.execute(
|
|
64
|
+
'deploy_existing_argent_account',
|
|
65
|
+
accountDetails
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
console.log('Deployed Account:', deploymentResult);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Tool Descriptions
|
|
72
|
+
|
|
73
|
+
### create_new_argent_account
|
|
74
|
+
|
|
75
|
+
Creates a new Argent account and returns essential account information.
|
|
76
|
+
|
|
77
|
+
- **Name**: `create_new_argent_account`
|
|
78
|
+
- **Description**: Creates a new Argent account and returns the privateKey/publicKey/contractAddress
|
|
79
|
+
- **Plugin**: `argent`
|
|
80
|
+
- **Parameters**: None
|
|
81
|
+
- **Returns**: Object containing account information (wrapped by `wrapAccountCreationResponse`)
|
|
82
|
+
|
|
83
|
+
### deploy_existing_argent_account
|
|
84
|
+
|
|
85
|
+
Deploys an existing Argent account using provided account details.
|
|
86
|
+
|
|
87
|
+
- **Name**: `deploy_existing_argent_account`
|
|
88
|
+
- **Description**: Deploy an existing Argent Account and return the privateKey/publicKey/contractAddress
|
|
89
|
+
- **Plugin**: `argent`
|
|
90
|
+
- **Schema**: Uses `accountDetailsSchema` for validation
|
|
91
|
+
- **Parameters**: Account details according to the schema
|
|
92
|
+
- **Returns**: Deployment information including account details
|
|
93
|
+
|
|
94
|
+
## Schema Information
|
|
95
|
+
|
|
96
|
+
The package uses `accountDetailsSchema` to validate account details for deployment. Refer to the schema documentation for the exact format and required fields.
|
|
97
|
+
|
|
98
|
+
## Dependencies
|
|
99
|
+
|
|
100
|
+
- `@snakagent/core`: Core framework for Starknet tools and agent interfaces
|
|
101
|
+
- Account management utilities from '../utils/AccountManager.js'
|
|
102
|
+
- Account creation and deployment actions
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT License - see the LICENSE file for details.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
For detailed documentation visit [docs.kasar.io](https://docs.kasar.io)
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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 dotenv from 'dotenv';
|
|
5
|
+
import { CreateArgentAccount } from './tools/createAccount.js';
|
|
6
|
+
import { DeployArgentAccount } from './tools/deployAccount.js';
|
|
7
|
+
import { accountDetailsSchema } from './schemas/schema.js';
|
|
8
|
+
import { registerToolsWithServer, getOnchainRead, } from '@kasarlabs/ask-starknet-core';
|
|
9
|
+
dotenv.config();
|
|
10
|
+
const server = new McpServer({
|
|
11
|
+
name: 'starknet-argent-mcp',
|
|
12
|
+
version: '0.0.1',
|
|
13
|
+
});
|
|
14
|
+
const registerTools = (ArgentToolRegistry) => {
|
|
15
|
+
ArgentToolRegistry.push({
|
|
16
|
+
name: 'create_new_argent_account',
|
|
17
|
+
description: 'Creates a new Argent account and return the privateKey/publicKey/contractAddress',
|
|
18
|
+
execute: async () => {
|
|
19
|
+
const onchainRead = getOnchainRead();
|
|
20
|
+
return await CreateArgentAccount(onchainRead);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
ArgentToolRegistry.push({
|
|
24
|
+
name: 'deploy_existing_argent_account',
|
|
25
|
+
description: 'Deploy an existing Argent Account return the privateKey/publicKey/contractAddress',
|
|
26
|
+
schema: accountDetailsSchema,
|
|
27
|
+
execute: async (params) => {
|
|
28
|
+
const onchainRead = getOnchainRead();
|
|
29
|
+
return await DeployArgentAccount(onchainRead, params);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export const RegisterToolInServer = async () => {
|
|
34
|
+
const tools = [];
|
|
35
|
+
registerTools(tools);
|
|
36
|
+
await registerToolsWithServer(server, tools);
|
|
37
|
+
};
|
|
38
|
+
async function main() {
|
|
39
|
+
const transport = new StdioServerTransport();
|
|
40
|
+
await RegisterToolInServer();
|
|
41
|
+
await server.connect(transport);
|
|
42
|
+
console.error('Starknet Argent MCP Server running on stdio');
|
|
43
|
+
}
|
|
44
|
+
main().catch((error) => {
|
|
45
|
+
console.error('Fatal error in main():', error);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
});
|
|
48
|
+
//# 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,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AAC,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,6CAA6C,CAAC,CAAC;AAC/D,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare const ARGENT_ACCOUNT_ABI: ({
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
interface_name: string;
|
|
5
|
+
members?: undefined;
|
|
6
|
+
items?: undefined;
|
|
7
|
+
variants?: 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
|
+
items?: undefined;
|
|
19
|
+
variants?: undefined;
|
|
20
|
+
inputs?: undefined;
|
|
21
|
+
kind?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
type: string;
|
|
24
|
+
name: string;
|
|
25
|
+
items: {
|
|
26
|
+
type: string;
|
|
27
|
+
name: string;
|
|
28
|
+
inputs: {
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
}[];
|
|
32
|
+
outputs: {
|
|
33
|
+
type: string;
|
|
34
|
+
}[];
|
|
35
|
+
state_mutability: string;
|
|
36
|
+
}[];
|
|
37
|
+
interface_name?: undefined;
|
|
38
|
+
members?: undefined;
|
|
39
|
+
variants?: undefined;
|
|
40
|
+
inputs?: undefined;
|
|
41
|
+
kind?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: string;
|
|
44
|
+
name: string;
|
|
45
|
+
variants: {
|
|
46
|
+
name: string;
|
|
47
|
+
type: string;
|
|
48
|
+
}[];
|
|
49
|
+
interface_name?: undefined;
|
|
50
|
+
members?: undefined;
|
|
51
|
+
items?: undefined;
|
|
52
|
+
inputs?: undefined;
|
|
53
|
+
kind?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
type: string;
|
|
56
|
+
name: string;
|
|
57
|
+
inputs: {
|
|
58
|
+
name: string;
|
|
59
|
+
type: string;
|
|
60
|
+
}[];
|
|
61
|
+
interface_name?: undefined;
|
|
62
|
+
members?: undefined;
|
|
63
|
+
items?: undefined;
|
|
64
|
+
variants?: undefined;
|
|
65
|
+
kind?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: string;
|
|
68
|
+
name: string;
|
|
69
|
+
kind: string;
|
|
70
|
+
members: {
|
|
71
|
+
name: string;
|
|
72
|
+
type: string;
|
|
73
|
+
kind: string;
|
|
74
|
+
}[];
|
|
75
|
+
interface_name?: undefined;
|
|
76
|
+
items?: undefined;
|
|
77
|
+
variants?: undefined;
|
|
78
|
+
inputs?: undefined;
|
|
79
|
+
} | {
|
|
80
|
+
type: string;
|
|
81
|
+
name: string;
|
|
82
|
+
kind: string;
|
|
83
|
+
variants: {
|
|
84
|
+
name: string;
|
|
85
|
+
type: string;
|
|
86
|
+
kind: string;
|
|
87
|
+
}[];
|
|
88
|
+
interface_name?: undefined;
|
|
89
|
+
members?: undefined;
|
|
90
|
+
items?: undefined;
|
|
91
|
+
inputs?: undefined;
|
|
92
|
+
})[];
|