- Aptos Mcp
Aptos Mcp
Content
Aptos MCP Server
A Model Context Protocol (MCP) server for interacting with the Aptos blockchain testnet. This server provides AI assistants with the ability to perform blockchain operations, query data, and manage digital assets on Aptos.
Features
🔐 Account Management ff
- Generate new Aptos accounts
- Get account information and balances
- Fund accounts from t estnet faucet
- Validate addresses and check account existence. d
- Query account resources
💸 Transaction Operations
- Transfer APT tokens between accounts
- Build, sign, and submit transactions
- Simulate transactions for gas estimation
- Track transaction status and history
- Execute custom smart contract functions
🔍 Blockchain Queries
- Get current blockchain information
- Query blocks by height or version
- Search for events and activities
- Get gas price estimations
- Call view functions (read-only)
- Query table items
🎨 Token & NFT Management
- Get account token balances (fungible tokens)
- Query owned NFTs and collections
- Transfer tokens and NFTs
- Get token and collection metadata
- Track token-related activities
- Deploy new fungible tokens
- Create NFT collections
- Mint NFTs and fungible tokens
Installation
Local Development
npm install
npm run build
mcp.so Hosting
This server is ready for deployment on mcp.so:
- Upload to GitHub: Push your code to a public repository
- Submit to mcp.so: Use the submission form
- Automatic hosting: Supports both stdio and REST transports
- Docker support: Includes Dockerfile for containerized deployment
Usage
With Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"aptos": {
"command": "node",
"args": ["/path/to/aptos-mcp-server/build/index.js"],
"env": {}
}
}
}
Standalone Testing
# Run in stdio mode (default)
node build/index.js
# Run in REST mode for web hosting
mode=rest node build/index.js
# Run tests
npm test
# Run with coverage
npm run test:coverage
Available Tools
Account Tools
generate_account- Generate a new Aptos accountget_account_info- Get detailed account informationget_account_balance- Check APT balancefund_account- Fund account from testnet faucetcheck_account_exists- Verify if account existsget_account_resources- Get all account resources
Transaction Tools
transfer_apt- Transfer APT tokensget_transaction- Get transaction details by hashsimulate_transaction- Simulate transaction for gas estimationget_account_transactions- Get account transaction historyexecute_function- Execute custom smart contract functions
Query Tools
get_chain_info- Get blockchain informationget_block- Get block data by height/versionget_events- Query blockchain eventsget_account_modules- Get published modulesget_gas_price- Get current gas priceget_table_item- Query table itemsview_function- Call read-only functions
Token Tools
get_account_tokens- Get owned NFTsget_token_data- Get token metadataget_collection_data- Get collection informationget_account_coin_balances- Get all coin balancestransfer_token- Transfer NFTsget_account_token_activities- Get token activity historydeploy_fungible_token- Deploy a new fungible tokencreate_nft_collection- Create a new NFT collectionmint_nft- Mint an NFT in an existing collectionmint_fungible_token- Mint fungible tokens to an account
Examples
Generate and Fund Account
// Generate a new account
const account = aptosClient.generateAccount();
console.log(`Address: ${account.accountAddress}`);
// Fund from testnet faucet
await aptosClient.fundAccount(account.accountAddress.toString());
// Check balance
const balance = await aptosClient.getAccountBalance(account.accountAddress.toString());
console.log(`Balance: ${balance} APT`);
Transfer APT
// Transfer 1 APT from sender to recipient
const result = await transferAPT({
fromPrivateKey: "0x...",
toAddress: "0x...",
amount: 1.0
});
Query Blockchain Data
// Get current blockchain info
const chainInfo = await aptosClient.getChainInfo();
// Get latest block
const block = await aptosClient.getClient().getBlockByHeight({
blockHeight: chainInfo.block_height
});
Deploy and Mint Tokens
// Deploy a new fungible token
const deployResult = await deployFungibleToken({
creatorPrivateKey: "0x...",
name: "My Token",
symbol: "MTK",
decimals: 8
});
// Create an NFT collection
const collectionResult = await createNFTCollection({
creatorPrivateKey: "0x...",
name: "My NFT Collection",
description: "A collection of unique digital assets",
uri: "https://example.com/collection.json"
});
// Mint an NFT in the collection
const nftResult = await mintNFT({
creatorPrivateKey: "0x...",
collectionName: "My NFT Collection",
tokenName: "NFT #1",
description: "First NFT in the collection",
uri: "https://example.com/nft1.json",
recipientAddress: "0x..."
});
// Mint fungible tokens
const mintResult = await mintFungibleToken({
creatorPrivateKey: "0x...",
recipientAddress: "0x...",
amount: 1000
});
Development
Project Structure
src/
├── index.ts # Main MCP server entry point
├── aptos-client.ts # Aptos client wrapper
└── tools/
├── account-tools.ts # Account management tools
├── transaction-tools.ts # Transaction tools
├── query-tools.ts # Blockchain query tools
└── token-tools.ts # Token and NFT tools
Testing
# Run all tests
npm test
# Run specific test file
npm test -- aptos-client.test.ts
# Run with coverage
npm run test:coverage
Building
# Build TypeScript
npm run build
# Clean build directory
npm run clean
Configuration
The server is configured for Aptos testnet by default. Key configuration:
- Network: Testnet
- Timeout: 30 seconds for requests
- Gas Limits: Configurable per transaction
- Error Handling: Comprehensive error messages
Security Notes
⚠️ Important Security Considerations:
- Private Keys: Never share or expose private keys
- Testnet Only: This server is configured for testnet only
- Rate Limiting: Testnet faucet has rate limits
- Gas Costs: Always simulate transactions first
- Validation: All addresses and inputs are validated
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the Aptos documentation
- Review the MCP specification
- Open an issue in this repository
Deployment to mcp.so
This server is designed to be deployed to mcp.so. The build output in build/index.js is the entry point for the MCP server.
Server Config
{
"mcpServers": {
"aptos-mcp-server": {
"command": "npx",
"args": [
"-y",
"aptos-mcp-server"
]
}
}
}Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Tavily Mcp