A SkynetXBT flow for executing complex multi-step operations using the Model Context Protocol (MCP). This flow enables automated interactions with various MCP transports for browser automation, data fetching, and DeFi analysis.
- Multi-transport MCP integration
- Browser automation capabilities
- Data fetching and analysis
- DeFi protocol interaction
- Automated step execution
- Intelligent request analysis
npm install @skynetxbt/flow-mcp-agent
# or
yarn add @skynetxbt/flow-mcp-agent
- @skynetxbt/core
- @skynetxbt/plugin-mcp-client
- @skynetxbt/agent
import { MCPAgentFlow } from '@skynetxbt/flow-mcp-agent';
// Initialize the flow with custom transports
const flow = new MCPAgentFlow({
transports: [
{
id: "browser-mcp",
url: "https://server.smithery.ai/@goswamig/browser-mcp",
mcpkeyval: {},
description: "Browser automation MCP"
},
{
id: "fetch-mcp",
url: "https://server.smithery.ai/@goswamig/fetch-mcp",
mcpkeyval: {},
description: "Data fetching MCP"
}
]
});
// Execute MCP operations
await flow.execute({
message: "go to geckoterminal fetch best token"
});
interface MCPConfig {
transports: {
id: string;
url: string;
mcpkeyval: Record<string, any>;
description: string;
}[];
}
-
Browser MCP
- ID:
browser-mcp
- Purpose: Web automation and interaction
- Capabilities: Page navigation, data extraction, form interaction
- ID:
-
Fetch MCP
- ID:
fetch-mcp
- Purpose: Data retrieval and API interaction
- Capabilities: HTTP requests, data parsing, API integration
- ID:
-
DeFi MCP
- ID:
defi-mcp
- Purpose: DeFi protocol analysis
- Capabilities: Token analysis, vault statistics, performance tracking
- ID:
The flow supports various operations through natural language commands:
-
analyze
- Perform analysis on tokens or protocols -
find token
- Search for specific tokens -
check vault
- Retrieve vault statistics -
go to
- Navigate to specific platforms -
fetch
- Retrieve data from sources
flow.on('error', (error) => {
console.error('MCP Error:', error);
});
// Configure automatic recovery
flow.setRecoveryPolicy({
maxRetries: 3,
recoveryDelay: 5000,
recoveryActions: ['restart', 'reconfigure']
});
-
Transport Management
- Initialize required transports at startup
- Handle transport failures gracefully
- Monitor transport health
-
Operation Execution
- Use clear, specific commands
- Handle operation timeouts
- Validate operation results
-
Error Recovery
- Implement proper error handling
- Use appropriate retry strategies
- Log errors with context
-
Resource Management
- Clean up resources after use
- Monitor resource usage
- Handle concurrent operations
- Natural language command processing
- Multi-step operation execution
- Browser automation
- Data fetching and analysis
- DeFi protocol interaction
- Automated error recovery
- Transport management
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
MIT