Discover Awesome MCP Servers

Extend your agent with 84,516 capabilities via MCP servers.

All84,516
mcpserver-semantickernel-client-demo

mcpserver-semantickernel-client-demo

Tentu, berikut adalah implementasi super sederhana dari server MCP (Message Control Protocol) C# yang di-host dengan Aspire dan dikonsumsi oleh Semantic Kernel: **1. Membuat Proyek Aspire (Jika Belum Ada)** Jika Anda belum memiliki proyek Aspire, buatlah proyek baru: ```bash dotnet new aspire -o MyAspireApp cd MyAspireApp ``` **2. Membuat Proyek Server MCP (Minimal)** Buat proyek .NET baru untuk server MCP Anda. Ini akan menjadi proyek API minimal. ```bash dotnet new webapi -o McpServer ``` Tambahkan proyek ini ke solusi Aspire Anda: ```bash dotnet sln add ./McpServer/McpServer.csproj ``` **3. Implementasi Server MCP (McpServer/Program.cs)** Berikut adalah contoh implementasi server MCP yang sangat sederhana. Server ini hanya menerima permintaan POST dan mengembalikan respons sederhana. ```csharp using Microsoft.AspNetCore.Mvc; var builder = WebApplication.CreateBuilder(args); // Tambahkan layanan ke kontainer. builder.Services.AddControllers(); // Pelajari lebih lanjut tentang mengonfigurasi Swagger/OpenAPI di https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); // Konfigurasi pipeline permintaan HTTP. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); // Contoh endpoint MCP sederhana app.MapPost("/mcp", ([FromBody] string request) => { Console.WriteLine($"Menerima permintaan MCP: {request}"); return $"Server MCP memproses: {request}"; }); app.Run(); ``` **Penjelasan:** * **`MapPost("/mcp", ...)`:** Ini mendefinisikan endpoint yang menerima permintaan POST di `/mcp`. * **`[FromBody] string request`:** Ini mengikat isi permintaan (sebagai string) ke parameter `request`. * **`Console.WriteLine(...)`:** Ini mencetak permintaan yang diterima ke konsol server. * **`return $"Server MCP memproses: {request}";`:** Ini mengembalikan respons sederhana yang menunjukkan bahwa permintaan telah diproses. **4. Konfigurasi Aspire untuk Server MCP (AppHost/Program.cs)** Tambahkan proyek McpServer ke AppHost Anda dan konfigurasikan. ```csharp var builder = DistributedApplication.CreateBuilder(args); var mcpServer = builder.AddProject<Projects.McpServer>("mcpserver"); builder.Build().Run(); ``` **Penjelasan:** * **`builder.AddProject<Projects.McpServer>("mcpserver");`:** Ini menambahkan proyek `McpServer` ke aplikasi terdistribusi Aspire. `"mcpserver"` adalah nama logis untuk layanan ini dalam Aspire. **5. Membuat Proyek Konsumen Semantic Kernel** Buat proyek konsol .NET baru untuk Semantic Kernel. ```bash dotnet new console -o SemanticKernelConsumer ``` Tambahkan proyek ini ke solusi Aspire Anda: ```bash dotnet sln add ./SemanticKernelConsumer/SemanticKernelConsumer.csproj ``` **6. Instal Paket NuGet Semantic Kernel** Di proyek `SemanticKernelConsumer`, instal paket NuGet Semantic Kernel: ```bash dotnet add package Microsoft.SemanticKernel --version 1.0.1 dotnet add package Microsoft.Extensions.Http ``` **7. Implementasi Konsumen Semantic Kernel (SemanticKernelConsumer/Program.cs)** Berikut adalah contoh implementasi konsumen Semantic Kernel yang memanggil server MCP. ```csharp using Microsoft.SemanticKernel; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System.Net.Http.Json; // Fungsi untuk mendapatkan URL server MCP dari konfigurasi Aspire static string GetMcpServerUrl() { // Baca konfigurasi dari variabel lingkungan yang diatur oleh Aspire string? mcpServerUrl = Environment.GetEnvironmentVariable("Services__mcpserver__0"); if (string.IsNullOrEmpty(mcpServerUrl)) { Console.WriteLine("Variabel lingkungan Services__mcpserver__0 tidak ditemukan. Pastikan Aspire berjalan."); return "http://localhost:5000"; // Nilai default jika tidak ditemukan } return mcpServerUrl; } // Fungsi untuk memanggil server MCP async static Task<string> CallMcpServer(string request) { using HttpClient client = new(); string mcpServerUrl = GetMcpServerUrl(); Console.WriteLine($"Memanggil server MCP di: {mcpServerUrl}"); try { var response = await client.PostAsJsonAsync($"{mcpServerUrl}/mcp", request); response.EnsureSuccessStatusCode(); // Lempar pengecualian jika kode status bukan 200-299 string responseBody = await response.Content.ReadAsStringAsync(); return responseBody; } catch (HttpRequestException e) { Console.WriteLine($"Pengecualian: {e.Message}"); return $"Error: Gagal memanggil server MCP. {e.Message}"; } } // Fungsi utama async static Task Main(string[] args) { Console.WriteLine("Memulai konsumen Semantic Kernel..."); // Inisialisasi Kernel var kernelBuilder = Kernel.CreateBuilder(); kernelBuilder.Services.AddHttpClient(); // Tambahkan HttpClient Kernel kernel = kernelBuilder.Build(); // Contoh permintaan string userRequest = "Ringkas dokumen ini."; // Panggil server MCP string mcpResponse = await CallMcpServer(userRequest); Console.WriteLine($"Respons dari server MCP: {mcpResponse}"); Console.WriteLine("Selesai."); } ``` **Penjelasan:** * **`GetMcpServerUrl()`:** Fungsi ini membaca URL server MCP dari variabel lingkungan yang diatur oleh Aspire. Aspire secara otomatis mengatur variabel lingkungan untuk layanan yang dikelola. Jika variabel lingkungan tidak ditemukan, ia menggunakan `http://localhost:5000` sebagai nilai default. **Penting:** Aspire akan mengatur variabel lingkungan dengan format `Services__<nama-layanan>__0`. `<nama-layanan>` adalah nama yang Anda berikan ke layanan di `AppHost/Program.cs` (dalam kasus ini, `"mcpserver"`). * **`CallMcpServer(string request)`:** Fungsi ini menggunakan `HttpClient` untuk mengirim permintaan POST ke server MCP. Ia menangani pengecualian dan mengembalikan respons dari server. * **`Main(string[] args)`:** * Membuat instance `Kernel`. * Memanggil `CallMcpServer` dengan permintaan contoh. * Mencetak respons dari server MCP. **8. Konfigurasi Aspire untuk Konsumen Semantic Kernel (AppHost/Program.cs)** Tambahkan proyek `SemanticKernelConsumer` ke `AppHost/Program.cs` dan konfigurasikan agar bergantung pada `McpServer`. ```csharp var builder = DistributedApplication.CreateBuilder(args); var mcpServer = builder.AddProject<Projects.McpServer>("mcpserver"); builder.AddProject<Projects.SemanticKernelConsumer>("semantickernelconsumer") .WithReference(mcpServer); // SemanticKernelConsumer bergantung pada McpServer builder.Build().Run(); ``` **Penjelasan:** * **`.WithReference(mcpServer)`:** Ini menentukan bahwa proyek `SemanticKernelConsumer` bergantung pada proyek `McpServer`. Aspire akan memastikan bahwa `McpServer` dimulai sebelum `SemanticKernelConsumer`. Yang lebih penting, Aspire akan mengatur variabel lingkungan yang diperlukan di `SemanticKernelConsumer` sehingga dapat menemukan URL `McpServer`. **9. Menjalankan Aplikasi Aspire** Jalankan aplikasi Aspire dari direktori `AppHost`: ```bash dotnet run ``` **Cara Kerja:** 1. **Aspire Orchestrates:** Aspire mengelola siklus hidup server MCP dan konsumen Semantic Kernel. 2. **Service Discovery:** Aspire menyediakan mekanisme penemuan layanan. Konsumen Semantic Kernel menggunakan variabel lingkungan yang diatur oleh Aspire untuk menemukan URL server MCP. 3. **Semantic Kernel Consumes:** Konsumen Semantic Kernel menggunakan `HttpClient` untuk memanggil endpoint `/mcp` di server MCP. 4. **MCP Server Processes:** Server MCP menerima permintaan, mencetaknya ke konsol, dan mengembalikan respons sederhana. **Penting:** * **Variabel Lingkungan Aspire:** Perhatikan bagaimana URL server MCP diperoleh dari variabel lingkungan yang diatur oleh Aspire. Ini adalah cara standar untuk melakukan penemuan layanan di lingkungan Aspire. * **Penanganan Kesalahan:** Contoh ini memiliki penanganan kesalahan dasar. Dalam aplikasi produksi, Anda harus menerapkan penanganan kesalahan yang lebih kuat. * **Keamanan:** Contoh ini tidak menyertakan fitur keamanan apa pun. Dalam aplikasi produksi, Anda harus menerapkan autentikasi dan otorisasi. * **Implementasi MCP yang Sebenarnya:** Contoh ini menggunakan endpoint HTTP sederhana sebagai pengganti protokol MCP yang sebenarnya. Untuk implementasi MCP yang sebenarnya, Anda perlu menggunakan soket atau mekanisme komunikasi lain yang sesuai. * **Versi Paket:** Pastikan Anda menggunakan versi paket yang kompatibel. Contoh ini menggunakan `Microsoft.SemanticKernel --version 1.0.1`. **Langkah Selanjutnya:** * **Implementasikan Protokol MCP yang Sebenarnya:** Ganti endpoint HTTP sederhana dengan implementasi protokol MCP yang sebenarnya. * **Integrasikan Semantic Kernel Lebih Dalam:** Gunakan Semantic Kernel untuk memproses permintaan dan respons MCP. * **Tambahkan Fitur Keamanan:** Implementasikan autentikasi dan otorisasi. * **Tingkatkan Penanganan Kesalahan:** Tambahkan penanganan kesalahan yang lebih kuat. * **Gunakan Konfigurasi:** Gunakan konfigurasi untuk mengelola pengaturan aplikasi. Contoh ini memberikan dasar yang sangat sederhana. Anda perlu menyesuaikannya agar sesuai dengan kebutuhan spesifik Anda. Semoga ini membantu!

AstroFabric

AstroFabric

AstroFabric is an agentic AI operating system for growth, revenue and digital operations. Specialist AI agents plan and execute complete missions through metered tools, with enforced budgets, approval-gated writes and full run transcripts. Work runs from the console, REST API, hosted MCP server, schedules, email or chat.

Firecrawl MCP Server

Firecrawl MCP Server

A Model Context Protocol server that enables web scraping, crawling, and content extraction capabilities through integration with Firecrawl.

Workshop

Workshop

Enables LLM clients to query current weather and temperature for a city and simulate sending invitations with confirmation and per-item progress.

mad-invoice-mcp

mad-invoice-mcp

Enables creation and management of invoices with JSON storage and LaTeX-based PDF rendering. Supports draft creation and professional PDF generation through customizable LaTeX templates.

Browser MCP

Browser MCP

Enables MCP clients to control a real local browser window for web automation tasks such as clicking, typing, scrolling, and taking screenshots.

personal-notes-assistant

personal-notes-assistant

Enables querying, listing, and summarizing personal knowledge base documents using RAG with hybrid search and LLM.

Squarespace MCP Server

Squarespace MCP Server

A comprehensive MCP server that enables AI assistants to interact with Squarespace sites, providing 67 tools for website management, e-commerce, content creation, and analytics.

MCP Git Manager

MCP Git Manager

An MCP server that gives AI agents git repository access: status, log, diff, branch, commit, push, pull, tag, stash, remotes — 24 tools, zero dependencies, pure Python stdlib (subprocess).

swagger-openapi-mcp

swagger-openapi-mcp

MCP server for querying Swagger/OpenAPI metadata efficiently from AI tools, enabling fast API discovery, search, and schema inspection.

grantguard-mcp

grantguard-mcp

Enables auditing PostgreSQL role write privileges against a policy file, using read-only tools to explain, describe, and check permissions.

Remote MCP Server Authless

Remote MCP Server Authless

A Cloudflare Workers-based remote Model Context Protocol server that operates without authentication requirements, allowing users to deploy custom AI tools that can be accessed from Claude Desktop or the Cloudflare AI Playground.

x-wing-mcp

x-wing-mcp

An MCP server for X (Twitter) that enables creating posts, threads, likes, follows, and DMs, plus reading posts, timelines, mentions, and search results via a unified OAuth 2.0 connection.

swarm-suite

swarm-suite

An AI engineering team for embedded firmware, lab automation, and hardware drivers. It uses 53 specialized experts and a datasheet-to-release pipeline to produce auditable, hardware-aware code.

SQL-Server-MCP

SQL-Server-MCP

MCP DataFrame QA

MCP DataFrame QA

A research-informed MCP server that enables natural language question answering over local dataframes (CSV, Parquet, or Pandas) with safe, read-only execution and typed analysis plans.

AI-Powered Kubernetes MCP Server

AI-Powered Kubernetes MCP Server

Enables natural-language management of Kubernetes clusters via kubectl-ai and Gemini, providing commands like listing pods, scaling deployments, and retrieving logs through a FastAPI backend.

ai-assimilation-mcp

ai-assimilation-mcp

Enables AI models to securely and structurally assimilate experiences, thoughts, and reasoning processes across different AI systems, fostering intellectual collaboration and evolutionary dialogue.

Gmail AutoAuth MCP Server

Gmail AutoAuth MCP Server

Enables AI assistants to manage Gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label management, filters, and batch operations with automatic OAuth2 authentication.

mem-port

mem-port

A local MCP server that gives AI copilots a shared, portable long-term memory backed by an embedded knowledge graph, with semantic search and export/import capabilities.

Epstein-Files-Plugin

Epstein-Files-Plugin

Enables AI agents to search and query the public DOJ Epstein Files release across 20 databases, resolve EFTA numbers to official DOJ PDFs, and cross-check viral claims against a fact-checked registry.

cloudflare-mcp-server

cloudflare-mcp-server

Enables natural language management of Cloudflare services including Workers, KV, R2, D1, Queues, and more via the Model Context Protocol.

ToolForge MCP Server

ToolForge MCP Server

Enables AI agents to securely discover, execute, and observe tools with role-based access control and audit logging. Serves tools over MCP stdio and HTTP for integration with Claude Desktop, Cursor, and other clients.

Tableau MCP Server

Tableau MCP Server

Connects Claude Desktop to Tableau Server for natural language data analysis and comprehensive administrative capabilities, including user and permission management.

Haru VPS MCP

Haru VPS MCP

A self-hosted MCP gateway that provides filesystem and shell capabilities for an isolated VPS workspace, with strict loopback security and optional authenticated remote access.

lucid-apple-mcp

lucid-apple-mcp

MCP server that gives Claude and local LLMs access to Apple's on-device frameworks — Vision OCR, NSDataDetector, and Apple Intelligence FoundationModels. Everything runs on your Mac with zero data leaving.

CST Studio Orchestrator MCP

CST Studio Orchestrator MCP

Enables AI agents to control CST Studio Suite for 3D electromagnetic simulation, antenna design, and schematic-based field-circuit co-simulation through 177 MCP tools.

crux-mcp

crux-mcp

MCP server for the Chrome UX Report, providing real-user Core Web Vitals (LCP, INP, CLS) and historical trends for any origin or URL via natural language queries.

utekos-docs-mcp-server

utekos-docs-mcp-server

A template for building MCP servers using the xmcp framework, with automatic discovery of tools, prompts, and resources.

whoop-mcp

whoop-mcp

Connects WHOOP fitness tracker data to AI assistants like Claude and ChatGPT, enabling natural language queries about recovery, sleep, strain, and trends.