Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"leaverequestmcpserversse": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
這是一個基於 Model Context Protocol (MCP) 的 ASP.NET Core 伺服器,提供請假管理相關的工具函數。
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in productivity
Dynamic problem-solving through sequential thought chains
Persistent memory using a knowledge graph
mini cli search engine for your docs, knowledge bases, meeting notes, whatever. Tracking current sota approaches while being all local
Local-first AI memory with knowledge graphs and hybrid search. 17+ AI tools via MCP. Free.
MCP Security Weekly
Get CVE alerts and security updates for LeaveRequestMcpServerSSE and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
這是一個基於 Model Context Protocol (MCP) 的 ASP.NET Core 伺服器,提供請假管理相關的工具函數。
本專案實作了一個 MCP 伺服器,透過 Server-Sent Events (SSE) 協定提供以下功能:
McpServer/
├── Program.cs # 主程式進入點與工具定義
├── McpServer.csproj # 專案檔案
├── McpServer.sln # 解決方案檔案
├── appsettings.json # 應用程式設定
├── appsettings.Development.json # 開發環境設定
├── Properties/
│ └── launchSettings.json # 啟動設定
└── .vscode/
└── mcp.json # MCP 客戶端設定
var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddConsole(consoleLogOptions =>
{
consoleLogOptions.LogToStandardErrorThreshold = LogLevel.Trace;
});
builder.Services
.AddMcpServer() // 註冊 MCP 伺服器服務
.WithHttpTransport() // 啟用 HTTP/SSE 傳輸層
.WithToolsFromAssembly(); // 自動掃描並註冊程式集中的工具
AddMcpServer(): 將 MCP 伺服器核心服務加入 DI 容器WithHttpTransport(): 啟用基於 HTTP 的 SSE 傳輸協定WithToolsFromAssembly(): 自動掃描當前程式集中標記 [McpServerTool] 的方法var app = builder.Build();
app.MapMcp(); // 註冊 MCP 端點(通常為 /sse 和對應的 POST endpoint)
app.Run();
MapMcp(): 自動對應 MCP 所需的端點路由此靜態類別包含所有請假相關的工具函數,使用 [McpServerToolType] 標記以供 MCP 自動掃描。
[McpServerTool, Description("取得請假天數")]
public static int GetLeaveRecordAmount(
[Description("要查詢請假天數的員工名稱")] string employeeName)
{
if (employeeName.ToLower() == "david")
return 5;
else if (employeeName.ToLower() == "eric")
return 6;
else
return 3;
}
功能說明:
employeeName - 員工姓名(不區分大小寫)[McpServerTool, Description("進行請假,回傳結果")]
public static string LeaveRequest(
[Description("請假起始日期")] string 請假起始日期,
[Description("請假天數")] int 天數,
[Description("請假事由")] string 請假事由,
[Description("代理人")] string 代理人,
[Description("請假者姓名")] string 請假者姓名)
功能說明:
請假起始日期: 請假開始的日期天數: 請假天數請假事由: 請假原因代理人: 職務代理人姓名請假者姓名: 申請人姓名[McpServerTool, Description("取得今天日期")]
public static string GetCurrentDate()
{
return DateTime.UtcNow.AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
}
功能說明:
dotnet restore
dotnet run
預設會在 http://localhost:5177 啟動伺服器。
在 .vscode/mcp.json 中設定連線資訊:
{
"servers": {
"leave-request": {
"type": "sse",
"url": "https://your-server-url/sse"
}
}
}
透過支援 MCP 的客戶端(如 GitHub Copilot),可以自然語言查詢:
GetLeaveRecordAmount("eric") → 回傳 6LeaveRequest(...)GetCurrentDate()[McpServerToolType]: 標記類別為 MCP 工具容器[McpServerTool]: 標記方法為 MCP 工具函數[Description(...)]: 提供工具或參數的說明,幫助 AI 理解用途專案設定將所有日誌輸出到標準錯誤串流 (stderr),便於除錯和監控。
目前的實作為示範性質,建議進行以下改進:
資料持久化
身份驗證與授權
業務邏輯增強
錯誤處理