@bankofai/mcp-server-tron 1.1.5 → 1.1.7-beta
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 +31 -4
- package/build/core/services/agent-wallet.d.ts +2 -2
- package/build/core/services/agent-wallet.js +23 -4
- package/build/core/services/agent-wallet.js.map +1 -1
- package/build/server/http-app.d.ts +9 -0
- package/build/server/http-app.js +69 -0
- package/build/server/http-app.js.map +1 -0
- package/build/server/http-server.js +12 -174
- package/build/server/http-server.js.map +1 -1
- package/build/server/server.js +1 -1
- package/build/server/server.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ export TRON_MNEMONIC="<WORD1> <WORD2> ... <WORD12>"
|
|
|
165
165
|
export TRON_ACCOUNT_INDEX="0" # Optional, default: 0
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
> **Security Note**: Static modes
|
|
168
|
+
> **Security Note**: Static modes expose keys in plaintext. **Only keep small amounts of funds** in these wallets — large balances carry a real **risk of theft**. Use Agent-Wallet Mode (Option 1) for any significant funds.
|
|
169
169
|
|
|
170
170
|
> See [`.env.example`](.env.example) for a complete list of all supported environment variables.
|
|
171
171
|
|
|
@@ -184,10 +184,36 @@ npm start
|
|
|
184
184
|
# Start in readonly mode (disables write tools)
|
|
185
185
|
npm start -- --readonly
|
|
186
186
|
|
|
187
|
-
# Start in HTTP mode (Streamable HTTP)
|
|
187
|
+
# Start in stateless HTTP mode (Streamable HTTP)
|
|
188
188
|
npm run start:http
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
+
### Docker
|
|
192
|
+
|
|
193
|
+
Build the image:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
docker build -t mcp-server-tron:test .
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Run the container with local logs mounted:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
docker run -d \
|
|
203
|
+
--name mcp-tron \
|
|
204
|
+
-p 3001:3001 \
|
|
205
|
+
-e MCP_HOST=0.0.0.0 \
|
|
206
|
+
-e MCP_PORT=3001 \
|
|
207
|
+
-e MCP_LOG_DIR=/app/logs \
|
|
208
|
+
-v "$(pwd)/logs:/app/logs" \
|
|
209
|
+
mcp-server-tron:test
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Docker logs are written to the mounted `logs/` directory and are named by date, for example:
|
|
213
|
+
|
|
214
|
+
- `logs/mcp-server-tron-2026-03-18-combined.log`
|
|
215
|
+
- `logs/mcp-server-tron-2026-03-18-error.log`
|
|
216
|
+
|
|
191
217
|
### Testing
|
|
192
218
|
|
|
193
219
|
The project includes a comprehensive test suite with unit tests and integration tests (using the Nile testnet).
|
|
@@ -248,7 +274,7 @@ claude mcp add -e AGENT_WALLET_PASSWORD=xxx -e TRONGRID_API_KEY=xxx mcp-server-t
|
|
|
248
274
|
|
|
249
275
|
#### Option B: Official Hosted Server (Remote)
|
|
250
276
|
|
|
251
|
-
Connect to the official hosted server at `https://tron-mcp-server.bankofai.io`. No installation required, readonly mode.
|
|
277
|
+
Connect to the official hosted server at `https://tron-mcp-server.bankofai.io`. No installation required, readonly mode, stateless HTTP.
|
|
252
278
|
|
|
253
279
|
**Claude Code:**
|
|
254
280
|
|
|
@@ -471,7 +497,8 @@ claude mcp add -transport http mcp-server-tron https://tron-mcp-server.bankofai.
|
|
|
471
497
|
## Security Considerations
|
|
472
498
|
|
|
473
499
|
- **Private Keys & Mnemonics**: **NEVER** save your sensitive wallet information in plain text configuration files (like `mcp.json`). These files are often unencrypted and can be accidentally shared or committed to git. Use system environment variables which are more secure.
|
|
474
|
-
- **
|
|
500
|
+
- **Fund Safety (Static Mode)**: If you use `TRON_PRIVATE_KEY` or `TRON_MNEMONIC`, keys are stored in plaintext environment variables. This carries a **real risk of fund theft** — environment variables can be leaked via shell history, process listings, or log files. **Only keep a small amount of funds** in these wallets. For wallets holding any significant value, always use [Agent-Wallet Mode](#option-1-agent-wallet-mode-recommended).
|
|
501
|
+
- **Shared Machines**: Be aware that on shared systems, environment variables might be visible to other users via `/proc` or system monitoring tools.
|
|
475
502
|
- **Testnets**: Always test on Nile or Shasta before performing operations on Mainnet.
|
|
476
503
|
- **Approvals**: Be cautious when approving token allowances via `write_contract`. Only approve what is necessary.
|
|
477
504
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* - **Encrypted Storage mode**: Keys encrypted at rest (password-protected).
|
|
7
7
|
* - **Static/Env mode**: Keys provided via environment variables.
|
|
8
8
|
*/
|
|
9
|
-
import { type
|
|
9
|
+
import { type Wallet } from "@bankofai/agent-wallet";
|
|
10
10
|
/**
|
|
11
11
|
* Get the currently active agent-wallet.
|
|
12
12
|
*/
|
|
13
|
-
export declare function getActiveWallet(): Promise<
|
|
13
|
+
export declare function getActiveWallet(): Promise<Wallet>;
|
|
14
14
|
/**
|
|
15
15
|
* Get the address of the active wallet.
|
|
16
16
|
*/
|
|
@@ -71,8 +71,12 @@ export async function getOwnerAddress() {
|
|
|
71
71
|
if (activeAddress)
|
|
72
72
|
return activeAddress;
|
|
73
73
|
const wallet = await getActiveWallet();
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const address = await wallet.getAddress();
|
|
75
|
+
if (address == null) {
|
|
76
|
+
throw new Error("Failed to resolve active wallet address");
|
|
77
|
+
}
|
|
78
|
+
activeAddress = address;
|
|
79
|
+
return address;
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* Switch the active wallet at runtime (Encrypted Storage mode only).
|
|
@@ -101,12 +105,27 @@ export async function listAgentWallets() {
|
|
|
101
105
|
return [];
|
|
102
106
|
if (typeof p.listWallets === "function") {
|
|
103
107
|
const lp = p;
|
|
108
|
+
// agent-wallet@2.3+: listWallets(): Array<[walletId, walletConfig, isActive]>
|
|
109
|
+
// agent-wallet@2.2 (and tests) may return Promise<Array<{id,type,...}>>.
|
|
104
110
|
const wallets = await lp.listWallets();
|
|
105
111
|
const result = [];
|
|
106
112
|
for (const w of wallets) {
|
|
107
|
-
|
|
113
|
+
let walletId;
|
|
114
|
+
let walletType;
|
|
115
|
+
if (Array.isArray(w)) {
|
|
116
|
+
walletId = w[0];
|
|
117
|
+
walletType = (w[1]?.type ?? "unknown");
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
walletId = w.id ?? "";
|
|
121
|
+
walletType = (w.type ?? "unknown");
|
|
122
|
+
}
|
|
123
|
+
if (!walletId) {
|
|
124
|
+
throw new Error("Invalid wallet id returned by agent-wallet provider");
|
|
125
|
+
}
|
|
126
|
+
const wallet = await lp.getWallet(walletId);
|
|
108
127
|
const address = await wallet.getAddress();
|
|
109
|
-
result.push({ id:
|
|
128
|
+
result.push({ id: walletId, type: walletType, address });
|
|
110
129
|
}
|
|
111
130
|
return result;
|
|
112
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-wallet.js","sourceRoot":"","sources":["../../../src/core/services/agent-wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAE9E,IAAI,QAAQ,GAA0B,IAAI,CAAC;AAC3C,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"agent-wallet.js","sourceRoot":"","sources":["../../../src/core/services/agent-wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAE9E,IAAI,QAAQ,GAA0B,IAAI,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AE,OAAO,CAAC,OAAO,CAAC,MAAM;QAC/B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,OAAO,EACL,0GAA0G;KAC7G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
3
|
+
import startServer, { MCP_PROTOCOL_VERSION, version } from "./server.js";
|
|
4
|
+
export function createHttpApp(options = {}) {
|
|
5
|
+
const app = express();
|
|
6
|
+
app.use(express.json({ limit: "10mb" })); // Prevent DoS attacks with huge payloads
|
|
7
|
+
app.post("/mcp", async (req, res) => {
|
|
8
|
+
console.log(`Received POST /mcp request from ${req.ip}`);
|
|
9
|
+
let server;
|
|
10
|
+
const transport = new StreamableHTTPServerTransport({
|
|
11
|
+
sessionIdGenerator: undefined,
|
|
12
|
+
});
|
|
13
|
+
try {
|
|
14
|
+
server = await startServer({ readOnly: options.readOnly });
|
|
15
|
+
await server.connect(transport);
|
|
16
|
+
await transport.handleRequest(req, res, req.body);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
console.error(`Error handling request: ${error}`);
|
|
20
|
+
if (!res.headersSent) {
|
|
21
|
+
res.status(500).json({ error: "Internal server error" });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
if (server) {
|
|
26
|
+
await server.close().catch((closeError) => {
|
|
27
|
+
console.error(`Error closing stateless server: ${closeError}`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
app.get("/mcp", async (_req, res) => {
|
|
33
|
+
res.setHeader("Allow", "POST");
|
|
34
|
+
res.status(405).json({ error: "GET not supported for stateless Streamable HTTP" });
|
|
35
|
+
});
|
|
36
|
+
app.delete("/mcp", async (_req, res) => {
|
|
37
|
+
res.setHeader("Allow", "POST");
|
|
38
|
+
res.status(405).json({ error: "DELETE not supported for stateless Streamable HTTP" });
|
|
39
|
+
});
|
|
40
|
+
app.get("/health", (_req, res) => {
|
|
41
|
+
res.status(200).json({
|
|
42
|
+
status: "ok",
|
|
43
|
+
server: "ready",
|
|
44
|
+
mode: "stateless",
|
|
45
|
+
activeSessions: 0,
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
app.get("/", (_req, res) => {
|
|
49
|
+
res.status(200).json({
|
|
50
|
+
name: "mcp-server-tron",
|
|
51
|
+
version,
|
|
52
|
+
protocol: `MCP ${MCP_PROTOCOL_VERSION}`,
|
|
53
|
+
transport: "Streamable HTTP",
|
|
54
|
+
mode: "stateless",
|
|
55
|
+
endpoints: {
|
|
56
|
+
mcp: "/mcp",
|
|
57
|
+
health: "/health",
|
|
58
|
+
},
|
|
59
|
+
status: "ready",
|
|
60
|
+
activeSessions: 0,
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
app,
|
|
65
|
+
shutdown: async () => { },
|
|
66
|
+
getActiveSessionCount: () => 0,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=http-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-app.js","sourceRoot":"","sources":["../../src/server/http-app.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,WAAW,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAQzE,MAAM,UAAU,aAAa,CAAC,UAAkC,EAAE;IAChE,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IACtB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAEnF,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,E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{
|
|
3
|
-
import startServer, { MCP_PROTOCOL_VERSION, version } from "./server.js";
|
|
4
|
-
import express from "express";
|
|
1
|
+
import { createHttpApp } from "./http-app.js";
|
|
2
|
+
import { MCP_PROTOCOL_VERSION } from "./server.js";
|
|
5
3
|
// Environment variables
|
|
6
4
|
const PORT = parseInt(process.env.MCP_PORT || "3001", 10);
|
|
7
5
|
const HOST = process.env.MCP_HOST || "0.0.0.0";
|
|
8
|
-
console.
|
|
9
|
-
// Setup Express
|
|
10
|
-
const app = express();
|
|
11
|
-
app.use(express.json({ limit: "10mb" })); // Prevent DoS attacks with huge payloads
|
|
12
|
-
// Track active transports by session ID with cleanup
|
|
13
|
-
const transports = new Map();
|
|
14
|
-
const sessionTimestamps = new Map();
|
|
15
|
-
const SESSION_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes
|
|
16
|
-
// Cleanup stale sessions periodically
|
|
17
|
-
setInterval(() => {
|
|
18
|
-
const now = Date.now();
|
|
19
|
-
for (const [sessionId, timestamp] of sessionTimestamps.entries()) {
|
|
20
|
-
if (now - timestamp > SESSION_TIMEOUT_MS) {
|
|
21
|
-
console.error(`Cleaning up stale session: ${sessionId}`);
|
|
22
|
-
const transport = transports.get(sessionId);
|
|
23
|
-
if (transport) {
|
|
24
|
-
transport
|
|
25
|
-
.close()
|
|
26
|
-
.catch((err) => console.error(`Error closing stale session ${sessionId}:`, err));
|
|
27
|
-
}
|
|
28
|
-
transports.delete(sessionId);
|
|
29
|
-
sessionTimestamps.delete(sessionId);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}, 5 * 60 * 1000); // Check every 5 minutes
|
|
33
|
-
// Initialize the MCP server
|
|
34
|
-
let server = null;
|
|
6
|
+
console.log(`Configured to listen on ${HOST}:${PORT}`);
|
|
35
7
|
const isReadOnly = process.argv.includes("--readonly") || process.argv.includes("-r");
|
|
36
|
-
|
|
37
|
-
.then((s) => {
|
|
38
|
-
server = s;
|
|
39
|
-
console.error(`MCP Server initialized successfully${isReadOnly ? " in readonly mode" : ""}`);
|
|
40
|
-
})
|
|
41
|
-
.catch((error) => {
|
|
42
|
-
console.error("Failed to initialize server:", error);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
});
|
|
45
|
-
// Handle all MCP requests through POST /mcp
|
|
46
|
-
app.post("/mcp", async (req, res) => {
|
|
47
|
-
console.error(`Received POST /mcp request from ${req.ip}`);
|
|
48
|
-
if (!server) {
|
|
49
|
-
console.error("Server not initialized yet");
|
|
50
|
-
res.status(503).json({ error: "Server not initialized" });
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// Check for existing session
|
|
54
|
-
const sessionId = req.headers["mcp-session-id"];
|
|
55
|
-
let transport;
|
|
56
|
-
if (sessionId && transports.has(sessionId)) {
|
|
57
|
-
// Reuse existing transport for this session
|
|
58
|
-
transport = transports.get(sessionId);
|
|
59
|
-
sessionTimestamps.set(sessionId, Date.now()); // Update last activity
|
|
60
|
-
console.error(`Reusing transport for session: ${sessionId}`);
|
|
61
|
-
}
|
|
62
|
-
else if (!sessionId) {
|
|
63
|
-
// New session - create transport with session ID generator
|
|
64
|
-
transport = new StreamableHTTPServerTransport({
|
|
65
|
-
sessionIdGenerator: () => randomUUID(),
|
|
66
|
-
onsessioninitialized: (newSessionId) => {
|
|
67
|
-
console.error(`Session initialized: ${newSessionId}`);
|
|
68
|
-
transports.set(newSessionId, transport);
|
|
69
|
-
sessionTimestamps.set(newSessionId, Date.now());
|
|
70
|
-
},
|
|
71
|
-
onsessionclosed: (closedSessionId) => {
|
|
72
|
-
console.error(`Session closed: ${closedSessionId}`);
|
|
73
|
-
transports.delete(closedSessionId);
|
|
74
|
-
sessionTimestamps.delete(closedSessionId);
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
// Connect the transport to the server
|
|
78
|
-
await server.connect(transport);
|
|
79
|
-
console.error("New transport connected to server");
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
// Invalid session ID provided
|
|
83
|
-
console.error(`Invalid session ID: ${sessionId}`);
|
|
84
|
-
res.status(404).json({ error: "Session not found" });
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
// Handle the request
|
|
88
|
-
try {
|
|
89
|
-
await transport.handleRequest(req, res, req.body);
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
console.error(`Error handling request: ${error}`);
|
|
93
|
-
if (!res.headersSent) {
|
|
94
|
-
res.status(500).json({ error: "Internal server error" });
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
// Handle GET requests for SSE streams (server-to-client notifications)
|
|
99
|
-
app.get("/mcp", async (req, res) => {
|
|
100
|
-
console.error(`Received GET /mcp request from ${req.ip}`);
|
|
101
|
-
if (!server) {
|
|
102
|
-
res.status(503).json({ error: "Server not initialized" });
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const sessionId = req.headers["mcp-session-id"];
|
|
106
|
-
if (!sessionId || !transports.has(sessionId)) {
|
|
107
|
-
res.status(400).json({ error: "Invalid or missing session ID" });
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const transport = transports.get(sessionId);
|
|
111
|
-
try {
|
|
112
|
-
await transport.handleRequest(req, res);
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
console.error(`Error handling SSE request: ${error}`);
|
|
116
|
-
if (!res.headersSent) {
|
|
117
|
-
res.status(500).json({ error: "Internal server error" });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
// Handle DELETE requests to close sessions
|
|
122
|
-
app.delete("/mcp", async (req, res) => {
|
|
123
|
-
const sessionId = req.headers["mcp-session-id"];
|
|
124
|
-
if (!sessionId || !transports.has(sessionId)) {
|
|
125
|
-
res.status(404).json({ error: "Session not found" });
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const transport = transports.get(sessionId);
|
|
129
|
-
try {
|
|
130
|
-
await transport.handleRequest(req, res);
|
|
131
|
-
}
|
|
132
|
-
catch (error) {
|
|
133
|
-
console.error(`Error closing session: ${error}`);
|
|
134
|
-
if (!res.headersSent) {
|
|
135
|
-
res.status(500).json({ error: "Internal server error" });
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
// Health check endpoint
|
|
140
|
-
app.get("/health", (_req, res) => {
|
|
141
|
-
res.status(200).json({
|
|
142
|
-
status: "ok",
|
|
143
|
-
server: server ? "initialized" : "initializing",
|
|
144
|
-
activeSessions: transports.size,
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
// Root endpoint for basic info
|
|
148
|
-
app.get("/", (_req, res) => {
|
|
149
|
-
res.status(200).json({
|
|
150
|
-
name: "mcp-server-tron",
|
|
151
|
-
version,
|
|
152
|
-
protocol: `MCP ${MCP_PROTOCOL_VERSION}`,
|
|
153
|
-
transport: "Streamable HTTP",
|
|
154
|
-
endpoints: {
|
|
155
|
-
mcp: "/mcp",
|
|
156
|
-
health: "/health",
|
|
157
|
-
},
|
|
158
|
-
status: server ? "ready" : "initializing",
|
|
159
|
-
activeSessions: transports.size,
|
|
160
|
-
});
|
|
161
|
-
});
|
|
8
|
+
const { app, shutdown } = createHttpApp({ readOnly: isReadOnly });
|
|
162
9
|
// Handle process termination gracefully
|
|
163
10
|
process.on("SIGINT", async () => {
|
|
164
|
-
console.
|
|
165
|
-
|
|
166
|
-
for (const [sessionId, transport] of transports) {
|
|
167
|
-
console.error(`Closing transport for session: ${sessionId}`);
|
|
168
|
-
await transport.close();
|
|
169
|
-
}
|
|
170
|
-
transports.clear();
|
|
11
|
+
console.log("Shutting down server...");
|
|
12
|
+
await shutdown();
|
|
171
13
|
process.exit(0);
|
|
172
14
|
});
|
|
173
15
|
process.on("SIGTERM", async () => {
|
|
174
|
-
console.
|
|
175
|
-
|
|
176
|
-
console.error(`Closing transport for session: ${sessionId}`);
|
|
177
|
-
await transport.close();
|
|
178
|
-
}
|
|
179
|
-
transports.clear();
|
|
16
|
+
console.log("Received SIGTERM, shutting down...");
|
|
17
|
+
await shutdown();
|
|
180
18
|
process.exit(0);
|
|
181
19
|
});
|
|
182
20
|
// Start the HTTP server
|
|
183
21
|
const httpServer = app
|
|
184
22
|
.listen(PORT, HOST, () => {
|
|
185
|
-
console.
|
|
186
|
-
console.
|
|
187
|
-
console.
|
|
188
|
-
console.
|
|
23
|
+
console.log(`mcp-server-tron running at http://${HOST}:${PORT}`);
|
|
24
|
+
console.log(`MCP endpoint: http://${HOST}:${PORT}/mcp`);
|
|
25
|
+
console.log(`Health check: http://${HOST}:${PORT}/health`);
|
|
26
|
+
console.log(`Protocol: MCP ${MCP_PROTOCOL_VERSION} (Streamable HTTP)`);
|
|
189
27
|
})
|
|
190
28
|
.on("error", (err) => {
|
|
191
29
|
console.error(`Server error: ${err}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../../src/server/http-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../../src/server/http-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAwB;AACxB,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;AAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,SAAS,CAAC;AAE/C,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;AAEvD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtF,MAAM,EAAE,GAAG,EA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AC,CAAC,aAAa"}
|
package/build/server/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEzD,wFAAwF;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEjD,kCAAkC;AAClC,KAAK,UAAU,WAAW,CAAC,UAAkC,EAAE;IAC7D,IAAI,CAAC;QACH,qDAAqD;QACrD,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;YACE,IAAI,EAAE,iBAAiB;YACvB,OAAO;SACR,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE;oBACL,WAAW,EAAE,IAAI;iBAClB;gBACD,SAAS,EAAE;oBACT,SAAS,EAAE,KAAK;oBAChB,WAAW,EAAE,IAAI;iBAClB;gBACD,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI;iBAClB;gBACD,OAAO,EAAE,EAAE;aACZ;SACF,CACF,CAAC;QAEF,6CAA6C;QAC7C,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC9B,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,mBAAmB,CAAC,MAAM,EAAE,OA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-
"module": "
|
|
4
|
+
"module": "build/index.js",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.7-beta",
|
|
7
7
|
"description": "MCP server for TRON blockchain. Supports TRX/TRC20 transfers, smart contracts, and AI prompts.",
|
|
8
8
|
"bin": {
|
|
9
9
|
"mcp-server-tron": "./bin/cli.js"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"typescript": "^5.8.2"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@bankofai/agent-wallet": "^2.
|
|
56
|
+
"@bankofai/agent-wallet": "^2.3.0-beta.4",
|
|
57
57
|
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
58
58
|
"@scure/bip32": "^2.0.1",
|
|
59
59
|
"@scure/bip39": "^2.0.1",
|
|
@@ -89,4 +89,4 @@
|
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
}
|
|
92
|
-
}
|
|
92
|
+
}
|