Cover image
Try Now
2025-04-02

使用C#构建MCP客户端的一个简单示例。

3 years

Works with Finder

1

Github Watches

7

Github Forks

42

Github Stars

简体中文 | 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.

相关推荐

  • 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.

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

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

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

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

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

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

    Reviews

    2 (1)
    Avatar
    user_E2YqWi7y
    2025-04-18

    As an avid user of the mcp_demo application by Ming-jiayou, I am thoroughly impressed with its functionality and user-friendly interface. It has significantly streamlined my workflow, making complex tasks simple and efficient. The helpful welcome information ensures a smooth start, and the intuitive design is a testament to excellent development. Highly recommended for anyone in need of a reliable tool! Check it out here: https://github.com/Ming-jiayou/mcp_demo