mcp_demo

This repository demonstrates a simple cross-platform MCP client built with Avalonia/C#. It connects to MCP servers, enabling users to leverage AI for various tasks, showcasing integration with services like DuckDuckGo and SQLite.

43
4

Building a Simple Cross-Platform MCP Client Using Avalonia/C#

Introduction

This project demonstrates building a simple cross-platform MCP (Message Communication Protocol) client using Avalonia and C#. It leverages Avalonia to create a user interface for interacting with MCP servers, enabling users to connect to and utilize AI-powered tools. The goal is to provide a platform for exploring and integrating various MCP servers, whether created by others or self-developed, to perform interesting tasks with AI.

Functionality

The client displays the tools available from connected MCP servers. It showcases integration with several MCP servers, including duckduckgo_mcp, fetch-mcp, and sqlite-mcp. These servers allow the client to perform tasks such as web searches, fetching web content, and querying SQLite databases using natural language. The project acknowledges that model limitations may sometimes lead to unsuccessful queries.

Usage

To use the client, clone the repository, configure the ChatModelSettings.json file with large model information (e.g., using a Spark-based model), and set up the mcp_settings.json file with your MCP server details. After running the application, the MCPSettings page should display the tools from successfully connected MCP servers. The client can then be used to interact with these servers, provided the chosen model supports tool invocation.

The complete code is available on GitHub.

Repository

MI
Ming-jiayou

Ming-jiayou/mcp_demo

Created

March 13, 2025

Updated

March 28, 2025

Language

C#

Category

AI