网络链接
STDIO用于与Cosmos链上智能合约交互的MCP服务器
用于与Cosmos链上智能合约交互的MCP服务器
A Model Context Protocol (MCP) server for interacting with the CW-Social smart contract on Cosmos-based blockchains. This server provides a standardized interface for creating, updating, and querying cyberlinks - semantic relationships between entities on the blockchain.
Core Operations
Transaction Management
Advanced Features
git clone https://github.com/your-org/cw-social-mcp.git cd cw-social-mcp
npm install
npm run build
Create or modify the configuration file at ~/.cursor/mcp.json:
{ "mcpServers": { "cw-graph": { "command": "node", "args": ["PATH_TO_YOUR_PROJECT/dist/index.js"], "env": { "NODE_URL": "http://localhost:26657", "WALLET_MNEMONIC": "your wallet mnemonic phrase", "CONTRACT_ADDRESS": "your contract address", "DENOM": "stake", "BENCH32_PREFIX": "cyber" } } } }
Required environment variables:
PATH_TO_YOUR_PROJECT: Absolute path to project directoryNODE_URL: Cosmos blockchain node URLCONTRACT_ADDRESS: Deployed smart contract addressOptional environment variables:
WALLET_MNEMONIC: Wallet mnemonic for signing (default: none - transactions will be unsigned)DENOM: Token denomination (default: "stake")BENCH32_PREFIX: BECH32 prefixcreate_cyberlink
typefrom, to, valuecreate_cyberlink2
node_type, link_typenode_value, link_value, link_to_existing_id, link_from_existing_idcreate_named_cyberlink
name, cyberlinkcreate_cyberlinks
cyberlinks[]update_cyberlink
gid, cyberlinkdelete_cyberlink
gidupdate_with_embedding
formatted_idquery_by_gid
gidquery_by_fid
fidquery_cyberlinks
limit, start_afterquery_named_cyberlinks
limit, start_afterquery_by_gids
gids[]query_cyberlinks_by_type
typequery_cyberlinks_by_from
fromquery_cyberlinks_by_to
toquery_cyberlinks_by_owner_and_type
owner, typequery_cyberlinks_by_owner_time
owner, start_timequery_cyberlinks_by_owner_time_any
owner, start_timequery_last_id
query_config
query_debug_state
get_graph_stats
query_transaction
transaction_hashget_tx_status
transaction_hashquery_wallet_balance
send_tokens
recipient, amount2024-06-01T12:00:00Zstart_time is required, end_time is optionalstart_after: Pagination cursorlimit: Results per page (default: 50)# Production build npm run build # Development mode npm run dev
src/
├── index.ts                # Entry point
├── cyberlink-service.ts    # Core service
├── services/
│   ├── embedding.service.ts  # Semantic analysis
│   └── __tests__/           # Test suite
└── types.ts                # Type definitions
cursor_rules/
└── chat_history.mdc       # Chat rules
InvalidParams
MethodNotFound
InternalError
You can run the MCP server using Docker to turn it into an SSE server. This ensures the Hugging Face model cache is persisted between runs and that environment variables are loaded from your .env file.
docker run \ --name cw-social \ -v $(pwd)/hf-cache:/app/hf-cache \ --env-file .env \ -p 8000:8000 \ cw-social-mcp
-v $(pwd)/hf-cache:/app/hf-cache mounts a local directory for model caching, so models are not re-downloaded every time.--env-file .env loads environment variables from your .env file.-p 8000:8000 exposes the server on port 8000.--name cw-social names your container for easier management.git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.