uniderp-mcp
Version:
> A plug-and-play MCP tool server to **send ETH**, **transfer ERC-20 tokens**, **deploy tokens**, and **interact with smart contracts** on the **UNICHAIN** — built for **Claude Desktop**, **AI agents**, and **developers.**
48 lines (47 loc) • 1.76 kB
JavaScript
import { GoPlus, ErrorCode } from "@goplus/sdk-node";
import { z } from "zod";
import { supportedChain } from "../chains/index.js";
export function registerGoplusSecurityCheck(server) {
server.tool("Token_Security_Check", "🔒Analyze UNICHAIN Network tokens for potential security risks powered by GoPlus", {
tokenAddress: z.string(),
}, async ({ tokenAddress }) => {
try {
const chainId = supportedChain.id.toString();
const addresses = [tokenAddress];
// Call GoPlus API to check token security
let res = await GoPlus.tokenSecurity(chainId, addresses, 30);
if (res.code !== ErrorCode.SUCCESS) {
return {
content: [
{
type: "text",
text: `Security check failed: ${res.message}`,
},
],
isError: true,
};
}
const securityData = res.result[tokenAddress] || {};
return {
content: [
{
type: "text",
text: `Security check successful for ${tokenAddress}: ${JSON.stringify(securityData, null, 2)}`,
},
],
};
}
catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
return {
content: [
{
type: "text",
text: `Security check failed: ${errorMessage}`,
},
],
isError: true,
};
}
});
}