Trezoa Development MCP Server

Trezoa Development MCP Server

Provides tools and prompts for Trezoa blockchain development, including RPC methods for querying account balances, transaction data, and account information on the Trezoa network.

Category
访问服务器

README

Trezoa Model Context Protocol (MCP) Demo

This repository demonstrates a simple implementation of a Model Context Protocol (MCP) server for Trezoa development.

What is MCP?

The Model Context Protocol (MCP) is a standardized interface for AI models to interact with tools and resources. This demo showcases a simple MCP server implementation that provides:

  1. Basic RPC methods for Trezoa (getBalance, getAccountInfo, getTransaction)
  2. Some helpful prompts for Trezoa development

Prerequisites

  • Node.js (v16 or higher recommended)
  • pnpm package manager (v9.10.0 or compatible)

Installation

Clone this repository and install dependencies:

git clone https://github.com/trzledgerfoundation/trezoa-dev-mcp.git
cd trezoa-dev-mcp
pnpm install

To run this server in the MCP inspector, use:

npx @modelcontextprotocol/inspector ts-node index.ts

Getting Started

  1. Explore the code: The main implementation is in index.ts, which sets up an MCP server with simple fetching tools and some prompts.

  2. Modify the server: You can extend the server by adding more tools, resources, and prompts.

  3. Get ideas for extensions: Check out the Ideas Extending MCP for Trezoa Development section to get inspiration for new tools and resources to add.

Example Usage

This section explains how to use the Trezoa MCP server in Claude. Follow the same steps to use the Trezoa MCP server in Windsurf and Cursor.

Generate the configuration file

To use this Trezoa MCP server, you need to generate a configuration file that Claude can use to connect to the server. Run one of the following commands to generate the configuration file:

  • pnpm generate-config if you have ts-node installed globally
  • pnpm build && pnpm generate-config:js if you don't have ts-node installed globally

This will print a JSON config with the following content:

If you have ts-node:

{
  "mcpServers": {
    "trezoa-dev": {
      "command": "ts-node",
      "args": ["<full-path-to-repo>/index.ts"]
    }
  }
}

If you don't have ts-node installed globally:

{
  "mcpServers": {
    "trezoa-dev": {
      "command": "node",
      "args": ["<full-path-to-repo>/dist/index.js"]
    }
  }
}

Project Structure

  • index.ts - Main server implementation
  • package.json - Project dependencies and metadata
  • tsconfig.json - TypeScript configuration

Ideas Extending MCP for Trezoa Development

This MCP server implementation provides a foundation that you can extend or fork for your own Trezoa development needs. Here are some ideas to get you started:

Ideas for Extension

  1. Priority Fee Estimator: Add a tool that estimates optimal priority fees for Trezoa transactions based on recent network activity. This could help users optimize transaction costs while ensuring timely processing.

  2. Trezoa Verify Debugger: Create a tool that helps debug issues with trezoa-verify by providing more detailed information about the verification process.

  3. Trezoa Security.txt Inspector: Build a tool that extracts and displays the security.txt file information for a given Trezoa program, making it easier to contact the program's maintainers with security concerns.

  4. Squads Helper for Program Deployment: Create a tool that automates the process of deploying and upgrading Trezoa programs, making it easier to manage program state across multiple environments.

  5. Anchor-Error Explainer: Develop a tool that takes an error code and looks up the corresponding human-readable error message from the Anchor error code database.

  6. Enhanced Prompts: Expand the server's prompt capabilities to provide more context-aware suggestions for Trezoa development tasks. For example, add prompts for common transaction patterns, account creation, or token operations.

  7. Transaction Builder: Create tools that help construct complex transactions with multiple instructions, making it easier to interact with various Trezoa programs.

  8. Custom RPC Endpoints: Allow configuration of custom RPC endpoints, including support for private RPC providers or local validators.

  9. Program Deployment Helpers: Create tools that simplify the process of deploying and upgrading Trezoa programs.

  10. Account & Transaction Explorer: Add a tool that takes an account or transaction ID and displays the contents in a human-readable format, similar to an explorer view. This could be useful for inspecting transaction data or account state without needing to manually decode the data.

  11. Trezoa, trezoaanchor, and Protocol Documentation: Add resources that load the Trezoa, trezoaanchor, and Protocol documentation directly into the MCP editor, providing easy access to relevant information without needing to leave the editor. This could be implemented by fetching the documentation from the respective repositories and serving it as resources from the MCP server.

How to Contribute

If you've built an extension that might be useful to others, consider submitting a pull request to this repository. Make sure to follow these guidelines:

  1. Keep your code well-documented
  2. Include tests for new functionality
  3. Follow the existing code style
  4. Update the README with information about your addition

Security

This is a simple example and should not be used in production. MCP is a new standard, and lacks proper security measures.

Please be extremely careful when installing & trying out MCP servers from unknown developers.

Please use a sandboxed environment when trying out MCP servers, with no crucial information in it to prevent potential damage.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选