Command Palette

Search for a command to run...

UnylyUnyly
Browse all

McpClientServerExample

FreeNot checked

A simple .NET implementation of an MCP (Model Context Protocol) Client and Server example. This project demonstrates how to create and interact with an MCP serv

GitHubEmbed

About

A simple .NET implementation of an MCP (Model Context Protocol) Client and Server example. This project demonstrates how to create and interact with an MCP server using custom tools, natural language prompts, and standard I/O transport.

README

McpClientServerExample 是一個基於 Model Context Protocol (MCP) 的範例專案,展示了如何實現客戶端與伺服器之間的通訊。此專案包含兩個主要部分:McpClientMcpServer,分別代表客戶端與伺服器。

用自製的Client,以不使用Claude Client App 為範例

功能

客戶端 (McpClient)

  • 使用 ModelContextProtocol.Client 與伺服器通訊。
  • 支援 OpenAI GPT 模型進行對話。
  • 提供工具列表並支援工具函數調用。

伺服器 (McpServer)

  • 使用 ModelContextProtocol.Server 提供 MCP 伺服器功能。
  • 支援標準輸入/輸出通訊。
  • 提供內建工具,例如:
    • Echo: 回傳用戶輸入的訊息。
    • ReverseEcho: 回傳用戶輸入訊息的反轉版本。

安裝與執行

需求

export OPENAI_API_KEY=your_api_key_here

執行

dotnet run --project client/McpClient.csproj

使用範例

sample

from github.com/dks50217/McpClientServerExample

Installing McpClientServerExample

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/dks50217/McpClientServerExample

FAQ

Is McpClientServerExample MCP free?

Yes, McpClientServerExample MCP is free — one-click install via Unyly at no cost.

Does McpClientServerExample need an API key?

No, McpClientServerExample runs without API keys or environment variables.

Is McpClientServerExample hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install McpClientServerExample in Claude Desktop, Claude Code or Cursor?

Open McpClientServerExample on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare McpClientServerExample with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs