Navigation
MCP EV Assistant Server: EV Charging & Trip Planning Mastery - MCP Implementation

MCP EV Assistant Server: EV Charging & Trip Planning Mastery

MCP EV Assistant Server: The go-to backbone for EV charging stations, trip planning, and resource mastery. Robust APIs, seamless orchestration—designed for pros who refuse to compromise.

Research And Data
4.3(51 reviews)
76 saves
35 comments

This tool saved users approximately 5832 hours last month!

About MCP EV Assistant Server

好的,我现在需要处理用户的请求,生成一个符合要求的HTML页面。首先,我需要仔细阅读用户的指令,确保完全理解所有要求。用户希望根据提供的原始文本,生成一个全新的HTML格式页面主体代码,不要页头和页尾,同时所有外部链接的a标签要加上nofollow标识。主题需要从原始文本中分析总结,生成指定的五个H2标题及其详细内容,内容要像专业技术人员写的,而不是AI生成,不能直接复制原始内容,直接返回HTML代码。 首先,我需要分析原始文本的结构和内容。原始文本包括功能、安装、配置、使用、API参考等部分。用户要求的主题是五个H2标题,分别是: 1. What is MCP EV Assistant Server: EV Charging & Trip Planning Mastery? 2. How to use MCP EV Assistant Server: EV Charging & Trip Planning Mastery? 3. Key Features of MCP EV Assistant Server: EV Charging & Trip Planning Mastery? 4. Use cases of MCP EV Assistant Server: EV Charging & Trip Planning Mastery? 5. FAQ from MCP EV Assistant Server: EV Charging & Trip Planning Mastery? 接下来,我需要从原始文本中提取信息,重新组织内容,确保每个H2下的内容符合主题,并且不直接复制。例如,"What is"部分需要简要介绍这个服务器是什么,它的核心功能是什么。"How to use"可能需要步骤或流程,而"Key Features"需要总结主要功能点。"Use cases"需要实际应用场景的例子,而FAQ则是常见问题的回答。 需要注意的是,用户强调内容应由专业技术人员撰写,避免AI生成的感觉,所以需要使用更自然、流畅的叙述方式,避免过于机械化的描述。同时,所有外部链接的a标签要加上rel="nofollow"。但原始文本中是否有外部链接呢?比如在Contributing部分提到的GitHub操作步骤,可能涉及链接,但可能用户指的是所有a标签都需要处理,但原始文本中可能没有明显的外部链接,可能需要假设或忽略,或者可能用户希望所有内部链接也处理,但根据指令,可能只是外部链接。不过用户可能希望所有a标签添加nofollow,所以需要检查生成的HTML中的a标签是否添加了该属性。 另外,用户要求不要页头页尾,所以只需要返回body内的内容,可能以div包裹,但不需要head或html标签。 现在开始处理每个部分: 1. **What is**:需要简要介绍MCP EV Assistant Server,说明其目的是为电动汽车用户提供充电和路线规划服务,整合了API工具和资源管理功能。可能提到其模块化设计,支持扩展,处理PDF资源等。 2. **How to use**:步骤可能包括安装、配置API密钥、使用API端点调用功能,或者如何调用工具和提示。可能需要分步骤说明,比如安装步骤,配置,调用API示例。 3. **Key Features**:需要从原始文本的功能部分提取,如充电站搜索、路线规划、PDF资源管理、订阅系统、错误处理等。可能需要更简洁的列表形式,每个功能点用一两句话说明。 4. **Use cases**:实际应用场景,比如车队管理公司使用它优化路线,用户规划长途旅行,维护团队更新文档等。 5. **FAQ**:常见问题,比如如何安装,如何处理PDF问题,如何贡献代码等,答案要简洁。 现在开始编写每个部分的内容,确保不直接复制,而是重新表述。例如,原始文本中的功能部分有三个主要工具:find-charging-stations, charging-time-estimate, route-planner。在Key Features中需要提到这些,但用不同的表达方式。 在HTML结构上,每个H2标题下可能有段落或列表,使用适当的HTML标签如

,

    ,
  • 等。外部链接需要添加nofollow,但可能原始内容中没有明显的外部链接,所以可能不需要处理,但用户可能希望所有a标签都加上,即使内部链接?或者可能用户希望外部链接添加,但如果没有,可能忽略。这里可能需要假设用户指的外部链接,但如果没有的话,可以暂时不添加,或者可能用户希望所有链接都添加nofollow,即使内部,所以需要检查。 现在开始编写HTML代码: 首先,结构大致如下:

    What is...

    ...

    How to use...

      ...

MCP EV Assistant Server Features

Key Features...

    ...

Use cases...

    MCP EV Assistant Server FAQ

    FAQ...

      ...

    Content

    MCP EV Assistant Server

    A powerful server implementation for managing Electric Vehicle (EV) charging stations, trip planning, and resource management. This server provides a comprehensive set of tools and APIs for EV-related services.

    Table of Contents

    • Features
    • Installation
    • Configuration
    • Usage
    • API Reference
    • Resource Management
    • Error Handling
    • Development
    • Contributing
    • License

    Features

    1. EV Charging Station Services

    • Charging Station Locator : Find nearby EV charging stations based on location and preferences
    • Socket Type Filtering : Search for specific charging socket types (CCS, CHAdeMO, Type 2, etc.)
    • Distance-based Search : Specify search radius for finding charging stations

    2. Trip Planning

    • Route Planning : Plan EV-friendly routes between locations
    • Charging Stop Integration : Automatically includes necessary charging stops
    • Range Consideration : Takes into account vehicle range and current charge level

    3. Resource Management

    • PDF Document Management : Handles EV-related PDF documents (user guides, manuals, etc.)
    • Resource Subscription : Supports resource subscription for real-time updates
    • Automatic Text Extraction : PDF text extraction with fallback mechanisms

    4. Interactive Prompts

    • Charging Station Search : Interactive prompts for finding charging stations
    • Charging Time Estimation : Calculate charging duration based on various parameters
    • Route Planning Assistance : Interactive route planning with charging considerations

    Installation

    1. Clone the Repository

    git clone https://github.com/Abiorh001/mcp_ev_assistant_server.git
    cd mcp_ev_assistant_server
    

    2. Set Up Virtual Environment (Recommended)

    python -m venv .venv
    source .venv/bin/activate  # On Linux/Mac
    # or
    .venv\\Scripts\\activate  # On Windows
    

    3. Install Dependencies

    python -m pip install langchain-community
    python -m pip install python-dotenv
    python -m pip install PyPDF2
    python -m pip install PyMuPDF  # Optional: for PDF fallback processing
    

    Configuration

    1. Environment Variables

    Create a .env file in your project root with the following variables:

    OPENCHARGE_MAP_API_KEY=your_opencharge_map_api_key
    GOOGLE_MAP_API_KEY=your_google_map_api_key
    

    2. Server Configuration

    Create or update servers_config.json:

    {
      "mcpServers": {
        "ev_assistant": {
          "command": "/home/$USER/path/mcp_learning/.venv/bin/python",
          "args": ["/home/$USER/path/mcp_ev_assistant_server/ev_assistant_server.py"],
          "env": {
            "OPENCHARGE_MAP_API_KEY": "your_opencharge_map_api_key",
            "GOOGLE_MAP_API_KEY": "your_google_map_api_key"
          }
        }
      }
    }
    

    3. Directory Structure

    mcp_ev_assistant_server/
    ├── ev_assistant_server.py
    ├── .env
    ├── servers_config.json
    ├── Data/                  # PDF resources directory
    ├── agentTools/           # Tool implementations
    │   ├── charge_station_locator.py
    │   └── ev_trip_planner.py
    └── core/                 # Core functionality
        ├── schemas.py
        └── logger.py
    

    Usage

    Starting the Server

    # Method 1: Direct Python execution
    python ev_assistant_server.py
    

    API Examples

    1. Finding Charging Stations:
    result = await client.call_tool("charge_points_locator", {
        "address": "London, UK",
        "max_distance": 10,
        "socket_type": "CCS"
    })
    
    1. Planning a Trip:
    result = await client.call_tool("ev_trip_planner", {
        "user_address": "Manchester, UK",
        "user_destination_address": "Liverpool, UK",
        "socket_type": "Type 2"
    })
    

    API Reference

    Tools

    1. charge_points_locator
    * Purpose: Find EV charging stations near a location
    * Parameters: 
      * `address`: Location to search around (string, required)
      * `max_distance`: Search radius in kilometers (integer, required)
      * `socket_type`: Type of charging socket (string, required)
    
    1. ev_trip_planner
    * Purpose: Plan an EV-friendly route
    * Parameters: 
      * `user_address`: Starting location (string, required)
      * `user_destination_address`: Destination location (string, required)
      * `socket_type`: Preferred charging socket type (string, required)
    

    Prompts

    1. find-charging-stations
    * Required: 
      * `location`: Search location
    * Optional: 
      * `radius`: Search radius in km
      * `socket_type`: Charging socket type
    
    1. charging-time-estimate
    * Required: 
      * `vehicle_model`: EV make and model
      * `current_charge`: Current battery percentage
      * `target_charge`: Desired battery percentage
      * `charger_power`: Charging station power in kW
    
    1. route-planner
    * Required: 
      * `start_location`: Starting point
      * `end_location`: Destination
      * `vehicle_range`: Vehicle's full charge range
    * Optional: 
      * `current_charge`: Current battery percentage
    

    Resource Management

    PDF Resource Handling

    • Automatically discovers PDF files in the /Data directory
    • Supports text extraction with multiple fallback methods
    • Handles resource subscriptions for updates

    Subscription System

    # Subscribe to a resource
    await client.subscribe_resource("file:///pdf/ev_manual")
    
    # Unsubscribe from a resource
    await client.unsubscribe_resource("file:///pdf/ev_manual")
    

    Error Handling

    • Comprehensive error logging
    • Fallback mechanisms for PDF processing
    • Input validation using Pydantic schemas
    • Graceful handling of missing resources

    Development

    Adding New Tools

    1. Define the tool schema in core.schemas
    2. Implement the tool function in agentTools
    3. Add the tool to handle_list_tools()
    4. Implement the tool handling in handle_call_tool()

    Adding New Prompts

    1. Define the prompt structure in PROMPTS
    2. Implement validation in handle_get_prompt()
    3. Add necessary schema validation

    Contributing

    1. Fork the repository
    2. Create your feature branch (git checkout -b feature/AmazingFeature)
    3. Commit your changes (git commit -m 'Add some AmazingFeature')
    4. Push to the branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    License

    This project is licensed under the MIT License - see the LICENSE file for details.

    Related MCP Servers & Clients