mcp_demo

MCP.Pizza Chef: Ming-jiayou

mcp_demo is a simple, cross-platform MCP client built with C# and Avalonia. It connects to various MCP servers, enabling users to leverage AI-powered tools and services seamlessly. Designed as an example project, it demonstrates how to build and interact with MCP servers, supporting multiple platforms with a modern UI framework.

Use This MCP client To

Connect to multiple MCP servers for AI tool access Build custom AI workflows using MCP server tools Test and develop MCP server integrations in C# Create cross-platform AI-enhanced applications Demonstrate MCP client capabilities with Avalonia UI

README

简体中文 | English

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

Introduction

A few days ago, I introduced building a MCPclient in C#.

Recently, I've been learning Avalonia, so I wanted to use Avalonia to implement a simple cross-platform MCP client.

By connecting to someone else's or my own MCP server, I can leverage AI to do many interesting things.

Next, when I have time, I will also share some fun MCP servers with everyone.

Effect

Tools possessed by the connected MCP server:

image-20250318174336737

Utilizing these MCP servers:

duckduckgo_mcp

image-20250318174522899

fetch-mcp

image-20250318175233774

sqlite-mcp

image-20250318175711695

Due to the model, it may not be possible to succeed at once sometimes.

Ask AI the question: "Retrieve all product information from the products table where the shelf life is greater than 30 days".

image-20250318180038096

image-20250318180054915

The Chinese display still has issues, but the data has indeed been retrieved from the database.

Practice

git clone https://github.com/Ming-jiayou/mcp_demo.git

Enter the mcp_demo\MCP-Studio folder, rename ChatModelSettings.json.example to ChatModelSettings.json, and fill in the large model information, for example, with Silicon Flow:

image-20250318181015554

Open mcp_settings.json to configure your MCP server, my example is as follows:

image-20250318181133621

Run the program.

If the MCP server tools can be displayed on the MCP Settings page, it indicates that the server connection is successful.

image-20250318181230749

Now you can play with these MCP servers, but remember to use a model with tool use capabilities!

The complete code has been uploaded to GitHub, located at: https://github.com/Ming-jiayou/mcp_demo.

Recommended Reading

Creating an MCP Client using C#

Let's play with mcp_server_sqlite and have AI help you with CRUD (Create, Read, Update, Delete) operations!

Using fetch_mcp to enable Cline to fetch and retrieve web content.

Create an MCP server and use it in Cline to enhance custom functionality.

mcp_demo FAQ

How do I connect mcp_demo to an MCP server?
You configure the client with the server's endpoint URL to establish a connection.
Is mcp_demo cross-platform?
Yes, it uses Avalonia, enabling it to run on Windows, macOS, and Linux.
Can I use mcp_demo with any MCP server?
Yes, it supports connecting to any compliant MCP server.
What programming language is mcp_demo written in?
It is written in C# using the Avalonia UI framework.
Does mcp_demo support real-time interaction with AI tools?
Yes, it facilitates real-time context exchange and tool usage with connected MCP servers.
Can I extend mcp_demo with additional features?
Yes, as an open example project, you can modify and extend it to suit your needs.
What AI providers can I use with mcp_demo?
It can work with AI providers like OpenAI, Anthropic Claude, and Google Gemini through MCP servers.
Where can I find documentation for mcp_demo?
Documentation is available in the GitHub repository, including English and Simplified Chinese README files.