@toleno/mcp 1.0.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 +177 -0
- package/client-public.js +51 -0
- package/client.js +73 -0
- package/icon.png +0 -0
- package/index.js +134 -0
- package/package.json +44 -0
- package/setup.js +163 -0
- package/tools/info.js +247 -0
- package/tools/mining.js +23 -0
- package/tools/profile.js +48 -0
- package/tools/referral.js +29 -0
- package/tools/stats.js +33 -0
- package/tools/wallet.js +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# @toleno/mcp
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@toleno/mcp)
|
|
4
|
+
[](https://www.npmjs.com/package/@toleno/mcp)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://modelcontextprotocol.io)
|
|
8
|
+
|
|
9
|
+
**Toleno Network MCP Server** — Control your Toleno mining account directly from Claude AI using natural language.
|
|
10
|
+
|
|
11
|
+
> Check balance · Start mining · View referrals — all without opening the app.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<!--
|
|
16
|
+
📹 DEMO GIF — Kayıt talimatı:
|
|
17
|
+
1. Claude Desktop'u aç
|
|
18
|
+
2. "What is my Toleno mining status?" yaz
|
|
19
|
+
3. Yanıtı göster
|
|
20
|
+
demo.gif olarak bu klasöre kaydet, sonra aşağıdaki satırı aktif et:
|
|
21
|
+
-->
|
|
22
|
+
<!--  -->
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @toleno/mcp setup
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The setup wizard will:
|
|
33
|
+
1. Ask for your Toleno API key
|
|
34
|
+
2. Validate it against the Toleno API
|
|
35
|
+
3. Automatically update your Claude Desktop config
|
|
36
|
+
4. Remind you to restart Claude Desktop
|
|
37
|
+
|
|
38
|
+
Or non-interactive:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx @toleno/mcp setup --key tlno_your_key_here
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Get Your API Key
|
|
47
|
+
|
|
48
|
+
1. Open the **Toleno app** on your phone
|
|
49
|
+
2. Go to **Settings → API Keys**
|
|
50
|
+
3. Tap **"Create New Key"**
|
|
51
|
+
4. Name it (e.g. `Claude Desktop`)
|
|
52
|
+
5. **Copy it immediately** — starts with `tlno_`, shown only once
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Manual Setup
|
|
57
|
+
|
|
58
|
+
### Claude Desktop
|
|
59
|
+
|
|
60
|
+
| OS | Config file |
|
|
61
|
+
|----|-------------|
|
|
62
|
+
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
63
|
+
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
64
|
+
| Linux | `~/.config/Claude/claude_desktop_config.json` |
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"mcpServers": {
|
|
69
|
+
"Toleno Network": {
|
|
70
|
+
"command": "npx",
|
|
71
|
+
"args": ["-y", "@toleno/mcp"],
|
|
72
|
+
"env": {
|
|
73
|
+
"TOLENO_API_KEY": "tlno_paste_your_key_here"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Claude Code
|
|
81
|
+
|
|
82
|
+
Add `.mcp.json` to your project root:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"Toleno Network": {
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["-y", "@toleno/mcp"],
|
|
90
|
+
"env": {
|
|
91
|
+
"TOLENO_API_KEY": "tlno_paste_your_key_here"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Available Tools
|
|
101
|
+
|
|
102
|
+
| Tool | What it does | Needs key? |
|
|
103
|
+
|------|-------------|------------|
|
|
104
|
+
| `get_global_stats` | Total tokens mined, platform-wide user count | No |
|
|
105
|
+
| `get_profile` | Your balance, mining power, streak, level | Yes |
|
|
106
|
+
| `get_mining_status` | Active session, time remaining, tokens earned | Yes |
|
|
107
|
+
| `start_mining` | Start a new 24-hour mining session | Yes |
|
|
108
|
+
| `get_wallet_info` | Wallet address, withdrawable balance, limits | Yes |
|
|
109
|
+
| `get_referral_info` | Referral code, team size, active referrals | Yes |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## What You Can Ask Claude
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
"What is my Toleno mining status?"
|
|
117
|
+
"Start mining"
|
|
118
|
+
"How many TOL tokens do I have?"
|
|
119
|
+
"Show my wallet info"
|
|
120
|
+
"How many referrals do I have?"
|
|
121
|
+
"What are the global Toleno stats?"
|
|
122
|
+
"When does my mining session end?"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Example Session
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
You: What is my mining status?
|
|
131
|
+
|
|
132
|
+
Claude: Your mining session is active!
|
|
133
|
+
⛏ Started: 3 hours ago
|
|
134
|
+
⏱ Time remaining: 21 hours
|
|
135
|
+
💰 Earned so far: 3.5 / 28 TOL
|
|
136
|
+
✅ Keep it running to earn the full reward!
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
You: How many referrals do I have?
|
|
141
|
+
|
|
142
|
+
Claude: Your referral stats:
|
|
143
|
+
👥 Total referrals: 12
|
|
144
|
+
✅ Active today: 7
|
|
145
|
+
🔗 Your code: TOLENO-ABC123
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## FAQ
|
|
151
|
+
|
|
152
|
+
**Q: Is my API key safe?**
|
|
153
|
+
Your key is stored locally in the Claude config file — never sent to Claude's servers. Revoke it anytime from the Toleno app.
|
|
154
|
+
|
|
155
|
+
**Q: Can Claude do anything harmful to my account?**
|
|
156
|
+
No. Claude can only read data and start mining sessions. It cannot claim rewards, change your wallet address, withdraw tokens, or delete your account. To claim rewards, open the Toleno app.
|
|
157
|
+
|
|
158
|
+
**Q: The tools don't appear in Claude Desktop.**
|
|
159
|
+
Fully quit and restart Claude Desktop after setup. Look for the 🔨 hammer icon in the chat toolbar.
|
|
160
|
+
|
|
161
|
+
**Q: Do I need Node.js?**
|
|
162
|
+
Yes, Node.js 18 or higher. Download from [nodejs.org](https://nodejs.org).
|
|
163
|
+
|
|
164
|
+
**Q: It says "TOLENO_API_KEY is not configured".**
|
|
165
|
+
Run `npx @toleno/mcp setup` again or manually add the key to your config file.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Links
|
|
170
|
+
|
|
171
|
+
- **Toleno App:** [tolenocoin.com](https://tolenocoin.com)
|
|
172
|
+
- **npm Package:** [npmjs.com/package/@toleno/mcp](https://www.npmjs.com/package/@toleno/mcp)
|
|
173
|
+
- **GitHub:** [github.com/tolenonetwork/toleno-mcp](https://github.com/tolenonetwork/toleno-mcp)
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
MIT © [Toleno Network](https://tolenocoin.com)
|
package/client-public.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toleno Public API Client (No Auth)
|
|
3
|
+
* Used for public endpoints that require no authentication.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const http = require('http');
|
|
8
|
+
|
|
9
|
+
const API_BASE = process.env.TOLENO_API_URL || 'https://api.tolenocoin.com/api';
|
|
10
|
+
|
|
11
|
+
class TolenoPublicClient {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.base = new URL(API_BASE);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get(path) {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
const fullPath = this.base.pathname.replace(/\/$/, '') + path;
|
|
19
|
+
const isHttps = this.base.protocol === 'https:';
|
|
20
|
+
const lib = isHttps ? https : http;
|
|
21
|
+
|
|
22
|
+
const options = {
|
|
23
|
+
hostname: this.base.hostname,
|
|
24
|
+
port: this.base.port || (isHttps ? 443 : 80),
|
|
25
|
+
path: fullPath,
|
|
26
|
+
method: 'GET',
|
|
27
|
+
headers: {
|
|
28
|
+
'Accept': 'application/json',
|
|
29
|
+
'User-Agent': 'TolenoMCP/1.0'
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const req = lib.request(options, (res) => {
|
|
34
|
+
let data = '';
|
|
35
|
+
res.on('data', chunk => data += chunk);
|
|
36
|
+
res.on('end', () => {
|
|
37
|
+
try {
|
|
38
|
+
resolve(JSON.parse(data));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(new Error(`Failed to parse API response: ${data.substring(0, 200)}`));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
req.on('error', reject);
|
|
46
|
+
req.end();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = TolenoPublicClient;
|
package/client.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toleno API Client (Authenticated)
|
|
3
|
+
* Handles requests that require a personal API key (tlno_...).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const http = require('http');
|
|
8
|
+
|
|
9
|
+
const API_BASE = process.env.TOLENO_API_URL || 'https://api.tolenocoin.com/api';
|
|
10
|
+
|
|
11
|
+
class TolenoClient {
|
|
12
|
+
constructor(apiKey) {
|
|
13
|
+
if (!apiKey) throw new Error('TOLENO_API_KEY is required for authenticated tools');
|
|
14
|
+
this.apiKey = apiKey;
|
|
15
|
+
this.base = new URL(API_BASE);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
request(method, path, body = null) {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
const fullPath = this.base.pathname.replace(/\/$/, '') + path;
|
|
21
|
+
const isHttps = this.base.protocol === 'https:';
|
|
22
|
+
const lib = isHttps ? https : http;
|
|
23
|
+
const payload = body ? JSON.stringify(body) : null;
|
|
24
|
+
|
|
25
|
+
const options = {
|
|
26
|
+
hostname: this.base.hostname,
|
|
27
|
+
port: this.base.port || (isHttps ? 443 : 80),
|
|
28
|
+
path: fullPath,
|
|
29
|
+
method: method.toUpperCase(),
|
|
30
|
+
headers: {
|
|
31
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
'Accept': 'application/json',
|
|
34
|
+
'Accept-Language': 'en',
|
|
35
|
+
'User-Agent': 'TolenoMCP/1.0'
|
|
36
|
+
// No X-App-Version → version-check middleware skips
|
|
37
|
+
// No Android UA → Play Integrity middleware skips
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
if (payload) options.headers['Content-Length'] = Buffer.byteLength(payload);
|
|
42
|
+
|
|
43
|
+
const req = lib.request(options, (res) => {
|
|
44
|
+
let data = '';
|
|
45
|
+
res.on('data', chunk => data += chunk);
|
|
46
|
+
res.on('end', () => {
|
|
47
|
+
try {
|
|
48
|
+
const parsed = JSON.parse(data);
|
|
49
|
+
if (res.statusCode >= 400) {
|
|
50
|
+
const err = new Error(parsed.message || `HTTP ${res.statusCode}`);
|
|
51
|
+
err.status = res.statusCode;
|
|
52
|
+
err.data = parsed;
|
|
53
|
+
reject(err);
|
|
54
|
+
} else {
|
|
55
|
+
resolve(parsed);
|
|
56
|
+
}
|
|
57
|
+
} catch (e) {
|
|
58
|
+
reject(new Error(`Failed to parse API response: ${data.substring(0, 200)}`));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
req.on('error', reject);
|
|
64
|
+
if (payload) req.write(payload);
|
|
65
|
+
req.end();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get(path) { return this.request('GET', path); }
|
|
70
|
+
post(path, body) { return this.request('POST', path, body || {}); }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = TolenoClient;
|
package/icon.png
ADDED
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Toleno Network MCP Server
|
|
4
|
+
* Transport: stdio (Claude Desktop & Claude Code compatible)
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx @toleno/mcp
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ── CLI routing: "npx @toleno/mcp setup" → auto-install to Claude Desktop ────
|
|
12
|
+
const cliCommand = process.argv[2];
|
|
13
|
+
if (cliCommand === 'setup' || cliCommand === 'install') {
|
|
14
|
+
const { setup } = require('./setup');
|
|
15
|
+
setup().catch(err => {
|
|
16
|
+
console.error(`Fatal error: ${err.message}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
23
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
24
|
+
const {
|
|
25
|
+
CallToolRequestSchema,
|
|
26
|
+
ListToolsRequestSchema
|
|
27
|
+
} = require('@modelcontextprotocol/sdk/types.js');
|
|
28
|
+
|
|
29
|
+
const TolenoClient = require('./client');
|
|
30
|
+
const TolenoPublicClient = require('./client-public');
|
|
31
|
+
|
|
32
|
+
const statsTools = require('./tools/stats');
|
|
33
|
+
const miningTools = require('./tools/mining');
|
|
34
|
+
const walletTools = require('./tools/wallet');
|
|
35
|
+
const profileTools = require('./tools/profile');
|
|
36
|
+
const referralTools = require('./tools/referral');
|
|
37
|
+
const infoTools = require('./tools/info');
|
|
38
|
+
|
|
39
|
+
// Tools that work without an API key
|
|
40
|
+
const PUBLIC_TOOLS = new Set([
|
|
41
|
+
'get_global_stats', 'get_leaderboard',
|
|
42
|
+
'get_project_info', 'get_tokenomics', 'get_roadmap', 'get_security_info', 'get_faq'
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
async function main() {
|
|
46
|
+
const apiKey = process.env.TOLENO_API_KEY;
|
|
47
|
+
|
|
48
|
+
const authClient = apiKey ? new TolenoClient(apiKey) : null;
|
|
49
|
+
const publicClient = new TolenoPublicClient();
|
|
50
|
+
|
|
51
|
+
const server = new Server(
|
|
52
|
+
{ name: 'Toleno Network', version: '1.0.0' },
|
|
53
|
+
{ capabilities: { tools: {} } }
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const allTools = [
|
|
57
|
+
...statsTools.definitions,
|
|
58
|
+
...miningTools.definitions,
|
|
59
|
+
...walletTools.definitions,
|
|
60
|
+
...profileTools.definitions,
|
|
61
|
+
...referralTools.definitions,
|
|
62
|
+
...infoTools.definitions
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const allHandlers = {
|
|
66
|
+
...statsTools.handlers,
|
|
67
|
+
...miningTools.handlers,
|
|
68
|
+
...walletTools.handlers,
|
|
69
|
+
...profileTools.handlers,
|
|
70
|
+
...referralTools.handlers,
|
|
71
|
+
...infoTools.handlers
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
75
|
+
return { tools: allTools };
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
79
|
+
const { name, arguments: args } = request.params;
|
|
80
|
+
|
|
81
|
+
if (!PUBLIC_TOOLS.has(name) && !authClient) {
|
|
82
|
+
return {
|
|
83
|
+
content: [{
|
|
84
|
+
type: 'text',
|
|
85
|
+
text: JSON.stringify({
|
|
86
|
+
success: false,
|
|
87
|
+
error: 'TOLENO_API_KEY is not configured. Go to Toleno App → Settings → API Keys → Create New Key, then add it to your MCP config.'
|
|
88
|
+
}, null, 2)
|
|
89
|
+
}],
|
|
90
|
+
isError: true
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handler = allHandlers[name];
|
|
95
|
+
if (!handler) {
|
|
96
|
+
return {
|
|
97
|
+
content: [{
|
|
98
|
+
type: 'text',
|
|
99
|
+
text: JSON.stringify({ success: false, error: `Unknown tool: ${name}` }, null, 2)
|
|
100
|
+
}],
|
|
101
|
+
isError: true
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
const client = PUBLIC_TOOLS.has(name) ? publicClient : authClient;
|
|
107
|
+
const result = await handler(client, args || {});
|
|
108
|
+
return {
|
|
109
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
|
|
110
|
+
};
|
|
111
|
+
} catch (error) {
|
|
112
|
+
return {
|
|
113
|
+
content: [{
|
|
114
|
+
type: 'text',
|
|
115
|
+
text: JSON.stringify({
|
|
116
|
+
success: false,
|
|
117
|
+
error: error.message || 'Unknown error',
|
|
118
|
+
status: error.status || 500,
|
|
119
|
+
details: error.data || null
|
|
120
|
+
}, null, 2)
|
|
121
|
+
}],
|
|
122
|
+
isError: true
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const transport = new StdioServerTransport();
|
|
128
|
+
await server.connect(transport);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
main().catch(err => {
|
|
132
|
+
process.stderr.write(`Fatal error: ${err.message}\n`);
|
|
133
|
+
process.exit(1);
|
|
134
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toleno/mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Toleno Network MCP Server — Manage your Toleno account with Claude AI.",
|
|
5
|
+
"mcpName": "io.github.tolenonetwork/mcp_toleno",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"toleno-mcp": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js",
|
|
12
|
+
"setup.js",
|
|
13
|
+
"client.js",
|
|
14
|
+
"client-public.js",
|
|
15
|
+
"tools/",
|
|
16
|
+
"icon.png",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"start": "node index.js"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"mcp",
|
|
24
|
+
"toleno",
|
|
25
|
+
"claude",
|
|
26
|
+
"ai",
|
|
27
|
+
"mining",
|
|
28
|
+
"crypto",
|
|
29
|
+
"model-context-protocol"
|
|
30
|
+
],
|
|
31
|
+
"author": "Toleno Network",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18.0.0"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/tolenonetwork/toleno-mcp"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://tolenocoin.com"
|
|
44
|
+
}
|
package/setup.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Toleno MCP — Auto Setup for Claude Desktop
|
|
4
|
+
*
|
|
5
|
+
* Finds the Claude Desktop config file, adds the Toleno MCP server entry,
|
|
6
|
+
* and writes it back. No manual JSON editing needed.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const readline = require('readline');
|
|
13
|
+
const https = require('https');
|
|
14
|
+
|
|
15
|
+
// ── Config file paths per OS ─────────────────────────────────────────────────
|
|
16
|
+
function getConfigPath() {
|
|
17
|
+
const platform = process.platform;
|
|
18
|
+
const home = process.env.HOME || process.env.USERPROFILE || '';
|
|
19
|
+
|
|
20
|
+
if (platform === 'win32') {
|
|
21
|
+
const appData = process.env.APPDATA || path.join(home, 'AppData', 'Roaming');
|
|
22
|
+
return path.join(appData, 'Claude', 'claude_desktop_config.json');
|
|
23
|
+
}
|
|
24
|
+
if (platform === 'darwin') {
|
|
25
|
+
return path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
26
|
+
}
|
|
27
|
+
// Linux
|
|
28
|
+
const configDir = process.env.XDG_CONFIG_HOME || path.join(home, '.config');
|
|
29
|
+
return path.join(configDir, 'Claude', 'claude_desktop_config.json');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ── API key validation ───────────────────────────────────────────────────────
|
|
33
|
+
function validateApiKey(apiKey) {
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
const options = {
|
|
36
|
+
hostname: 'api.tolenocoin.com',
|
|
37
|
+
path: '/api/auth/profile',
|
|
38
|
+
method: 'GET',
|
|
39
|
+
headers: {
|
|
40
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
41
|
+
'Content-Type': 'application/json'
|
|
42
|
+
},
|
|
43
|
+
timeout: 10000
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const req = https.request(options, (res) => {
|
|
47
|
+
resolve(res.statusCode === 200);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
req.on('error', () => resolve(false));
|
|
51
|
+
req.on('timeout', () => { req.destroy(); resolve(false); });
|
|
52
|
+
req.end();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ── Interactive prompt ───────────────────────────────────────────────────────
|
|
57
|
+
function ask(question) {
|
|
58
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
59
|
+
return new Promise((resolve) => {
|
|
60
|
+
rl.question(question, (answer) => {
|
|
61
|
+
rl.close();
|
|
62
|
+
resolve(answer.trim());
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ── Main setup ───────────────────────────────────────────────────────────────
|
|
68
|
+
async function setup() {
|
|
69
|
+
console.log('');
|
|
70
|
+
console.log(' ╔══════════════════════════════════════╗');
|
|
71
|
+
console.log(' ║ Toleno × Claude — Auto Setup ║');
|
|
72
|
+
console.log(' ╚══════════════════════════════════════╝');
|
|
73
|
+
console.log('');
|
|
74
|
+
|
|
75
|
+
// 1) Get API key
|
|
76
|
+
const args = process.argv.slice(2);
|
|
77
|
+
const keyIdx = args.indexOf('--key');
|
|
78
|
+
let apiKey = keyIdx >= 0 ? (args[keyIdx + 1] || '') : '';
|
|
79
|
+
|
|
80
|
+
if (!apiKey) {
|
|
81
|
+
console.log(' You need a Toleno API key to connect Claude to your account.');
|
|
82
|
+
console.log(' Get one: Toleno App → Settings → API Keys → Create New Key');
|
|
83
|
+
console.log('');
|
|
84
|
+
apiKey = await ask(' Enter your API key (tlno_...): ');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!apiKey.startsWith('tlno_')) {
|
|
88
|
+
console.error('\n ✗ Invalid key — must start with "tlno_"');
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 2) Validate key
|
|
93
|
+
process.stdout.write(' Validating API key... ');
|
|
94
|
+
const valid = await validateApiKey(apiKey);
|
|
95
|
+
if (!valid) {
|
|
96
|
+
console.log('✗');
|
|
97
|
+
console.error(' Invalid or expired API key. Check your key and try again.');
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
console.log('✓');
|
|
101
|
+
|
|
102
|
+
// 3) Find config file
|
|
103
|
+
const configPath = getConfigPath();
|
|
104
|
+
const configDir = path.dirname(configPath);
|
|
105
|
+
console.log(` Config file: ${configPath}`);
|
|
106
|
+
|
|
107
|
+
// 4) Read existing config or create new
|
|
108
|
+
let config = {};
|
|
109
|
+
if (fs.existsSync(configPath)) {
|
|
110
|
+
try {
|
|
111
|
+
const raw = fs.readFileSync(configPath, 'utf-8');
|
|
112
|
+
config = JSON.parse(raw);
|
|
113
|
+
console.log(' Existing config found — merging...');
|
|
114
|
+
} catch (err) {
|
|
115
|
+
console.error(`\n ✗ Could not parse existing config: ${err.message}`);
|
|
116
|
+
console.error(' Please fix the JSON manually or delete the file and retry.');
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
console.log(' No existing config — creating new...');
|
|
121
|
+
// Ensure directory exists
|
|
122
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 5) Add/update Toleno entry
|
|
126
|
+
if (!config.mcpServers) {
|
|
127
|
+
config.mcpServers = {};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const SERVER_KEY = 'Toleno Network';
|
|
131
|
+
const hadExisting = !!config.mcpServers[SERVER_KEY];
|
|
132
|
+
config.mcpServers[SERVER_KEY] = {
|
|
133
|
+
command: 'npx',
|
|
134
|
+
args: ['-y', '@toleno/mcp'],
|
|
135
|
+
env: {
|
|
136
|
+
TOLENO_API_KEY: apiKey
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// 6) Write config
|
|
141
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
142
|
+
|
|
143
|
+
console.log('');
|
|
144
|
+
console.log(` ✓ ${hadExisting ? 'Updated' : 'Added'} Toleno MCP server to Claude Desktop config`);
|
|
145
|
+
console.log('');
|
|
146
|
+
console.log(' ┌─────────────────────────────────────────┐');
|
|
147
|
+
console.log(' │ Now restart Claude Desktop to connect! │');
|
|
148
|
+
console.log(' │ Look for the 🔨 hammer icon in chat. │');
|
|
149
|
+
console.log(' └─────────────────────────────────────────┘');
|
|
150
|
+
console.log('');
|
|
151
|
+
console.log(' Try asking Claude: "What is my Toleno mining status?"');
|
|
152
|
+
console.log('');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
module.exports = { setup };
|
|
156
|
+
|
|
157
|
+
// Run directly if called as script
|
|
158
|
+
if (require.main === module) {
|
|
159
|
+
setup().catch(err => {
|
|
160
|
+
console.error(`\n Fatal error: ${err.message}`);
|
|
161
|
+
process.exit(1);
|
|
162
|
+
});
|
|
163
|
+
}
|
package/tools/info.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toleno Network — Project Info Tools (public, no API key required)
|
|
3
|
+
*
|
|
4
|
+
* Static project information: about, whitepaper summary, trust & security,
|
|
5
|
+
* tokenomics, roadmap, FAQ etc.
|
|
6
|
+
*
|
|
7
|
+
* All data is in English. The AI model (Claude) will translate and present
|
|
8
|
+
* the information in whatever language the user is speaking.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const PROJECT_INFO = {
|
|
12
|
+
name: 'Toleno Network',
|
|
13
|
+
symbol: 'TOLENO',
|
|
14
|
+
type: 'BEP-20 Token',
|
|
15
|
+
blockchain: 'BNB Smart Chain (BSC)',
|
|
16
|
+
contract_address: 'Not yet deployed — will be published at mainnet launch',
|
|
17
|
+
website: 'https://tolenocoin.com',
|
|
18
|
+
whitepaper: 'https://tolenocoin.com/whitepaper',
|
|
19
|
+
privacy_policy: 'https://tolenocoin.com/privacy',
|
|
20
|
+
support_email: 'support@tolenocoin.com',
|
|
21
|
+
description: 'Toleno Network is a blockchain-based mobile mining platform that allows users to mine TOLENO tokens directly from their mobile devices. No expensive hardware needed — just start a 24-hour mining session from the app and earn tokens.',
|
|
22
|
+
social: {
|
|
23
|
+
twitter: 'https://x.com/tolenonetwork',
|
|
24
|
+
telegram: 'https://t.me/tolenonetwork',
|
|
25
|
+
instagram: 'https://instagram.com/tolenonetwork',
|
|
26
|
+
youtube: 'https://youtube.com/@tolenonetwork',
|
|
27
|
+
tiktok: 'https://tiktok.com/@tolenonetwork'
|
|
28
|
+
},
|
|
29
|
+
app: {
|
|
30
|
+
android: 'https://play.google.com/store/apps/details?id=com.toleno',
|
|
31
|
+
ios: 'Coming soon to App Store'
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const TOKENOMICS = {
|
|
36
|
+
total_supply: '500,000,000 TOLENO',
|
|
37
|
+
distribution: {
|
|
38
|
+
mobile_mining: { percent: '40%', amount: '200,000,000', description: 'Users mine via the mobile app through 24-hour mining sessions' },
|
|
39
|
+
ecosystem_fund: { percent: '20%', amount: '100,000,000', description: 'Platform development, partnerships, and ecosystem growth' },
|
|
40
|
+
team_advisors: { percent: '15%', amount: '75,000,000', description: 'Team and advisors (locked, gradual vesting schedule)' },
|
|
41
|
+
liquidity: { percent: '15%', amount: '75,000,000', description: 'DEX liquidity pools and market making' },
|
|
42
|
+
marketing_community: { percent: '10%', amount: '50,000,000', description: 'Marketing, airdrops, community rewards, and referral bonuses' }
|
|
43
|
+
},
|
|
44
|
+
mining_mechanism: {
|
|
45
|
+
session_duration: '24 hours',
|
|
46
|
+
base_reward: '~28 TOLENO per session',
|
|
47
|
+
mining_power: 'Can be increased through referrals, daily streaks, and premium membership',
|
|
48
|
+
halving: 'Rewards decrease at certain mining milestones (Bitcoin-like halving model)',
|
|
49
|
+
no_battery_drain: 'Mining runs in the background — does not affect phone performance or battery life'
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const ROADMAP = [
|
|
54
|
+
{
|
|
55
|
+
phase: 'Phase 1 — Foundation (Completed)',
|
|
56
|
+
items: [
|
|
57
|
+
'Mobile app development (React Native, iOS & Android)',
|
|
58
|
+
'Mining engine and backend infrastructure',
|
|
59
|
+
'User registration and referral system',
|
|
60
|
+
'API and MCP integration (Claude AI support)',
|
|
61
|
+
'Multi-language support (12 languages)'
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
phase: 'Phase 2 — Growth (In Progress)',
|
|
66
|
+
items: [
|
|
67
|
+
'Community building and marketing campaigns',
|
|
68
|
+
'Premium membership system',
|
|
69
|
+
'Staking mechanism development',
|
|
70
|
+
'Strategic partnerships'
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
phase: 'Phase 3 — Token Launch (Coming Soon)',
|
|
75
|
+
items: [
|
|
76
|
+
'Smart contract deployment on BNB Smart Chain (BSC)',
|
|
77
|
+
'DEX listing (PancakeSwap)',
|
|
78
|
+
'Token claim and withdrawal activation',
|
|
79
|
+
'CoinGecko and CoinMarketCap applications'
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
phase: 'Phase 4 — Expansion',
|
|
84
|
+
items: [
|
|
85
|
+
'CEX (centralized exchange) listing negotiations',
|
|
86
|
+
'NFT integration',
|
|
87
|
+
'DAO governance mechanism',
|
|
88
|
+
'Cross-chain bridge (BSC, Ethereum, Polygon)'
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
const SECURITY_INFO = {
|
|
94
|
+
summary: 'Toleno Network prioritizes user security and transparency at every level.',
|
|
95
|
+
details: [
|
|
96
|
+
'Mobile mining: No real resource consumption — does not drain battery or overheat the phone',
|
|
97
|
+
'API key system: Users create and manage their own API keys with full control',
|
|
98
|
+
'OAuth 2.0 + PKCE: Claude AI integration uses secure OAuth flow',
|
|
99
|
+
'Withdrawal protection: Token withdrawals require additional verification',
|
|
100
|
+
'Rate limiting: All API endpoints are protected with rate limiting',
|
|
101
|
+
'Play Integrity: Android app is verified via Google Play Integrity API',
|
|
102
|
+
'HTTPS only: All communication is encrypted with TLS',
|
|
103
|
+
'Open source MCP: Claude AI integration is open source on npm (@toleno/mcp)'
|
|
104
|
+
],
|
|
105
|
+
trust_indicators: [
|
|
106
|
+
'Working application: Available and downloadable on Google Play Store',
|
|
107
|
+
'Active community: Active on Telegram, Twitter, and other channels',
|
|
108
|
+
'Transparent tokenomics: Distribution plan and halving model are clearly documented',
|
|
109
|
+
'Team is reachable: Contact via support@tolenocoin.com',
|
|
110
|
+
'Claude AI integration: Listed on the Anthropic MCP Registry',
|
|
111
|
+
'NPM package: @toleno/mcp is open source and auditable by anyone'
|
|
112
|
+
],
|
|
113
|
+
upcoming_milestones: [
|
|
114
|
+
'BSC mainnet smart contract deployment is actively being prepared',
|
|
115
|
+
'DEX listing on PancakeSwap is planned as part of the token launch phase',
|
|
116
|
+
'The team is committed to delivering every milestone on the roadmap — early miners will be rewarded the most'
|
|
117
|
+
]
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const FAQ = [
|
|
121
|
+
{
|
|
122
|
+
q: 'What is Toleno Network?',
|
|
123
|
+
a: 'Toleno Network is a blockchain-based platform that lets you mine TOLENO tokens from your mobile device. Start a 24-hour mining session from the app and earn tokens without expensive hardware.'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
q: 'Does mining damage my phone?',
|
|
127
|
+
a: 'No. Toleno mining runs as a lightweight background process. Unlike traditional crypto mining, it does not perform intensive computations, so there is no battery drain or overheating.'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
q: 'When can I withdraw my tokens?',
|
|
131
|
+
a: 'Tokens are currently being accumulated in the app. Withdrawals will be enabled after the smart contract is deployed on BSC and the DEX listing is completed.'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
q: 'Which blockchain network is it on?',
|
|
135
|
+
a: 'TOLENO token will be deployed on BNB Smart Chain (BSC) as a BEP-20 token. Cross-chain bridges to other networks are planned for the future.'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
q: 'Is it free?',
|
|
139
|
+
a: 'Yes, the app is completely free. You do not need to pay anything to start mining. An optional premium membership is available to boost mining power.'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
q: 'How does the referral system work?',
|
|
143
|
+
a: 'Every user has a unique referral code. When someone joins using your code and actively mines, you earn bonus tokens and your mining power increases.'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
q: 'What can I do with Claude AI?',
|
|
147
|
+
a: 'Through Claude AI, you can check your mining status, start sessions, view your balance, and access referral information — all using natural language. To claim rewards, open the Toleno app.'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
q: 'Is Toleno trustworthy?',
|
|
151
|
+
a: 'Absolutely. Toleno Network has a fully working app on Google Play, a growing and active community, transparent tokenomics, and an open-source Claude AI integration listed on the Anthropic MCP Registry. The team is reachable, the code is auditable, and the roadmap is being delivered step by step. Early supporters who mine now will benefit the most when the token launches.'
|
|
152
|
+
}
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
// ─── Tool Definitions ────────────────────────────────────────────────────────
|
|
156
|
+
|
|
157
|
+
const definitions = [
|
|
158
|
+
{
|
|
159
|
+
name: 'get_project_info',
|
|
160
|
+
description: 'Get general information about Toleno Network: what it is, blockchain, token details, website, social links, and app download links. This is a public tool — no API key required.',
|
|
161
|
+
inputSchema: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: {},
|
|
164
|
+
required: []
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'get_tokenomics',
|
|
169
|
+
description: 'Get TOLENO tokenomics: total supply, distribution breakdown (mining, ecosystem, team, liquidity, marketing), mining mechanism details (session duration, rewards, halving model). This is a public tool — no API key required.',
|
|
170
|
+
inputSchema: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
properties: {},
|
|
173
|
+
required: []
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'get_roadmap',
|
|
178
|
+
description: 'Get the Toleno Network development roadmap: completed phases, current progress, and upcoming milestones including BSC deployment and DEX listing. This is a public tool — no API key required.',
|
|
179
|
+
inputSchema: {
|
|
180
|
+
type: 'object',
|
|
181
|
+
properties: {},
|
|
182
|
+
required: []
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'get_security_info',
|
|
187
|
+
description: 'Get Toleno Network security and trust information: security measures, trust indicators, and upcoming milestones. Use this when users ask "is Toleno safe?", "is it trustworthy?", "is it a scam?" etc. This is a public tool — no API key required.',
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: {},
|
|
191
|
+
required: []
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'get_faq',
|
|
196
|
+
description: 'Get frequently asked questions about Toleno Network: what it is, how mining works, token withdrawal, blockchain info, pricing, referral system, Claude AI integration, and trustworthiness. This is a public tool — no API key required.',
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
topic: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
description: 'Optional: filter FAQs by keyword (e.g. "mining", "trust", "token", "referral", "withdraw")'
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
required: []
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
// ─── Handlers ────────────────────────────────────────────────────────────────
|
|
211
|
+
|
|
212
|
+
const handlers = {
|
|
213
|
+
get_project_info: async (_client, _args) => {
|
|
214
|
+
return { success: true, project: PROJECT_INFO };
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
get_tokenomics: async (_client, _args) => {
|
|
218
|
+
return { success: true, tokenomics: TOKENOMICS };
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
get_roadmap: async (_client, _args) => {
|
|
222
|
+
return { success: true, roadmap: ROADMAP };
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
get_security_info: async (_client, _args) => {
|
|
226
|
+
return { success: true, security: SECURITY_INFO };
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
get_faq: async (_client, args) => {
|
|
230
|
+
const topic = (args.topic || '').toLowerCase().trim();
|
|
231
|
+
if (!topic) {
|
|
232
|
+
return { success: true, faq: FAQ };
|
|
233
|
+
}
|
|
234
|
+
const filtered = FAQ.filter(item =>
|
|
235
|
+
item.q.toLowerCase().includes(topic) ||
|
|
236
|
+
item.a.toLowerCase().includes(topic)
|
|
237
|
+
);
|
|
238
|
+
return {
|
|
239
|
+
success: true,
|
|
240
|
+
filter: topic,
|
|
241
|
+
results: filtered.length,
|
|
242
|
+
faq: filtered.length > 0 ? filtered : FAQ
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
module.exports = { definitions, handlers };
|
package/tools/mining.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const definitions = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_mining_status',
|
|
4
|
+
description: 'Get the current mining session status for the authenticated Toleno user. Returns whether a session is active or completed, start/end times, elapsed and remaining time in milliseconds, tokens mined so far, total tokens to be earned, and whether rewards are ready to claim.',
|
|
5
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'start_mining',
|
|
9
|
+
description: 'Start a new 24-hour mining session for the authenticated Toleno user. Only one session can be active at a time. If a session is already active or there are unclaimed rewards, the API will return an error. Returns session start time, end time, and the total tokens that will be earned.',
|
|
10
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const handlers = {
|
|
15
|
+
get_mining_status: async (client, _args) => {
|
|
16
|
+
return await client.get('/mining/status');
|
|
17
|
+
},
|
|
18
|
+
start_mining: async (client, _args) => {
|
|
19
|
+
return await client.post('/mining/start', {});
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
module.exports = { definitions, handlers };
|
package/tools/profile.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const definitions = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_profile',
|
|
4
|
+
description: 'Get the full profile of the authenticated Toleno user. Returns username, display name, email, token balance, total tokens mined, mining power multiplier, referral count, active referral count, wallet address, KYC status, phone verification status, premium subscription status, current daily streak, and account creation date.',
|
|
5
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'daily_summary',
|
|
9
|
+
description: 'Get a comprehensive daily summary for the authenticated Toleno user. Combines profile data and mining status into a single overview: token balance, total mined, mining power, daily streak, referral stats, and current mining session details (active/completed/claimable, tokens mined, remaining time). Perfect for a quick daily check-in.',
|
|
10
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const handlers = {
|
|
15
|
+
get_profile: async (client, _args) => {
|
|
16
|
+
return await client.get('/auth/profile');
|
|
17
|
+
},
|
|
18
|
+
daily_summary: async (client, _args) => {
|
|
19
|
+
const [profile, mining] = await Promise.all([
|
|
20
|
+
client.get('/auth/profile'),
|
|
21
|
+
client.get('/mining/status').catch(() => null)
|
|
22
|
+
]);
|
|
23
|
+
const user = profile.data?.user || profile.user || profile.data || {};
|
|
24
|
+
const mine = mining?.data || mining || {};
|
|
25
|
+
return {
|
|
26
|
+
success: true,
|
|
27
|
+
summary: {
|
|
28
|
+
username: user.username,
|
|
29
|
+
token_balance: user.token_balance,
|
|
30
|
+
total_mined: user.total_mined,
|
|
31
|
+
mining_power: user.mining_power,
|
|
32
|
+
current_streak: user.current_streak,
|
|
33
|
+
referral_count: user.referral_count,
|
|
34
|
+
active_referral_count: user.active_referral_count,
|
|
35
|
+
mining: {
|
|
36
|
+
is_active: mine.is_active || false,
|
|
37
|
+
is_completed: mine.is_completed || false,
|
|
38
|
+
can_claim: mine.can_claim || false,
|
|
39
|
+
tokens_mined: mine.tokens_mined || 0,
|
|
40
|
+
total_tokens: mine.total_tokens || 0,
|
|
41
|
+
remaining_time_ms: mine.remaining_time_ms || 0
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
module.exports = { definitions, handlers };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const definitions = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_referral_info',
|
|
4
|
+
description: 'Get referral program details for the authenticated Toleno user. Returns the referral code (same as username), total number of users referred, number of currently active mining referrals, the referral bonus percentage applied to earnings, and the shareable referral link.',
|
|
5
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'generate_invite_link',
|
|
9
|
+
description: 'Generate a shareable invite link and ready-to-send invite messages (in English and Turkish) for the authenticated Toleno user. Use this when the user wants to invite friends or share their referral link.',
|
|
10
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const handlers = {
|
|
15
|
+
get_referral_info: async (client, _args) => {
|
|
16
|
+
return await client.get('/referral/info');
|
|
17
|
+
},
|
|
18
|
+
generate_invite_link: async (client, _args) => {
|
|
19
|
+
const info = await client.get('/referral/info');
|
|
20
|
+
const code = info.data?.referral_code || info.referral_code;
|
|
21
|
+
return {
|
|
22
|
+
success: true,
|
|
23
|
+
referral_code: code,
|
|
24
|
+
share_message: `Join Toleno Network and mine TOL tokens with AI! Use my referral code "${code}" when you sign up — we both earn bonus mining power.`
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = { definitions, handlers };
|
package/tools/stats.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const definitions = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_global_stats',
|
|
4
|
+
description: 'Get global Toleno Network statistics: total tokens mined across all users and total registered user count. This is a public endpoint — no API key required.',
|
|
5
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'get_leaderboard',
|
|
9
|
+
description: 'Get the TOP 50 leaderboard of Toleno users ranked by token balance. Returns username, display name, token balance, mining power, and rank for each user. This is a public endpoint and requires no API key.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
limit: {
|
|
14
|
+
type: 'number',
|
|
15
|
+
description: 'Number of users to return (default: 10, max: 50)'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
required: []
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const handlers = {
|
|
24
|
+
get_global_stats: async (client, _args) => {
|
|
25
|
+
return await client.get('/stats/global-mined');
|
|
26
|
+
},
|
|
27
|
+
get_leaderboard: async (client, args) => {
|
|
28
|
+
const limit = Math.min(args.limit || 10, 50);
|
|
29
|
+
return await client.get(`/auth/top-users?limit=${limit}`);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = { definitions, handlers };
|
package/tools/wallet.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const definitions = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_wallet_info',
|
|
4
|
+
description: "Get comprehensive wallet information for the authenticated Toleno user. Returns the available (withdrawable) token balance, locked mining balance, total tokens ever mined, the connected wallet address and preferred network (BSC/Polygon), withdrawal statistics (today's total, pending count, completed count), and the minimum/maximum withdrawal amounts.",
|
|
5
|
+
inputSchema: { type: 'object', properties: {}, required: [] }
|
|
6
|
+
}
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
// Note: wallet address update/remove and network change are intentionally excluded.
|
|
10
|
+
// Modifying withdrawal destinations is high-risk — only allowed through the official
|
|
11
|
+
// mobile app with full user confirmation flows.
|
|
12
|
+
|
|
13
|
+
const handlers = {
|
|
14
|
+
get_wallet_info: async (client, _args) => {
|
|
15
|
+
return await client.get('/wallet/info');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
module.exports = { definitions, handlers };
|