@xpladev/xpla_mcp_server
v1.0.0
Published
Model Context Protocol (MCP) server package for XPLA blockchain. Provides a standardized interface for AI models to safely access XPLA blockchain data.
Readme
xpla-mcp-server
Model Context Protocol (MCP) server package for XPLA blockchain. Provides a standardized interface for AI models to safely access XPLA blockchain data.
Table of Contents
- Overview
- MCP Configuration Examples
- AI Application Integration
- Environment Variables
- Caution
- Development Environment Setup
- Key Concepts
- Supported Networks
- License
Overview
Model Context Protocol (MCP) is a protocol that provides a standardized interface for AI models to safely access external data and tools. This XPLA MCP server package provides the following features:
- Account-related functions (
get_account,get_balance,get_cosmos_account, etc.) query account information and asset balances. - Block and transaction functions (
get_latest_block,get_tx,get_block_with_txs, etc.) query blockchain data and events. - Governance and staking functions (
get_proposals,get_delegation_rewards,get_staking_params, etc.) query proposals, rewards, and validator information. - WASM and EVM-related functions (
get_wasm_codes,get_contract_info,get_evm_balances, etc.) query smart contracts and EVM-compatible environments. - These functions are used to query blockchain state and interact through MCP.
MCP Configuration Examples
Simple Configuration
You can run the server using the following MCP configuration:
{
"mcpServers": {
"xpla-mcp-server": {
"command": "npx",
"args": ["@xpladev/xpla_mcp_server", "xpla_mcp_server"]
}
}
}AI Application Integration
Cursor
To integrate Cursor IDE with the XPLA MCP server:
Open Cursor Settings
- Run Cursor and click on settings (gear icon).
- Click "MCP" in the left sidebar.
- Click "Add new global MCP server".
Add Server Configuration
{
"mcpServers": {
"xpla-mcp-server": {
"command": "npx",
"args": ["@xpladev/xpla_mcp_server", "xpla_mcp_server"]
}
}
}Restart Cursor
Test
- In the editor, ask a question like "Can you query the latest block information from the XPLA blockchain?"
Claude Desktop
To integrate Claude Desktop with the XPLA MCP server:
Find Configuration File Location
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
Add Server Configuration
{
"mcpServers": {
"xpla-mcp-server": {
"command": "npx",
"args": ["@xpladev/xpla_mcp_server", "xpla_mcp_server"]
}
}
}Restart Claude Desktop
Test
- Ask Claude a question like "Can you query the latest block information from the XPLA blockchain?"
Other AI Application Integration
To integrate with other MCP-supporting AI systems:
- Check the MCP server configuration method for that system
- Adjust settings based on the configuration examples provided above
Environment Variables
Server behavior can be configured through the following environment variables:
| Environment Variable | Description | Default |
|----------|------|-------|
| XPLA_API_URL | XPLA blockchain API endpoint (https://cube-lcd.xpla.dev, https://dimension-lcd.xpla.dev/) | https://dimension-lcd.xpla.dev/ |
| LOG_LEVEL | Log level (debug, info, warning, error) | None |
| LOG_DIR | Log directory path | Not saved |
You can set these environment variables by creating a .env file in the project root:
# Set log level
LOG_LEVEL=info
# Set log directory
LOG_DIR=./logs
# Set XPLA blockchain API
XPLA_API_URL=https://dimension-lcd.xpla.dev/
{
"mcpServers": {
"xpla-mcp-server": {
"command": "npx",
"args": ["@xpladev/xpla_mcp_server", "xpla_mcp_server"],
"env": {
"XPLA_API_URL": "https://dimension-lcd.xpla.dev/",
"LOG_LEVEL": "info",
"LOG_DIR": "./logs"
}
}
}
}Caution
- The token usage may increase depending on the size of the MCP call response data.
Development Environment Setup
Prerequisites
- Node.js (v18 or higher)
- npm (v7 or higher)
Key Concepts
MCP Tools
XPLA blockchain-related tools provided by the server:
| Tool Name | Description | Parameters |
|----------|------|----------|
| get_account_info | Query common account information | address: Account address |
| get_accounts | Query all account list | limit: Number of results, page_key: Page key |
| get_account | Query detailed account information | address: Account address |
| get_balance | Query specific token balance | address: Account address, denom: Token unit (optional) |
| get_all_balances | Query all token balances | address: Account address |
| get_total_supply | Query total supply of all tokens | - |
| get_denoms_metadata | Query metadata for all token units | - |
| get_community_pool | Query community pool information | - |
| get_delegation_total_rewards | Query delegator's total rewards | delegator_address: Delegator address |
| get_delegation_rewards | Query delegation rewards for specific validator | delegator_address: Delegator address, validator_address: Validator address |
| get_latest_block | Query latest block information | - |
| get_block_by_height | Query block information at specific height | height: Block height |
| get_node_info | Query node information | - |
| get_syncing | Query node synchronization status | - |
| get_txs_by_event | Query transactions by event | query: Event query, other pagination options |
| get_block_with_txs | Query block with transactions | height: Block height, other pagination options |
| get_tx | Query transaction information | hash: Transaction hash |
| get_proposal | Query detailed proposal information | proposalId: Proposal ID |
| get_proposals | Query proposal list | Various filters and pagination options |
| get_votes | Query vote list for proposal | proposalId: Proposal ID, other pagination options |
| get_vote | Query specific voter's proposal vote | proposalId: Proposal ID, voter: Voter address |
| get_gov_params | Query Governance parameters | paramsType: Parameter type |
| get_delegations | Query delegation list | delegator_addr: Delegator address, other pagination options |
| get_staking_params | Query Staking module parameters | - |
| get_staking_pool | Query Staking pool information | - |
| get_validators | Query validator list | status, pagination_key, pagination_limit: Filter and pagination options |
| get_slashing_params | Query Slashing module parameters | - |
| get_wasm_codes | Query WASM code metadata | Pagination options |
| get_wasm_code | Query specific WASM code | code_id: Code ID |
| get_contracts_by_code | Query smart contract list by code | code_id: Code ID, other pagination options |
| get_wasm_params | Query CosmWasm module parameters | - |
| get_contract_info | Query contract metadata | address: Contract address |
| get_query_contract | Query contract smart query results | address: Contract address, query_data: Base64 encoded query data |
| get_contract_state | Query all raw data for contract | address: Contract address, other pagination options |
| get_contracts_by_creator | Query contract list by creator | creator_address: Creator address, other pagination options |
| get_evm_account | Query detailed Ethereum account information | address: Ethereum address |
| get_evm_balances | Query EVM token balances for Ethereum account | address: Ethereum address |
| get_evm_base_fee | Query base fee of parent block of current block | - |
| get_evm_params | Query x/evm module parameters | - |
| get_cosmos_account | Query Cosmos address of Ethereum account | address: Ethereum address |
Supported Networks
- XPLA Mainnet, XPLA Testnet
License
- This project is licensed under the MIT License.
