返回 MCP 目录
public公开dns本地运行

Edwin MCP 服务器

Edwin MCP 服务器是一个为 Edwin SDK 实现的模型上下文协议(MCP)服务器示例,旨在通过标准化协议使 AI 代理与 Edwin 的工具进行交互。它支持多种区块链操作,如钱包操作、余额查询、交易签名、代币转账和合约交互。服务器需要在 Node.js 环境下运行,并依赖 Claude 实例或 API,以及 EVM 或 Solana 钱包私钥。安装和配置过程包括克隆仓库、安装依赖、构建项目以及设置环境变量。服务器可以在本地开发环境中运行,也可以与 Claude Desktop 集成使用。安全方面,强调了私钥保护和生产环境的安全设置。

article

README

Edwin MCP Server

This is an example implementation of a Model Context Protocol (MCP) server for the Edwin SDK. It allows AI agents to interact with Edwin's tools through a standardized protocol.

Prerequisites

  • Node.js >= 18.0.0
  • pnpm (recommended) or npm
  • A local Claude instance or access to Claude API
  • EVM and/or Solana wallet private keys (depending on your needs)

Installation

  1. Clone the repository and navigate to the mcp-server directory:
cd examples/mcp-server
  1. Install dependencies:
pnpm install
  1. Build the project:
pnpm build

Running the Server

Option 1: Local Development

  1. Create your environment file:
cp .env.example .env
  1. Configure your .env file with the following required settings:

    • SOLANA_RPC_URL: Your RPC endpoint
    • EVM_PRIVATE_KEY: Your EVM wallet private key
    • SOLANA_PRIVATE_KEY: Your Solana wallet private key
    • EDWIN_MCP_MODE=true: Enable MCP mode
  2. Start the server:

    • For production: pnpm start
    • For development with hot reloading: pnpm dev

Option 2: Using with Claude Desktop

  1. After building the project, use the provided claude_desktop_config.json to configure your Claude Desktop:

    • Open Claude Desktop
    • Go to Settings
    • Import the configuration from claude_desktop_config.json
  2. The server will automatically start when needed by Claude Desktop.

Available Tools

The server exposes all tools configured in your Edwin instance. Common tools include:

  • Wallet operations
  • Balance checking
  • Transaction signing
  • Token transfers
  • Contract interactions

Security Considerations

  1. Never commit your .env file with private keys
  2. Use appropriate CORS settings in production
  3. Implement rate limiting for production use
  4. Keep your private keys secure and never share them

Troubleshooting

  1. Server won't start:

    • Check if the port is already in use
    • Verify your environment variables are set correctly
    • Check the logs for specific error messages
  2. Tools not available:

    • Ensure your Edwin instance is properly configured
    • Check if the tools are properly registered
    • Verify your wallet keys are correct
  3. Connection issues:

    • Check if the server is running
    • Verify the port is correct
    • Check network connectivity

Contributing

Feel free to submit issues and enhancement requests!

License

This project is licensed under the same terms as the main Edwin SDK.

help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端