mcp cw graph
A Model Context Protocol server for creating, updating, and querying semantic relationships (cyberlinks) on Cosmos-based blockchains through integration with Cursor IDE and Claude Desktop.
A Model Context Protocol server for creating, updating, and querying semantic relationships (cyberlinks) on Cosmos-based blockchains through integration with Cursor IDE and Claude Desktop.
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.
Clone the repository:
git clone https://github.com/your-org/cw-social-mcp.git
cd cw-social-mcp
Install dependencies:
npm install
Build the project:
npm run build
Both Cursor IDE and Claude Desktop use the same MCP configuration format. Create or edit the configuration file:
~/.cursor/mcp.jsonAdd the following configuration:
{
"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"
}
}
}
}
Replace the following values:
- PATH_TO_YOUR_PROJECT: Absolute path to your cw-social-mcp project
- NODE_URL: Your Cosmos node URL
- WALLET_MNEMONIC: Your wallet's mnemonic phrase
- CONTRACT_ADDRESS: Your deployed contract address
- DENOM: (Optional) Token denomination, defaults to 'stake'
The configuration uses stdio format for communication between the MCP server and the clients (Cursor/Claude Desktop).
Build the project:
npm run build
Start the server in development mode:
npm run dev
src/
├── index.ts # Main entry point
├── cyberlink-service.ts # Cyberlink and blockchain operations
└── types.ts # TypeScript types and schemas
cursor_rules/
└── chat_history.mdc # Rules for chat history storage
The project includes cursor rules that define behavior for specific features:
Copy rules into ./cursor/rules directory
mcp_cw_graph_create_cyberlink - Create a new cyberlinkmcp_cw_graph_create_named_cyberlink - Create a named cyberlink with identifiermcp_cw_graph_create_cyberlinks - Create multiple cyberlinks in batchmcp_cw_graph_update_cyberlink - Update an existing cyberlink by IDmcp_cw_graph_delete_cyberlink - Delete a cyberlink by IDmcp_cw_graph_query_by_id - Query a single cyberlink by numeric IDmcp_cw_graph_query_by_formatted_id - Query a cyberlink by its formatted IDmcp_cw_graph_query_cyberlinks - Query all cyberlinks with paginationmcp_cw_graph_query_named_cyberlinks - Query all named cyberlinksmcp_cw_graph_query_by_ids - Query multiple cyberlinks by their IDsmcp_cw_graph_query_by_owner - Query cyberlinks by owner addressmcp_cw_graph_query_by_time_range - Query cyberlinks by creation time rangemcp_cw_graph_query_by_time_range_any - Query cyberlinks by creation or update time rangemcp_cw_graph_query_last_id - Get the last assigned cyberlink IDmcp_cw_graph_query_config - Query contract configurationmcp_cw_graph_query_debug_state - Query contract debug state (admin only)mcp_cw_graph_get_tx_status - Check transaction status and get cyberlink IDsmcp_cw_graph_query_wallet_balance - Get wallet address and token balancesmcp_cw_graph_send_tokens - Send tokens to another wallet addressowner - Owner address to filter bystart_time - Start time in nanoseconds (Uint64, can be passed as string or number)end_time - Optional end time in nanoseconds (Uint64, can be passed as string or number)start_after - Optional pagination cursor (Uint64, can be passed as string or number)limit - Optional result limit (default: 50)Most query endpoints support pagination with:
- start_after - Cursor for the next page (Uint64, can be passed as string or number)
- limit - Maximum number of results to return
The server uses standardized error codes from the MCP protocol:
- InvalidParams - Invalid input parameters
- MethodNotFound - Unknown tool name
- InternalError - Blockchain or server errors
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.