JS-Peer x DeFi MCP Server
Enables AI assistants to interact with peer-to-peer networks (libp2p) and DeFi protocols, including oracle networks, cross-chain communication, and intent-based execution.
README
JS-Peer x DeFi MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to js-libp2p universal-connectivity functionality + DeFi Toolings, enabling AI assistants to interact with peer-to-peer networks, send messages, facilitate oracle networks coordination and all such over Libp2p as coordination layer.
Usage
Starting the MCP Server
- Install dependencies:
npm install
- Build the project (optional;
npm startwill build automatically):
npm run build
- Start the MCP server:
npm start
- Connect with Claude Desktop App via
Edit ConfiginFileNavbar -->Settings-->DeveloperTab or just pressCtrl + ,to opensettings menuand edit the config file in any IDE as below:
# Example claude_desktop_config.json
{
"mcpServers": {
"universal-connectivity": {
"command": "node",
"args": ["/absolute/path/to/js-peer-mcp/dist/index.js"],
"env": {}
}
}
}
Skill definition (SKILL.md)
Claude Desktop loads skills from a SKILL.md file. This repo provides a ready-to-import skill definition:
SKILL.md— skill definition that matches the tools exposed by this MCP server.claude-universal-connectivity-skill.json— same definition in pure JSON form.
To load the skill in Claude Desktop:
- Open Skills in Claude Desktop.
- Import or load
SKILL.mdfrom this repo. - After importing, you can call any of the listed tools from the skill.
- Close and Reopen the Claude Desktop App and a
New Chat, you will now be able to view theuniversal-connectivityoption insearch and toolsbutton of the input area.
ALWAYS ENSURE YOUR MCP SERVER IS RUNNING VIA
npm startTO ACTIVATE THE JS-LIBP2P related operations
- Go ahead and chat with Claude for any libp2p related commands and it will present you with relevant results seamlessly! incredible, right?
Try this commands to get started:-
create libp2p node, 'start libp2p node', 'stop libp2p node', 'get node status'
- You can Further change permission access for this mcp-server through the left-bottom Your Account tab --> Settings --> Integrations -->
universal-connectivity: tools and settings options:
DeFi Enhancements
The MCP server now includes comprehensive DeFi capabilities that leverage libp2p's peer-to-peer networking for decentralized finance applications:
DeFi Tools
Oracle Networks
submit_oracle_data- Submit price/data feeds to decentralized oracle networksquery_oracle_data- Query aggregated oracle data for assets- Decentralized price feed aggregation without centralized providers
Cross-Chain Communication
relay_cross_chain_message- Relay messages between different blockchain networksget_bridge_status- Monitor cross-chain bridge health and activity- Fault-tolerant cross-chain communication infrastructure
Intent-Based DeFi
submit_intent- Submit DeFi intents for solver coordinationdiscover_intent_solvers- Find available solvers for intent execution- Privacy-preserving intent propagation and MEV-resistant coordination
Decentralized Data Availability
publish_da_data- Publish data to decentralized availability networksretrieve_da_data- Retrieve data with content addressing- Trust-minimized data sharing for DeFi protocols
Keeper Networks
register_keeper- Register automated keepers for DeFi operationscoordinate_keeper_action- Coordinate liquidation, rebalancing, and harvest operations- Decentralized automation without centralized coordination
DeFi Resources
defi://oracle-data- Real-time oracle data feeds and aggregationdefi://cross-chain-status- Cross-chain bridge status and relay informationdefi://intents-active- Active DeFi intents awaiting executiondefi://keepers-network- Keeper network status and capabilitiesdefi://da-data- Decentralized data availability catalog
Claude Skills Integration
This enhanced MCP server is designed to work seamlessly with Claude's skills system, providing AI-powered DeFi coordination capabilities.
Setting up Claude Skills
-
Load the DeFi Skill Configuration:
# The claude-defi-skill.json file contains the skill definition # Import this into Claude's skills system -
Skill Capabilities:
- Oracle Network Management: Automated price feed submission and aggregation
- Cross-Chain Coordination: Intelligent bridge management and message routing
- Intent-Based Execution: AI-assisted intent creation and solver matching
- Data Availability Management: Decentralized data publishing and retrieval
- Keeper Network Orchestration: Automated DeFi operation coordination
-
Example Skill Usage:
"Help me set up a decentralized oracle network for ETH/USD price feeds" "Coordinate a cross-chain swap from Ethereum to Polygon" "Create an intent for yield farming optimization" "Monitor keeper network health and performance"
Benefits for DeFi
- Decentralization: Replace centralized infrastructure with peer-to-peer networks
- Censorship Resistance: Operate without single points of failure
- Cost Efficiency: Reduce reliance on expensive centralized APIs
- Privacy: Enable private coordination channels for sensitive operations
- Scalability: Leverage libp2p's efficient P2P communication protocols
- Interoperability: Connect disparate DeFi protocols and blockchains
Real-World DeFi Applications
- Decentralized Oracles: Chainlink-style oracle networks without centralized nodes
- Cross-Chain Bridges: Secure message passing between L1/L2 networks
- Intent-Based DEXs: Privacy-preserving intent propagation (like CoW Swap)
- Keeper DAOs: Decentralized automation networks for liquidations and rebalancing
- DeFi Data Availability: Off-chain data sharing for rollups and Layer 2 solutions
- MEV Mitigation: Private solver networks and coordination channels
Available Tools
Node Management
create_libp2p_node- Initialize a new libp2p nodestart_libp2p_node- Start the libp2p nodestop_libp2p_node- Stop the libp2p nodeget_node_status- Get current node status
Peer Management
discover_peers- Discover peers on the networkconnect_to_peer- Connect to a specific peerdisconnect_from_peer- Disconnect from a peerlist_connections- List active connectionsget_peer_info- Get detailed peer informationping_peer- Ping a peer to test connectivity
Messaging
send_group_message- Send message to a topicsend_direct_message- Send private message to a peersubscribe_to_topic- Subscribe to a pubsub topicunsubscribe_from_topic- Unsubscribe from a topicget_message_history- Retrieve message historyget_topic_subscribers- Get topic subscriber list
File Sharing
share_file- Share a file with the networkrequest_file- Request a file from a peerlist_shared_files- List available shared filesannounce_file- Announce file availability
Monitoring
get_network_stats- Get network statisticsget_protocol_handlers- List protocol handlersenable_debug_logging- Configure debug loggingget_peer_store_info- Get peer store information
DeFi Tools
Oracle Networks
submit_oracle_data- Submit price/data feeds to oracle networksquery_oracle_data- Query aggregated oracle data for assets
Cross-Chain Communication
relay_cross_chain_message- Relay messages between blockchain networksget_bridge_status- Monitor cross-chain bridge status
Intent-Based DeFi
submit_intent- Submit DeFi intents for executiondiscover_intent_solvers- Find available intent solvers
Decentralized Data Availability
publish_da_data- Publish data to DA networksretrieve_da_data- Retrieve data from DA networks
Keeper Networks
register_keeper- Register automated keeperscoordinate_keeper_action- Coordinate keeper operations
Available Resources
connections://active- Current active connectionspeers://discovered- Recently discovered peersnetwork://stats- Network statisticsnode://info- Node information and statusfiles://shared- Shared files catalogmessages://topic/{topicName}- Messages for specific topicmessages://peer/{peerId}- Direct messages with specific peer
DeFi Resources
defi://oracle-data- Oracle data feeds and aggregationdefi://cross-chain-status- Cross-chain bridge statusdefi://intents-active- Active DeFi intentsdefi://keepers-network- Keeper network statusdefi://da-data- Decentralized data availability
Configuration
The server supports various configuration options:
interface NodeConfig {
transports?: string[] // ['webrtc', 'websockets', 'webtransport']
enableRelay?: boolean // Enable circuit relay (default: true)
bootstrapPeers?: string[] // Custom bootstrap peer multiaddrs
listenAddresses?: string[] // Custom listen addresses
}
Protocol Support
- WebRTC: Browser-to-browser connections
- WebSockets: Traditional WebSocket connections
- WebTransport: Modern QUIC-based transport
- Circuit Relay: NAT traversal and hole punching
- Gossipsub: Publish-subscribe messaging
- Direct Messages: Peer-to-peer messaging protocol
- File Exchange: Custom file sharing protocol
Error Handling
The server provides comprehensive error handling with descriptive messages:
- Connection failures and timeouts
- Invalid peer IDs or multiaddrs
- Network protocol errors
- File transfer interruptions
- Message delivery failures
Development
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
# Run tests
npm run test
# Lint code
npm run lint
# Format code
npm run format
Architecture
The MCP server is built with a modular architecture:
- State Manager: Centralized state management
- Tool Handlers: Organized by functionality (node, peer, messaging, etc.)
- Resource Providers: Dynamic resource access
- Protocol Integration: Direct integration with libp2p protocols
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
Related Projects
- libp2p - Modular peer-to-peer networking stack
- universal-connectivity - Universal connectivity examples
- Model Context Protocol - MCP specification
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。