Cover image
Try Now
2025-04-14

演示如何使用AI实现MCP客户端。

3 years

Works with Finder

11

Github Watches

2

Github Forks

11

Github Stars

Flutter + dart_mcp + AI Desktop App Demo

This is a Flutter-based project designed to manage and configure MCP (Multi-Connection Protocol) servers. The application provides a user-friendly interface for managing API keys, configuring server settings, and handling custom environment variables. The application uses the dart_mcp package to facilitate communication with MCP servers.

Screenshots

Main UI Settings MCP Server Setting

Features

  • API Key Management: Save, clear, and manage API keys securely using SharedPreferences.
  • MCP Server Management:
    • Add, edit, and delete MCP server configurations.
    • Toggle server connection states.
    • Apply changes to synchronize server connections.
  • Custom Environment Variables: Define and manage custom environment variables for each server.
  • Display Settings: Toggle the visibility of code blocks in chat messages.

Installation

To run this project, ensure you have Flutter SDK installed on your machine. Follow the guidelines.

  1. Clone the repository:

    git clone git@github.com:leehack/flutter-mcp-ai-chat.git
    cd flutter-mcp-ai-chat
    
  2. Install dependencies:

    flutter pub get
    
  3. Run the application:

    flutter run
    

Usage

API Key Management

The API key is necessary to talk to the Gemini model. You can manage your API key through the settings screen. The key can be created from the Google AI Studio.

  1. Navigate to the Settings screen.
  2. Enter your API key in the provided text field.
  3. Click Save Key to store the key locally.
  4. Use the Clear Key button to remove the stored key.

MCP Server Management

The MCP server management feature allows you to add, edit, and delete server configurations. You can also toggle the connection state of each server. At the moment, the application supports only the stdio based servers. For the example of MCP servers you can find from https://github.com/modelcontextprotocol/servers

  1. Add a new server by clicking the Add New MCP Server button.
  2. Fill in the server details, including name, command, arguments, and custom environment variables.
  3. Save the server configuration.
  4. Toggle the server's connection state using the switch in the server list.
  5. Apply changes to synchronize server connections.

Custom Environment Variables

  1. While adding or editing a server, use the Custom Environment Variables section to define key-value pairs.
  2. Add new variables using the Add Variable button.
  3. Remove variables using the delete icon next to each variable.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Commit your changes and push them to your fork.
  4. Submit a pull request with a detailed description of your changes.

License

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

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

  • dmayboroda
  • 带有可配置容器的本地对话抹布

    Reviews

    3.8 (5)
    Avatar
    user_wy0XwIq0
    2025-04-24

    flutter-mcp-ai-chat by leehack is an impressive tool for integrating AI-driven chats in Flutter apps. It provides a seamless experience and easy-to-use interfaces for developers. The setup is straightforward, making it a top choice for enhancing app interactivity. Highly recommended for anyone looking to add intelligent chat capabilities to their applications.

    Avatar
    user_J4u4yaKH
    2025-04-24

    As a dedicated user of flutter-mcp-ai-chat by leehack, I must say this app is revolutionary in AI-driven conversations. The seamless integration and user-friendly interface make it a top choice for anyone looking to enhance their communication tools. Highly recommend giving it a try!

    Avatar
    user_2HnpBYc5
    2025-04-24

    I have been using flutter-mcp-ai-chat by leehack, and it has significantly enhanced my app development experience. The integration is smooth, and the AI functions are impressively intuitive. Highly recommend for anyone looking to elevate their chat app capabilities.

    Avatar
    user_qwVeF8Is
    2025-04-24

    The flutter-mcp-ai-chat by leehack is an impressive tool for developers looking to integrate AI-driven chat functionalities into their applications. The seamless integration and user-friendly interface make it a top choice. Highly recommend!

    Avatar
    user_K05nwsks
    2025-04-24

    I've been using flutter-mcp-ai-chat by leehack and it's been a fantastic experience. The integration is seamless and the AI responses are impressively accurate and engaging. It has significantly enhanced the user interaction in my applications. Highly recommend this for anyone looking to add robust chat functionality without extra hassle!