@skynetxbt/flow-mcp-agent
TypeScript icon, indicating that this package has built-in type declarations

1.3.6 • Public • Published

MCP Agent Flow

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.

Features

  • Multi-transport MCP integration
  • Browser automation capabilities
  • Data fetching and analysis
  • DeFi protocol interaction
  • Automated step execution
  • Intelligent request analysis

Installation

npm install @skynetxbt/flow-mcp-agent
# or
yarn add @skynetxbt/flow-mcp-agent

Dependencies

  • @skynetxbt/core
  • @skynetxbt/plugin-mcp-client
  • @skynetxbt/agent

Usage

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"
});

Configuration Options

interface MCPConfig {
  transports: {
    id: string;
    url: string;
    mcpkeyval: Record<string, any>;
    description: string;
  }[];
}

Available Transports

  1. Browser MCP

    • ID: browser-mcp
    • Purpose: Web automation and interaction
    • Capabilities: Page navigation, data extraction, form interaction
  2. Fetch MCP

    • ID: fetch-mcp
    • Purpose: Data retrieval and API interaction
    • Capabilities: HTTP requests, data parsing, API integration
  3. DeFi MCP

    • ID: defi-mcp
    • Purpose: DeFi protocol analysis
    • Capabilities: Token analysis, vault statistics, performance tracking

Supported Operations

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

Error Handling

flow.on('error', (error) => {
  console.error('MCP Error:', error);
});

// Configure automatic recovery
flow.setRecoveryPolicy({
  maxRetries: 3,
  recoveryDelay: 5000,
  recoveryActions: ['restart', 'reconfigure']
});

Best Practices

  1. Transport Management

    • Initialize required transports at startup
    • Handle transport failures gracefully
    • Monitor transport health
  2. Operation Execution

    • Use clear, specific commands
    • Handle operation timeouts
    • Validate operation results
  3. Error Recovery

    • Implement proper error handling
    • Use appropriate retry strategies
    • Log errors with context
  4. Resource Management

    • Clean up resources after use
    • Monitor resource usage
    • Handle concurrent operations

Capabilities

  • Natural language command processing
  • Multi-step operation execution
  • Browser automation
  • Data fetching and analysis
  • DeFi protocol interaction
  • Automated error recovery
  • Transport management

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @skynetxbt/flow-mcp-agent

Weekly Downloads

105

Version

1.3.6

License

none

Unpacked Size

18.1 kB

Total Files

10

Last publish

Collaborators

  • mitrasish
  • 0xarpit