Token导航 LogoToken导航TokenDH.com
MCP Nexus Server logo
AI代理未说明官方级别未说明来源级核验

MCP Nexus Server

MCP Server

Nexus MCP服务器是一个桥接服务,使AI代理能够通过模型上下文协议(MCP)直接与Nexus区块链交互,提供查询、智能合约调用和交易管理等功能。

工具数

0

提示词数

0

GitHub Stars

6

资源数

0
TypeScriptClaudeAI代理Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

nexus-xyz

提供方

nexus-xyz

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Nexus MCP服务器

Enabling AI Agents to Interact with the Nexus Blockchain

概述

Nexus MCP服务器是一个桥梁,使AI代理能够使用模型上下文协议(MCP)直接与Nexus区块链交互。它将区块链功能作为MCP工具公开,任何兼容MCP的AI系统都可以访问,包括Claude和其他领先的LLM。

👉 阅读完整的博客文章 了解Nexus如何为人工智能时代构建区块链,从MCP集成开始。

特性

  • 查询区块链数据:获取区块、交易、账户余额等
  • 智能合约交互:进行只读合约调用以查询链数据
  • 事务管理:将已签名的交易提交到网络
  • 事件监控:通过日志跟踪和过滤区块链事件
  • 易于AI集成:与任何启用MCP的AI系统兼容

可用工具

工具名称描述参数
getNetworkInfo获取Nexus区块链网络信息
getBalance获取地址余额address:string
getTransaction通过哈希获取交易详细信息txHash:string
getBlock按编号获取区块详细信息blockNumber:字符串, fullTransactions:boolean(可选)
callContract调用智能合约方法(只读)to:字符串, data:string
getLogs从区块链获取事件日志filterObject:对象
sendRawTransaction向网络提交已签名的交易signedTx:string

快速开始

安装

# Clone the repository
git clone https://github.com/nexus/mcp-for-nexus
cd mcp-for-nexus

# Install dependencies
npm install

# Configure environment
cp .env.example .env

# Start the server
npm run dev

与客户进行测试

服务器运行后,您可以使用附带的测试客户端连接到它:

# Using the test client (requires Redis for SSE transport)
node scripts/test-nexus-client.mjs http://localhost:3000

对于本地开发,请确保Redis已安装并正在运行:

# Install Redis (macOS)
brew install redis

# Start Redis
brew services start redis

# Verify Redis is running
redis-cli ping  # Should respond with "PONG"

客户端使用示例

// Example of calling blockchain tools from your application
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

const transport = new SSEClientTransport(new URL(`http://localhost:3000/sse`));

const client = new Client(
  { name: "my-app", version: "1.0.0" },
  { capabilities: { prompts: {}, resources: {}, tools: {} } }
);

await client.connect(transport);

// Get blockchain info
const networkInfo = await client.callTool({
  name: "getNetworkInfo",
  arguments: {}
});

// Query an account balance
const balance = await client.callTool({
  name: "getBalance",
  arguments: { address: "0x1234567890abcdef1234567890abcdef12345678" }
});

// Get block information
const blockData = await client.callTool({
  name: "getBlock", 
  arguments: {
    blockNumber: "latest",
    fullTransactions: true
  }
});

与AI系统集成

Claude集成示例

// Example of integrating with Claude
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
import Anthropic from "@anthropic-ai/sdk";

// Setup MCP client
const mcpClient = new Client(...);
await mcpClient.connect(transport);

// Get available tools
const tools = await mcpClient.listTools();
const toolDefinitions = tools.map(tool => ({
  name: tool.name,
  description: tool.description,
  input_schema: tool.inputSchema
}));

// Setup Claude client
const anthropic = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
});

// Create message with tools
const message = await anthropic.messages.create({
  model: "claude-3-5-sonnet-20241022",
  max_tokens: 1000,
  messages: [{ role: "user", content: "What's the latest block on Nexus?" }],
  tools: toolDefinitions
});

// Handle tool calls from Claude
for (const content of message.content) {
  if (content.type === 'tool_use') {
    const result = await mcpClient.callTool({
      name: content.name,
      arguments: content.input
    });
    
    // Send tool result back to Claude
    // ...
  }
}

部署选项

地方发展

服务器可以在本地运行用于开发目的,这对于测试与Nexus区块链集成的AI开发人员来说是理想的。

Vercel上的生产部署

对于生产使用,服务器可以部署在Vercel上:

  1. 配置Redis(SSE传输所需):

- 从Vercel仪表板添加Redis集成,或 - 集 REDIS_URL 托管Redis实例的环境变量

  1. 启用流体计算以实现更长时间的运行操作

贡献

我们欢迎为改进Nexus MCP服务器做出贡献!请查看我们的 贡献指南 了解更多信息。

许可证

该项目根据 MIT许可证.

连接Nexus

目录标签

目录标签

TypeScriptClaudeAI代理区块链交互本地部署智能合约交易管理事件监控

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP