Cover image
Try Now
2025-02-24

Servidor de protocolo de contexto del modelo (MCP) para la integración de Windsurf con generación de imágenes y capacidades de desguace web.

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

MCP Server for Windsurf/Roocode

This is a Model Context Protocol (MCP) server that provides image generation and web scraping capabilities for Windsurf.

Features

  • Image Generation: Generate images using the Flux Pro model
  • Web Scraping: Extract content from webpages using ScrapeGraph

Getting Started

  1. Clone and set up the project:

    git clone https://github.com/bananabit-dev/mcp.git
    cd mcp
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    pip install -r requirements.txt
    
  2. Set up environment variables:

    cp .env.example .env
    

    Then edit .env to add your API keys:

    AIMLAPI_KEY=your_flux_pro_api_key
    SGAI_API_KEY=your_scrapegraph_api_key
    

MCP Server Configuration

  1. Add this configuration to ~/.codeium/windsurf/mcp_config.json:
{
  "mcpServers": {
    "bananabit-mcp": {
      "command": "/absolute/path/to/your/.venv/bin/python",
      "args": ["-m", "app.mcp_server"],
      "cwd": "/absolute/path/to/mcp",
      "env": {
        "PYTHONPATH": "/absolute/path/to/mcp",
        "AIMLAPI_KEY": "${env:AIMLAPI_KEY}",
        "SGAI_API_KEY": "${env:SGAI_API_KEY}"
      }
    }
  }
}
  1. In Windsurf, click the hammer icon and "Refresh" to load the MCP server.

Example Usage

Image Generation

Let's create a cozy kawaii living room! Here's an example dialogue with Windsurf:

User: Generate a image of a cozy warm living room in kawaii and anime style.

Assistant: I'll help you generate a cozy warm living room image in kawaii and anime style!

[Generated image saved as cozy_kawaii_living_room.png]

Cozy Kawaii Living Room

User: Try again with an even more cozy and kawaii living room.

Assistant: I'll enhance the kawaii and cozy elements even more in this new version!

[Generated image saved as super_cozy_kawaii_living_room.png]

Super Cozy Kawaii Living Room

The MCP server will generate unique images each time, but they will follow the style and elements specified in the prompts. Try creating your own cozy spaces or other creative images!

Web Scraping

The MCP server provides powerful web scraping capabilities through the ScrapeGraph API. Here are the main features:

  1. Content Extraction

    # Extract main content from a webpage
    result = await extract_webpage_content(
        url="https://example.com"
    )
    
  2. Markdown Conversion

    # Convert webpage to clean markdown
    result = await markdownify_webpage(
        url="https://example.com",
        clean_level="medium"  # Options: light, medium, aggressive
    )
    
  3. Smart Scraping

    # Extract specific information using AI
    result = await scrape_webpage(
        url="https://example.com"
    )
    

Features

  • AI-Powered Extraction: Intelligently identifies and extracts main content
  • Clean Output: Removes ads, navigation, and other clutter
  • Format Options: Get content in raw HTML, markdown, or structured data
  • Error Handling: Graceful fallbacks for failed extractions
  • Customization: Control cleaning level and output format

Example Use Cases

  1. Documentation Generation

    # Create local documentation from online sources
    content = await markdownify_webpage(
        url="https://docs.example.com/guide",
        clean_level="medium"
    )
    with open(".docs/guide.md", "w") as f:
        f.write(content)
    
  2. Content Analysis

    # Extract and analyze webpage sentiment
    content = await extract_webpage_content(
        url="https://example.com/article"
    )
    sentiment = await analyze_text_sentiment(
        text=content["text"]
    )
    
  3. Data Collection

    # Extract structured data
    data = await scrape_webpage(
        url="https://example.com/products"
    )
    # Process extracted data
    for item in data["structured_data"]:
        process_item(item)
    

Best Practices

  1. Rate Limiting

    • Respect website rate limits
    • Add delays between requests
    • Use caching when possible
  2. Error Handling

    try:
        content = await extract_webpage_content(url)
    except Exception as e:
        # Fall back to simpler extraction
        content = await markdownify_webpage(url)
    
  3. Content Cleaning

    • Start with "medium" clean_level
    • Use "aggressive" for very noisy pages
    • Use "light" when preserving format is important
  4. Output Processing

    • Validate extracted content
    • Handle empty or partial results
    • Process structured data appropriately

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

    Reviews

    2 (1)
    Avatar
    user_p7FoORMt
    2025-04-16

    mcp has thoroughly impressed me with its seamless integration and robust functionality. As a dedicated user, I appreciate the thoughtfully designed features and the efficient user experience. Well-maintained by bananabit-dev, mcp stands as a testament to excellent software craftsmanship. Highly recommended for anyone seeking a reliable and user-friendly tool! For more details, visit the official GitHub repository: https://github.com/bananabit-dev/mcp.