{"id":11392,"date":"2025-08-04T11:22:27","date_gmt":"2025-08-04T02:22:27","guid":{"rendered":"https:\/\/www.moonmile.net\/blog\/?p=11392"},"modified":"2025-08-05T16:32:39","modified_gmt":"2025-08-05T07:32:39","slug":"mcp-server-%e3%81%ae%e8%a9%a6%e4%bd%9c%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b%ef%bc%88c%e7%89%88%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/11392","title":{"rendered":"MCP Server \u306e\u8a66\u4f5c\u3057\u3066\u307f\u308b\uff08C#\u7248\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong> \u76ee\u7684<\/strong><\/h2>\n\n\n\n<p>MCP Server \u306e\u8a66\u4f5c\u3092\u884c\u3044\u3001MCP \u306e\u6a5f\u80fd\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u65e2\u5b58\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092 AI \u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304b\u3089\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b.<\/li>\n\n\n\n<li>\u305f\u3068\u3048\u3070\u300c2025\u5e7408\u670802\u65e5\u306e\u6625\u65e5\u90e8\u306e\u4e88\u7d04\u72b6\u6cc1\u306f\uff1f\u300d\u3068\u30c1\u30e3\u30c3\u30c8\u3067\u8cea\u554f\u3057\u305f\u3068\u304d\u306b\u3001<\/li>\n<\/ul>\n\n\n\n<p>&nbsp; \u65e5\u4ed8\u300c2025\u5e7408\u670802\u65e5\u300d\u3001\u5e97\u8217\u300c\u6625\u65e5\u90e8\u300d\u3092\u898b\u3064\u3051\u51fa\u3057\u3066\u3001\u65e2\u5b58\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u4e88\u7d04\u72b6\u6cc1\u3092\u53d6\u5f97\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u3061\u3087\u3063\u3068\u524d\u306f RAG\uff08Retrieval-Augmented Generation\uff09\u3068\u547c\u3070\u308c\u3066\u3044\u305f\u304c\u3001\u4eca\u306f MCP\uff08Model Context Protocol\uff09\u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3002vscode \u306e Chat \u6a5f\u80fd\u304b\u3089\u7279\u5b9a\u306e MCP Server \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u65e2\u5b58\u306e\u30b7\u30b9\u30c6\u30e0\u3092\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u69cb\u6210<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8211; kkc-webapi: \u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u3092 Laravel \u3067\u5b9f\u88c5\u3057\u305f Web API<br>&nbsp; OpenAPI \u4ed5\u69d8\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u3066\u3001\u3053\u308c\u3092\u4f7f\u3046<\/li>\n\n\n\n<li>&#8211; kkc-mcp-server: MCP Server \u306e\u5b9f\u88c5\uff08\u6a19\u6e96\u5165\u51fa\u529b\u5f62\u5f0f\uff09<br>&nbsp; Chat \u304b\u3089\u306e\u5165\u529b\u3092\u53d7\u3051\u53d6\u308a\u3001\u5fc5\u8981\u306a\u60c5\u5831\u3092 kkc-webapi \u304b\u3089\u53d6\u5f97\u3057\u3066\u3001Chat \u306b\u8fd4\u3059<\/li>\n\n\n\n<li>&#8211; kkc-mcp-server-api: MCP Server \u306e\u5b9f\u88c5\uff08HTTP API \u5f62\u5f0f\uff09<br>&nbsp; Chat \u304b\u3089\u306e\u5165\u529b\u3092\u53d7\u3051\u53d6\u308a\u3001\u5fc5\u8981\u306a\u60c5\u5831\u3092 kkc-webapi \u304b\u3089\u53d6\u5f97\u3057\u3066\u3001Chat \u306b\u8fd4\u3059<\/li>\n\n\n\n<li>&#8211; kkc-mcp-client: MCP Server \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<br>&nbsp; vscode \u306e Chat \u6a5f\u80fd\u3067\u306f\u306a\u304f\u3001\u72ec\u81ea\u306e GUI \u30a2\u30d7\u30ea\u3092\u63d0\u4f9b\u3059\u308b<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>kkc-webapi \u306e\u4f5c\u6210<\/strong><\/h2>\n\n\n\n<p>\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u304c\u72ec\u81ea MVC \u3068 ChakPHP \u306e\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3092 Laravel \u306e Web API \u5f62\u5f0f\u306b\u66f8\u304d\u76f4\u3057\u307e\u3059\u3002\u624b\u4f5c\u696d\u3067\u66f8\u304d\u76f4\u3059\u306e\u306f\u5927\u5909\u306a\u306e\u3067\u3001<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ddl.md \u306e\u4f5c\u6210<\/li>\n\n\n\n<li>openapi.yaml \u306e\u4f5c\u6210<\/li>\n<\/ul>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u65e2\u5b58\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092 CRUD \u3067\u304d\u308b Web API \u3092\u81ea\u52d5\u751f\u6210\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u307e\u3081\u306b php artisan make \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001Claude Sonnet \u3092\u4f7f\u3063\u3066\u4f5c\u6210\u3057\u3066\u3082\u3089\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u793a\u3059\u308b\u3060\u3051\u3067\u5341\u5206\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ddl.md \u306b\u5f93\u3063\u3066 CRUD \u3067\u304d\u308b openapi \u4ed5\u69d8\u3092\u4f5c\u6210\u3057\u3066\u3002<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">openapi.yaml \u306b\u5f93\u3063\u3066 Laravel \u306e Controller \u3092\u4f5c\u6210\u3057\u3066\u3002<\/pre>\n\n\n\n<p>\u5b9f\u969b\u306e\u3068\u3053\u308d\u306f\u3001\u9014\u4e2d\u3067\u30c8\u30fc\u30af\u30f3\u3092\u5fd8\u308c\u3066\u3057\u307e\u3046\u3089\u3057\u304f\u3001\u306a\u3093\u3069\u304b\u4fee\u6b63\u3092\u6307\u793a\u3057\u306a\u3044\u3068\u3051\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082\u624b\u4f5c\u696d\u3067\u3064\u304f\u308b\u3088\u308a\u306f\u308b\u304b\u306b\u65e9\u3044\u3067\u3059\u3002openapi.yaml \u306b\u3064\u3044\u3066\u3082\u3001\u3059\u3079\u3066\u3092\u4e00\u904d\u306b\u4f5c\u6210\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u4e00\u5b9a\u306e\u30ab\u30c6\u30b4\u30ea\u3054\u3068\u306b\u5206\u3051\u3066\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u6307\u793a\u3092\u3059\u308b\u3068\u3046\u307e\u304f\u3044\u304f\u7387\u304c\u9ad8\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3042\u305f\u308a\u3001\u3046\u307e\u304f\u3084\u3089\u3070 Claude Code \u3092\u4f7f\u3063\u3066\u591c\u9593\u30d0\u30c3\u30c1\u7684\u306b\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3057\u3087\u3046\u304c\u3001\u307e\u3042\u3001\u305d\u3053\u307e\u3067\u3057\u306a\u304f\u3066\u3082 Claude Sonnet \u3067\u5341\u5206\u3067\u3057\u3087\u3046\u3002\u4eca\u56de\u306e\u5834\u5408\u306f\u30c6\u30fc\u30d6\u30eb\u6570\u304c20\u5f31\u3050\u3089\u3044\u306a\u306e\u3067\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u6307\u793a\u3092\u3057\u3066\u3044\u307e\u3059\u304c\u3001100\u3092\u8d85\u3048\u308b\u3088\u3046\u306a\u5834\u5408\u306f\u3001ddl.md \u304b\u3089 openapi.yaml \u3092\u4f5c\u6210\u3057\u3066 Laravel \u306e Controller \u3092\u4f5c\u6210\u3059\u308b\u3001\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u3053\u308c\u3092\u300c\u6cbb\u5177\u300d\u3068\u547c\u3076\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u624b\u306e\u4f7f\u3044\u6368\u3066\u306e\u30c4\u30fc\u30eb\u306f\u826f\u304f\u4f5c\u308a\u307e\u3059\u3002\u74b0\u5883\u5909\u6570\u306a\u3069\u306f\u30b3\u30fc\u30c9\u306b\u57cb\u3081\u8fbc\u307f\u306b\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u4ed6\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u3046\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u304c\u3001\u3042\u3048\u3066\u305d\u306e\u3088\u3046\u306a\u6c4e\u7528\u6027\u3092\u6368\u3066\u3066\u3057\u307e\u3063\u3066\u3001\u30b9\u30d4\u30fc\u30c9\u3068\u7cbe\u5ea6\u3092\u512a\u5148\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u3042\u3001\u305d\u3093\u306a\u3053\u3093\u306a\u3067 kkc-webapi \u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>ModelContextProtocol \u306e\u6d3b\u7528<\/strong><\/h2>\n\n\n\n<p>MCP Server \u306e\u5b9f\u88c5\u306b\u3042\u305f\u3063\u3066\u306f\u3001ModelContextProtocol \u3092\u6d3b\u7528\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001Chat \u304b\u3089\u306e\u5165\u529b\u3092\u53d7\u3051\u53d6\u308a\u3001\u5fc5\u8981\u306a\u60c5\u5831\u3092 kkc-webapi \u304b\u3089\u53d6\u5f97\u3057\u3066\u3001Chat \u306b\u8fd4\u3059\u305f\u3081\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3059\u3002\u4ee5\u524d\u306f\u3001JSON \u5f62\u5f0f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u3063\u3066\u3061\u307e\u3061\u307e\u3084\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001ModelContextProtocol \u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3088\u308a\u52b9\u7387\u7684\u306b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u73fe\u5728\u306f\u30d7\u30ec\u30d3\u30e5\u30fc\u7248 0.3.0-preview.3 \u306a\u306e\u304c\u96e3\u70b9\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3002<\/p>\n\n\n\n<p>\u73fe\u72b6\u3067 MCP Server \u306f\u6a19\u6e96\u5165\u51fa\u529b\u578b\u3068 HTTP API \u578b\u306e2\u3064\u306e\u5b9f\u88c5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6a19\u6e96\u5165\u51fa\u529b\u578b: \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u5b9f\u884c\u3057\u3001\u6a19\u6e96\u5165\u529b\u3068\u6a19\u6e96\u51fa\u529b\u3092\u4f7f\u3063\u3066\u3084\u308a\u53d6\u308a\u3059\u308b\u3002<\/li>\n\n\n\n<li>HTTP API \u578b: HTTP \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3059\u5f62\u5f0f\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u3066\u3001ModelContextProtocol \u3092\u4f7f\u3063\u305f\u6a19\u6e96\u5165\u51fa\u529b\u578b\u306e\u578b\u306e\u4f8b\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>Build a Model Context Protocol (MCP) server in C# &#8211; .NET Blog<br><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/build-a-model-context-protocol-mcp-server-in-csharp\/\">https:\/\/devblogs.microsoft.com\/dotnet\/build-a-model-context-protocol-mcp-server-in-csharp\/<\/a><\/p>\n\n\n\n<p>\u305f\u3060\u3057\u3001\u3053\u306e\u6a19\u6e96\u5165\u51fa\u529b\u578b\u306b\u306f\u96e3\u70b9\u304c\u3042\u3063\u3066\u3001\u30b9\u30c8\u30ea\u30fc\u30e0\u5f62\u5f0f\u306a\u306e\u3067\u30ed\u30fc\u30ab\u30eb\u306a MCP Server \u3092\u5efa\u3066\u308b\u5fc5\u8981\u304c\uff08\u305f\u3076\u3093\uff09\u3042\u308a\u307e\u3059\u3002\u30ec\u30b9\u30dd\u30f3\u30b9\uff06\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u4e00\u9023\u306e\u30b9\u30c8\u30ea\u30fc\u30e0\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30a8\u30e9\u30fc\u3092\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u9069\u5f53\u306b\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u5fc5\u8981\u304c\u3067\u3066\u304d\u307e\u3059\u3002\u304a\u624b\u8efd\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3042\u307e\u308a\u5b9f\u7528\u7684\u3067\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u6700\u521d\u306b\u6a19\u6e96\u5165\u51fa\u529b\u578b\u3092\u5b9f\u88c5\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001\u3042\u307e\u308a\u3046\u307e\u304f\u62e1\u5f35\u3067\u304d\u306a\u3044\u306e\u3067 HTTP API \u578b\u306e kkc-mcp-server-api \u3067\u5b9f\u88c5\u3057\u306a\u304a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u306f\u5b9f\u88c5\u81ea\u4f53\u306f\u3042\u307e\u308a\u624b\u9593\u3067\u306f\u306a\u304f\u3066\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dotnet new console<\/pre>\n\n\n\n<p>\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u305f\u5f8c\u306b\u3001\u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4f5c\u6210\u3057\u3066\u8cb0\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5185\u90e8\u3067 kkc-webapi \u3092\u547c\u3073\u51fa\u3059 MCP Server \u3092\u4f5c\u6210\u3057\u3066\u3002<\/pre>\n\n\n\n<p>kkc-mcp-server \u306f\u3001vscode \u306e\u30c1\u30e3\u30c3\u30c8\u3068 OpenAPI \u306e kkc-webapi \u3092\u7e4b\u3050\u5f79\u76ee\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u52d5\u4f5c\u72b6\u6cc1<\/strong><\/h2>\n\n\n\n<p>\u4f5c\u6210\u3057\u305f\u30b3\u30fc\u30c9\u306f\u3055\u3066\u304a\u304d\u3001vscode \u306e Chat \u304b\u3089\u3069\u3046\u3044\u3046\u98a8\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\u306e\u304b\u3092\u898b\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"116\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image.png\" alt=\"\" class=\"wp-image-11393\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image.png 694w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-300x50.png 300w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/a><\/figure>\n\n\n\n<p>\u306a\u305c\u304b\u3001powershell \u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3088\u3046\u3068\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u304c HTTP API \u578b\u306e\u305f\u3081\u306a\u306e\u304b\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/20250804_03.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"305\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/20250804_03.jpg\" alt=\"\" class=\"wp-image-11395\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/20250804_03.jpg 728w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/20250804_03-300x126.jpg 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><\/figure>\n\n\n\n<p>\u3072\u3068\u307e\u305a\u3001\u81ea\u524d\u306e MCP Server \u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u306f\u3067\u304d\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"305\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-2.png\" alt=\"\" class=\"wp-image-11396\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-2.png 728w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-2-300x126.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><\/figure>\n\n\n\n<p>\u5b9f\u969b\u306b\u5229\u7528\u3059\u308b\u3068\u304d\u306f\u3001vscode \u306e Chat \u6a5f\u80fd\u3067\u306f\u306a\u304f\u3066\u3001\u9069\u5f53\u306a\u30d6\u30e9\u30a6\u30b6\u30a2\u30d7\u30ea\u304b\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u3092\u4f5c\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u3053\u306e\u3042\u305f\u308a\u306f\u3082\u3046\u3061\u3087\u3063\u3068\u4f5c\u308a\u8fbc\u307f\u304c\u5fc5\u8981\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u30b3\u30de\u30f3\u30c9\u30d1\u30ec\u30c3\u30c8\u304b\u3089\u3001MCP Server \u3092\u6307\u5b9a<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"228\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-3.png\" alt=\"\" class=\"wp-image-11397\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-3.png 648w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2025\/08\/image-3-300x106.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><\/figure>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u30d1\u30ec\u30c3\u30c8\u3067\u300cMCP \u30b5\u30fc\u30d0\u30fc\u306e\u8ffd\u52a0\u300d\u3092\u898b\u3064\u3051\u51fa\u3057\u3066\u3001\u300c\u30b3\u30de\u30f3\u30c9\uff08stdio\uff09\u300d\u304b\u300cHTTP\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6a19\u6e96\u5165\u51fa\u529b\u578b\u306e stdio \u306e\u307b\u3046\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u304c\u3057\u3065\u3089\u3044\u306e\u3067\u3001\u3042\u308b\u7a0b\u5ea6 HTTP API \u578b\u306e\u3088\u3046\u3067\u8abf\u7bc0\u3092\u3057\u3066\u3044\u304b\u3089\u3001stdio \u306e\u307b\u3046\u306b\u623b\u3057\u305f\u307b\u3046\u304c\u3088\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u79c1\u306e\u73fe\u72b6\u306e\u74b0\u5883\u3067\u306f\u3001\u307e\u3060 HTTP API \u578b\u306e MCP Server \u304b\u3089 kkc-webapi \u306e\u307b\u3046\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u304c\u6b63\u78ba\u306b\u308f\u305f\u3063\u3066\u3044\u306a\u304f\u3066\u3001\u5b8c\u6210\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u8fd1\u3044\u3046\u3061\u306b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>MCP Server \u306e\u547c\u3073\u51fa\u3057<\/strong><\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$request = @{\n    jsonrpc = &quot;2.0&quot;\n    id = &quot;1&quot;\n    method = &quot;tools\/call&quot;\n    params = @{\n        name = &quot;search_reservations_by_name&quot;\n        arguments = @{\n            Store = &quot;\u6625\u65e5\u90e8&quot;\n            ReservationDate = &quot;2025-08-02&quot;\n        }\n    }\n} | ConvertTo-Json -Depth 10\n\n$response = Invoke-RestMethod -Uri &quot;http:\/\/localhost:5000&quot; -Method Post -Body $request -ContentType &quot;application\/json&quot;\nWrite-Host &quot;=== 2025\u5e7408\u670802\u65e5 \u6625\u65e5\u90e8\u5e97\u306e\u4e88\u7d04\u72b6\u6cc1 ===&quot; -ForegroundColor Green\n$response | ConvertTo-Json -Depth 10\n<\/code><\/pre><\/div>\n\n\n\n<p>Chat \u304c MCP Server \u3092\u547c\u3073\u51fa\u3059\u3068\u304d\u306e\u30b3\u30de\u30f3\u30c9\u3092\u898b\u308b\u3068\u89e3\u308b\u306e\u3067\u3059\u304c\u3001jsonrpc \u5f62\u5f0f\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3066\u3044\u307e\u3059\u3002vscode \u306e Chat \u90e8\u5206\u3067\u300c2025\u5e7408\u670802\u65e5\u306e\u300c\u6625\u65e5\u90e8\u300d\u306e\u4e88\u7d04\u72b6\u6cc1\u3092\u793a\u3057\u3066\u3002\u300d\u3068\u5165\u529b\u3059\u308b\u3068\u3001\u3046\u307e\u304f JSON RPC \u5f62\u5f0f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5909\u63db\u3057\u3066\u304f\u308c\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u306e\u305f\u3081\u306b\u3001\u30e6\u30fc\u30b6\u30fc\u306f search_reservations_by_name \u306a\u3069\u306e\u95a2\u6570\u540d\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u81ea\u7136\u8a00\u8a9e\u3092\u4f7f\u3063\u3066\u6307\u793a\u3092\u4e0e\u3048\u308b\u3042\u308b\u3044\u306f\u8cea\u554f\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3042\u305f\u308a\u3067 Chat \u5f62\u5f0f\u306e\u30e6\u30fc\u30b6\u2015\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u5909\u308f\u3063\u3066\u304f\u308b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u3042\u3001\u3082\u3063\u3068\u3082\u3001\u4e88\u7d04\u306e\u30c1\u30a7\u30c3\u30af\u306e\u3088\u3046\u306b\u753b\u9762\u3067\u4f55\u304b\u3092\u9078\u629e\u3059\u308b\u307b\u3046\u304c\u65e9\u3044\u5834\u5408\u3082\u3042\u308b\u306e\u3067\u3001\u3053\u306e\u30c1\u30e3\u30c3\u30c8\u5f62\u5f0f\u3082\u5584\u3057\u3042\u3057\u3067\u3042\u3042\u308b\u306e\u3067\u3059\u304c\u3002JR \u306e\u5fd8\u308c\u7269\u306e\u554f\u3044\u5408\u308f\u305b\u306e\u3088\u3046\u306a\u691c\u7d22\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\u306f\u3001\u5165\u529b\u3059\u308b\u9805\u76ee\u3092\u3046\u307e\u304f\u8a98\u5c0e\u3059\u308b\u305f\u3081\u306b\u3053\u306e\u624b\u306e\u30c1\u30e3\u30c3\u30c8\u5f62\u5f0f\u304c\u6709\u52b9\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">kkc-mcp-server-api <\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Program.cs<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>using System.Text.Json;\nusing KkcMcpServerApi.Models;\nusing KkcMcpServerApi.Services;\nusing Microsoft.OpenApi.Models;\n\nvar builder = WebApplication.CreateBuilder(args);\n\n\/\/ \u30ed\u30ae\u30f3\u30b0\u8a2d\u5b9a\nbuilder.Logging.ClearProviders();\nbuilder.Logging.AddConsole();\nbuilder.Logging.SetMinimumLevel(LogLevel.Information);\n\n\/\/ \u30b5\u30fc\u30d3\u30b9\u767b\u9332\nbuilder.Services.AddEndpointsApiExplorer();\nbuilder.Services.AddSwaggerGen(c =&gt;\n{\n    c.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo \n    { \n        Title = &quot;KKC MCP Server API&quot;, \n        Version = &quot;v1&quot;,\n        Description = &quot;Model Context Protocol (MCP) \u30b5\u30fc\u30d0\u30fcAPI - kkc-webapi \u306e\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u52d5\u4f5c\u3057\u307e\u3059&quot;\n    });\n});\n\n\/\/ HttpClient\u8a2d\u5b9a\nbuilder.Services.AddHttpClient&lt;IWebApiClient, WebApiClient&gt;(client =&gt;\n{\n    client.BaseAddress = new Uri(&quot;http:\/\/localhost:8000&quot;);\n    client.Timeout = TimeSpan.FromSeconds(30);\n});\n\n\/\/ MCP\u30c4\u30fc\u30eb\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u767b\u9332\nbuilder.Services.AddScoped&lt;McpToolProvider&gt;();\n\n\/\/ CORS\u8a2d\u5b9a\nbuilder.Services.AddCors(options =&gt;\n{\n    options.AddDefaultPolicy(policy =&gt;\n    {\n        policy.AllowAnyOrigin()\n              .AllowAnyMethod()\n              .AllowAnyHeader();\n    });\n});\n\nvar app = builder.Build();\n\napp.UseCors();\n\n\/\/ MCP over HTTP \u306e\u30eb\u30fc\u30c8\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\napp.MapPost(&quot;\/&quot;, async (HttpContext context, McpToolProvider toolProvider) =&gt;\n{\n    try\n    {\n        using var reader = new StreamReader(context.Request.Body);\n        var jsonRequest = await reader.ReadToEndAsync();\n        \n        var requestDoc = JsonDocument.Parse(jsonRequest);\n        var root = requestDoc.RootElement;\n        \n        if (!root.TryGetProperty(&quot;method&quot;, out var methodElement))\n        {\n            return Results.BadRequest(new { error = &quot;Missing method property&quot; });\n        }\n        \n        var method = methodElement.GetString();\n        var id = root.TryGetProperty(&quot;id&quot;, out var idElement) ? idElement.GetString() : null;\n        \n        object? response = method switch\n        {\n            &quot;initialize&quot; =&gt; new\n            {\n                jsonrpc = &quot;2.0&quot;,\n                id = id,\n                result = new\n                {\n                    protocolVersion = &quot;2024-11-05&quot;,\n                    capabilities = new\n                    {\n                        tools = new { }\n                    },\n                    serverInfo = new\n                    {\n                        name = &quot;kkc-mcp-server-api&quot;,\n                        version = &quot;1.0.0&quot;\n                    }\n                }\n            },\n            &quot;tools\/list&quot; =&gt; new\n            {\n                jsonrpc = &quot;2.0&quot;,\n                id = id,\n                result = new\n                {\n                    tools = new object[]\n                    {\n                        new\n                        {\n                            name = &quot;search_reservations&quot;,\n                            description = &quot;\u4e88\u7d04\u3092\u691c\u7d22\u3057\u307e\u3059\uff08ID\u6307\u5b9a\uff09&quot;,\n                            inputSchema = new\n                            {\n                                type = &quot;object&quot;,\n                                properties = new\n                                {\n                                    storeId = new { type = &quot;integer&quot;, description = &quot;\u5e97\u8217ID&quot; },\n                                    reservationDate = new { type = &quot;string&quot;, description = &quot;\u4e88\u7d04\u65e5 (YYYY-MM-DD)&quot; },\n                                    customerName = new { type = &quot;string&quot;, description = &quot;\u9867\u5ba2\u540d&quot; },\n                                    limit = new { type = &quot;integer&quot;, description = &quot;\u53d6\u5f97\u4ef6\u6570&quot;, @default = 10 }\n                                }\n                            }\n                        },\n                        new\n                        {\n                            name = &quot;search_reservations_by_name&quot;,\n                            description = &quot;\u4e88\u7d04\u3092\u691c\u7d22\u3057\u307e\u3059\uff08\u540d\u524d\u6307\u5b9a\uff09&quot;,\n                            inputSchema = new\n                            {\n                                type = &quot;object&quot;,\n                                properties = new\n                                {\n                                    store = new { type = &quot;string&quot;, description = &quot;\u5e97\u8217\u540d&quot; },\n                                    areaGroup = new { type = &quot;string&quot;, description = &quot;\u30a8\u30ea\u30a2\u30b0\u30eb\u30fc\u30d7\u540d&quot; },\n                                    customerName = new { type = &quot;string&quot;, description = &quot;\u9867\u5ba2\u540d&quot; },\n                                    reservationDate = new { type = &quot;string&quot;, description = &quot;\u4e88\u7d04\u65e5 (YYYY-MM-DD)&quot; },\n                                    limit = new { type = &quot;integer&quot;, description = &quot;\u53d6\u5f97\u4ef6\u6570&quot;, @default = 10 }\n                                }\n                            }\n                        },\n                        new\n                        {\n                            name = &quot;get_calendar&quot;,\n                            description = &quot;\u30ab\u30ec\u30f3\u30c0\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u3057\u307e\u3059&quot;,\n                            inputSchema = new\n                            {\n                                type = &quot;object&quot;,\n                                properties = new\n                                {\n                                    date = new { type = &quot;string&quot;, description = &quot;\u65e5\u4ed8 (YYYY-MM-DD)&quot; },\n                                    areaGroupId = new { type = &quot;integer&quot;, description = &quot;\u30a8\u30ea\u30a2\u30b0\u30eb\u30fc\u30d7ID&quot; }\n                                },\n                                required = new[] { &quot;date&quot;, &quot;areaGroupId&quot; }\n                            }\n                        }\n                    }\n                }\n            },\n            &quot;tools\/call&quot; =&gt; await HandleToolCall(root, toolProvider, id),\n            _ =&gt; new\n            {\n                jsonrpc = &quot;2.0&quot;,\n                id = id,\n                error = new\n                {\n                    code = -32601,\n                    message = $&quot;Method not found: {method}&quot;\n                }\n            }\n        };\n        \n        return Results.Json(response);\n    }\n    catch (Exception ex)\n    {\n        return Results.Json(new\n        {\n            jsonrpc = &quot;2.0&quot;,\n            error = new\n            {\n                code = -32603,\n                message = &quot;Internal error&quot;,\n                data = ex.Message\n            }\n        });\n    }\n});\n\nasync Task&lt;object&gt; HandleToolCall(JsonElement root, McpToolProvider toolProvider, string? id)\n{\n    try\n    {\n        if (!root.TryGetProperty(&quot;params&quot;, out var paramsElement))\n        {\n            return new\n            {\n                jsonrpc = &quot;2.0&quot;,\n                id = id,\n                error = new { code = -32602, message = &quot;Missing params&quot; }\n            };\n        }\n        \n        if (!paramsElement.TryGetProperty(&quot;name&quot;, out var nameElement))\n        {\n            return new\n            {\n                jsonrpc = &quot;2.0&quot;,\n                id = id,\n                error = new { code = -32602, message = &quot;Missing tool name&quot; }\n            };\n        }\n        \n        var toolName = nameElement.GetString();\n        var arguments = paramsElement.TryGetProperty(&quot;arguments&quot;, out var argsElement) \n            ? argsElement.GetRawText() \n            : &quot;{}&quot;;\n        \n        var result = toolName switch\n        {\n            &quot;search_reservations&quot; =&gt; await toolProvider.CallToolAsync(toolName, JsonSerializer.Deserialize&lt;Dictionary&lt;string, object&gt;&gt;(arguments)),\n            &quot;search_reservations_by_name&quot; =&gt; await toolProvider.CallToolAsync(toolName, JsonSerializer.Deserialize&lt;Dictionary&lt;string, object&gt;&gt;(arguments)),\n            &quot;get_calendar&quot; =&gt; await toolProvider.CallToolAsync(toolName, JsonSerializer.Deserialize&lt;Dictionary&lt;string, object&gt;&gt;(arguments)),\n            _ =&gt; throw new ArgumentException($&quot;Unknown tool: {toolName}&quot;)\n        };\n        \n        return new\n        {\n            jsonrpc = &quot;2.0&quot;,\n            id = id,\n            result = new\n            {\n                content = result.Content.Select(c =&gt; new\n                {\n                    type = c.Type,\n                    text = c.Text\n                }).ToArray()\n            }\n        };\n    }\n    catch (Exception ex)\n    {\n        return new\n        {\n            jsonrpc = &quot;2.0&quot;,\n            id = id,\n            error = new\n            {\n                code = -32603,\n                message = &quot;Tool execution failed&quot;,\n                data = ex.Message\n            }\n        };\n    }\n}\n\n\/\/ \u65e2\u5b58\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3082\u4fdd\u6301\uff08\u958b\u767a\u30fb\u30c6\u30b9\u30c8\u7528\uff09\napp.MapGet(&quot;\/health&quot;, () =&gt; Results.Ok(new { status = &quot;healthy&quot;, timestamp = DateTime.UtcNow }));\n\napp.MapGet(&quot;\/info&quot;, () =&gt; Results.Ok(new { \n    name = &quot;KKC MCP Server API&quot;,\n    version = &quot;1.0.0&quot;,\n    description = &quot;ASP.NET Core Minimal API - MCP Server&quot;,\n    endpoints = new[] { &quot;\/&quot;, &quot;\/health&quot;, &quot;\/info&quot; }\n}));\n\nif (app.Environment.IsDevelopment())\n{\n    app.UseSwagger();\n    app.UseSwaggerUI();\n}\n\napp.Run();\n<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">McpToolProvider.cs<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>using System.Text.Json;\nusing KkcMcpServerApi.Models;\n\nnamespace KkcMcpServerApi.Services;\n\n\/\/\/ &lt;summary&gt;\n\/\/\/ MCP\u30c4\u30fc\u30eb\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\n\/\/\/ &lt;\/summary&gt;\npublic class McpToolProvider\n{\n    private readonly IWebApiClient _webApiClient;\n    private readonly ILogger&lt;McpToolProvider&gt; _logger;\n\n    public McpToolProvider(IWebApiClient webApiClient, ILogger&lt;McpToolProvider&gt; logger)\n    {\n        _webApiClient = webApiClient;\n        _logger = logger;\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u5229\u7528\u53ef\u80fd\u306a\u30c4\u30fc\u30eb\u306e\u4e00\u89a7\u3092\u53d6\u5f97\n    \/\/\/ &lt;\/summary&gt;\n    public ToolsListResult GetToolsList()\n    {\n        var tools = new List&lt;ToolInfo&gt;\n        {\n            new ToolInfo\n            {\n                Name = &quot;search_reservations&quot;,\n                Description = &quot;\u4e88\u7d04\u3092\u691c\u7d22\u3057\u307e\u3059\u3002\u8907\u6570\u306e\u6761\u4ef6\u3067\u7d5e\u308a\u8fbc\u307f\u691c\u7d22\u304c\u53ef\u80fd\u3067\u3059\u3002&quot;,\n                InputSchema = new\n                {\n                    type = &quot;object&quot;,\n                    properties = new\n                    {\n                        customerName = new { type = &quot;string&quot;, description = &quot;\u9867\u5ba2\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        customerNameKana = new { type = &quot;string&quot;, description = &quot;\u9867\u5ba2\u540d\u30ab\u30ca\u3067\u306e\u691c\u7d22&quot; },\n                        phoneNumber = new { type = &quot;string&quot;, description = &quot;\u96fb\u8a71\u756a\u53f7\u3067\u306e\u691c\u7d22&quot; },\n                        email = new { type = &quot;string&quot;, description = &quot;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u306e\u691c\u7d22&quot; },\n                        receptionDate = new { type = &quot;string&quot;, description = &quot;\u53d7\u4ed8\u65e5\u3067\u306e\u691c\u7d22\uff08YYYY-MM-DD\u5f62\u5f0f\uff09&quot; },\n                        areaGroupId = new { type = &quot;integer&quot;, description = &quot;\u30a8\u30ea\u30a2\u30b0\u30eb\u30fc\u30d7ID\u3067\u306e\u691c\u7d22&quot; },\n                        storeId = new { type = &quot;integer&quot;, description = &quot;\u5e97\u8217ID\u3067\u306e\u691c\u7d22&quot; },\n                        reservationDate = new { type = &quot;string&quot;, description = &quot;\u4e88\u7d04\u65e5\u3067\u306e\u691c\u7d22\uff08YYYY-MM-DD\u5f62\u5f0f\uff09&quot; },\n                        timeZone = new { type = &quot;string&quot;, description = &quot;\u6642\u9593\u5e2f\u3067\u306e\u691c\u7d22&quot; },\n                        status = new { type = &quot;string&quot;, description = &quot;\u4e88\u7d04\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u306e\u691c\u7d22&quot; },\n                        page = new { type = &quot;integer&quot;, description = &quot;\u30da\u30fc\u30b8\u756a\u53f7\uff08\u30c7\u30d5\u30a9\u30eb\u30c8: 1\uff09&quot; },\n                        perPage = new { type = &quot;integer&quot;, description = &quot;1\u30da\u30fc\u30b8\u3042\u305f\u308a\u306e\u4ef6\u6570\uff08\u30c7\u30d5\u30a9\u30eb\u30c8: 10\uff09&quot; }\n                    }\n                }\n            },\n            new ToolInfo\n            {\n                Name = &quot;search_reservations_by_name&quot;,\n                Description = &quot;\u8ca9\u58f2\u4f1a\u793e\u540d\u3001\u5e97\u8217\u540d\u3001\u30a8\u30ea\u30a2\u30b0\u30eb\u30fc\u30d7\u540d\u306a\u3069\u306e\u540d\u524d\u3092\u4f7f\u7528\u3057\u3066\u4e88\u7d04\u3092\u691c\u7d22\u3057\u307e\u3059\u3002&quot;,\n                InputSchema = new\n                {\n                    type = &quot;object&quot;,\n                    properties = new\n                    {\n                        sellingCompany = new { type = &quot;string&quot;, description = &quot;\u8ca9\u58f2\u4f1a\u793e\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        store = new { type = &quot;string&quot;, description = &quot;\u5e97\u8217\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        areaGroup = new { type = &quot;string&quot;, description = &quot;\u30a8\u30ea\u30a2\u30b0\u30eb\u30fc\u30d7\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        customerName = new { type = &quot;string&quot;, description = &quot;\u9867\u5ba2\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        phoneNumber = new { type = &quot;string&quot;, description = &quot;\u96fb\u8a71\u756a\u53f7\u3067\u306e\u691c\u7d22&quot; },\n                        email = new { type = &quot;string&quot;, description = &quot;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u306e\u691c\u7d22&quot; },\n                        acceptanceDate = new { type = &quot;string&quot;, description = &quot;\u53d7\u4ed8\u65e5\u3067\u306e\u691c\u7d22\uff08YYYY-MM-DD\u5f62\u5f0f\uff09&quot; },\n                        reservationDate = new { type = &quot;string&quot;, description = &quot;\u4e88\u7d04\u65e5\u3067\u306e\u691c\u7d22\uff08YYYY-MM-DD\u5f62\u5f0f\uff09&quot; },\n                        timeZone = new { type = &quot;string&quot;, description = &quot;\u6642\u9593\u5e2f\u3067\u306e\u691c\u7d22&quot; },\n                        model = new { type = &quot;string&quot;, description = &quot;\u8eca\u7a2e\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        plateNumber = new { type = &quot;string&quot;, description = &quot;\u767b\u9332\u756a\u53f7\u3067\u306e\u691c\u7d22&quot; },\n                        color = new { type = &quot;string&quot;, description = &quot;\u5857\u8272\u540d\u3067\u306e\u691c\u7d22&quot; },\n                        remarks = new { type = &quot;string&quot;, description = &quot;\u5099\u8003\u3067\u306e\u691c\u7d22&quot; },\n                        page = new { type = &quot;integer&quot;, description = &quot;\u30da\u30fc\u30b8\u756a\u53f7\uff08\u30c7\u30d5\u30a9\u30eb\u30c8: 1\uff09&quot; },\n                        limit = new { type = &quot;integer&quot;, description = &quot;1\u30da\u30fc\u30b8\u3042\u305f\u308a\u306e\u4ef6\u6570\uff08\u30c7\u30d5\u30a9\u30eb\u30c8: 10\uff09&quot; }\n                    }\n                }\n            },\n            new ToolInfo\n            {\n                Name = &quot;get_calendar&quot;,\n                Description = &quot;\u6307\u5b9a\u3057\u305f\u65e5\u4ed8\u306e\u4e88\u7d04\u30ab\u30ec\u30f3\u30c0\u30fc\u60c5\u5831\u3068\u7a7a\u304d\u72b6\u6cc1\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002&quot;,\n                InputSchema = new\n                {\n                    type = &quot;object&quot;,\n                    properties = new\n                    {\n                        date = new { type = &quot;string&quot;, description = &quot;\u30ab\u30ec\u30f3\u30c0\u30fc\u8868\u793a\u3059\u308b\u65e5\u4ed8\uff08YYYY-MM-DD\u5f62\u5f0f\uff09&quot; },\n                        areaGroupId = new { type = &quot;integer&quot;, description = &quot;\u30a8\u30ea\u30a2\u30b0\u30eb\u30fc\u30d7ID\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09&quot; },\n                        storeId = new { type = &quot;integer&quot;, description = &quot;\u5e97\u8217ID\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09&quot; }\n                    },\n                    required = new[] { &quot;date&quot; }\n                }\n            }\n        };\n\n        return new ToolsListResult { Tools = tools };\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u6307\u5b9a\u3055\u308c\u305f\u30c4\u30fc\u30eb\u3092\u5b9f\u884c\n    \/\/\/ &lt;\/summary&gt;\n    public async Task&lt;ToolCallResult&gt; CallToolAsync(string toolName, Dictionary&lt;string, object&gt;? arguments)\n    {\n        try\n        {\n            _logger.LogInformation(&quot;Calling tool: {ToolName} with arguments: {Arguments}&quot;, \n                toolName, JsonSerializer.Serialize(arguments));\n\n            string result = toolName switch\n            {\n                &quot;search_reservations&quot; =&gt; await CallSearchReservationsAsync(arguments),\n                &quot;search_reservations_by_name&quot; =&gt; await CallSearchReservationsByNameAsync(arguments),\n                &quot;get_calendar&quot; =&gt; await CallGetCalendarAsync(arguments),\n                _ =&gt; throw new ArgumentException($&quot;Unknown tool: {toolName}&quot;)\n            };\n\n            return new ToolCallResult\n            {\n                Content = new List&lt;ToolContent&gt;\n                {\n                    new ToolContent { Type = &quot;text&quot;, Text = result }\n                },\n                IsError = false\n            };\n        }\n        catch (Exception ex)\n        {\n            _logger.LogError(ex, &quot;Error calling tool: {ToolName}&quot;, toolName);\n            return new ToolCallResult\n            {\n                Content = new List&lt;ToolContent&gt;\n                {\n                    new ToolContent { Type = &quot;text&quot;, Text = $&quot;Error: {ex.Message}&quot; }\n                },\n                IsError = true\n            };\n        }\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u4e88\u7d04\u691c\u7d22\u30c4\u30fc\u30eb\u5b9f\u884c\n    \/\/\/ &lt;\/summary&gt;\n    private async Task&lt;string&gt; CallSearchReservationsAsync(Dictionary&lt;string, object&gt;? arguments)\n    {\n        var request = new ReservationSearchRequest();\n\n        if (arguments != null)\n        {\n            if (arguments.TryGetValue(&quot;CustomerName&quot;, out var customerName))\n                request.CustomerName = customerName?.ToString();\n            if (arguments.TryGetValue(&quot;CustomerNameKana&quot;, out var customerNameKana))\n                request.CustomerNameKana = customerNameKana?.ToString();\n            if (arguments.TryGetValue(&quot;PhoneNumber&quot;, out var phoneNumber))\n                request.PhoneNumber = phoneNumber?.ToString();\n            if (arguments.TryGetValue(&quot;Email&quot;, out var email))\n                request.Email = email?.ToString();\n            if (arguments.TryGetValue(&quot;ReceptionDate&quot;, out var receptionDate))\n                request.ReceptionDate = receptionDate?.ToString();\n            if (arguments.TryGetValue(&quot;AreaGroupId&quot;, out var areaGroupId) && int.TryParse(areaGroupId?.ToString(), out var areaGroupIdInt))\n                request.AreaGroupId = areaGroupIdInt;\n            if (arguments.TryGetValue(&quot;StoreId&quot;, out var storeId) && int.TryParse(storeId?.ToString(), out var storeIdInt))\n                request.StoreId = storeIdInt;\n            if (arguments.TryGetValue(&quot;Status&quot;, out var status))\n                request.Status = status?.ToString();\n            if (arguments.TryGetValue(&quot;page&quot;, out var page) && int.TryParse(page?.ToString(), out var pageInt))\n                request.Page = pageInt;\n            if (arguments.TryGetValue(&quot;perPage&quot;, out var perPage) && int.TryParse(perPage?.ToString(), out var perPageInt))\n                request.PerPage = perPageInt;\n\n            \/\/ \u4e88\u7d04\u65e5\u306e\u8a2d\u5b9a\n            if (arguments.TryGetValue(&quot;ReservationDate&quot;, out var reservationDate))\n            {\n                var dateStr = reservationDate?.ToString();\n                if (!string.IsNullOrEmpty(dateStr))\n                {\n                    request.ReservationDate = new ReservationDateRange\n                    {\n                        Start = dateStr,\n                        End = dateStr\n                    };\n                }\n            }\n\n            \/\/ \u6642\u9593\u5e2f\u306e\u8a2d\u5b9a\n            if (arguments.TryGetValue(&quot;TimeZone&quot;, out var timeZone))\n            {\n                var timeZoneStr = timeZone?.ToString();\n                if (!string.IsNullOrEmpty(timeZoneStr))\n                {\n                    request.TimeZone = new[] { timeZoneStr };\n                }\n            }\n        }\n\n        return await _webApiClient.SearchReservationsAsync(request);\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u540d\u524d\u306b\u3088\u308b\u4e88\u7d04\u691c\u7d22\u30c4\u30fc\u30eb\u5b9f\u884c\n    \/\/\/ &lt;\/summary&gt;\n    private async Task&lt;string&gt; CallSearchReservationsByNameAsync(Dictionary&lt;string, object&gt;? arguments)\n    {\n        var request = new ReservationSearchByNameRequest();\n\n        if (arguments != null)\n        {\n            if (arguments.TryGetValue(&quot;SellingCompany&quot;, out var sellingCompany))\n                request.SellingCompany = sellingCompany?.ToString();\n            if (arguments.TryGetValue(&quot;Store&quot;, out var store))\n                request.Store = store?.ToString();\n            if (arguments.TryGetValue(&quot;AreaGroup&quot;, out var areaGroup))\n                request.AreaGroup = areaGroup?.ToString();\n            if (arguments.TryGetValue(&quot;CustomerName&quot;, out var customerName))\n                request.CustomerName = customerName?.ToString();\n            if (arguments.TryGetValue(&quot;PhoneNumber&quot;, out var phoneNumber))\n                request.PhoneNumber = phoneNumber?.ToString();\n            if (arguments.TryGetValue(&quot;Email&quot;, out var email))\n                request.Email = email?.ToString();\n            if (arguments.TryGetValue(&quot;AcceptanceDate&quot;, out var acceptanceDate))\n                request.AcceptanceDate = acceptanceDate?.ToString();\n            if (arguments.TryGetValue(&quot;Model&quot;, out var model))\n                request.Model = model?.ToString();\n            if (arguments.TryGetValue(&quot;PlateNumber&quot;, out var plateNumber))\n                request.PlateNumber = plateNumber?.ToString();\n            if (arguments.TryGetValue(&quot;Color&quot;, out var color))\n                request.Color = color?.ToString();\n            if (arguments.TryGetValue(&quot;Remarks&quot;, out var remarks))\n                request.Remarks = remarks?.ToString();\n            if (arguments.TryGetValue(&quot;page&quot;, out var page) && int.TryParse(page?.ToString(), out var pageInt))\n                request.Page = pageInt;\n            if (arguments.TryGetValue(&quot;limit&quot;, out var limit) && int.TryParse(limit?.ToString(), out var limitInt))\n                request.Limit = limitInt;\n\n            \/\/ \u4e88\u7d04\u65e5\u306e\u8a2d\u5b9a\n            if (arguments.TryGetValue(&quot;ReservationDate&quot;, out var reservationDate))\n            {\n                var dateStr = reservationDate?.ToString();\n                var storeValue = arguments.TryGetValue(&quot;Store&quot;, out var storeArg) ? storeArg?.ToString() : null;\n                \n                if (!string.IsNullOrEmpty(dateStr))\n                {\n                    request.ReservationDate = new ReservationDateRange\n                    {\n                        Store = storeValue,\n                        Start = dateStr,\n                        End = dateStr\n                    };\n                }\n            }\n\n            \/\/ \u6642\u9593\u5e2f\u306e\u8a2d\u5b9a\n            if (arguments.TryGetValue(&quot;TimeZone&quot;, out var timeZone))\n            {\n                var timeZoneStr = timeZone?.ToString();\n                if (!string.IsNullOrEmpty(timeZoneStr))\n                {\n                    request.TimeZone = new[] { timeZoneStr };\n                }\n            }\n        }\n\n        return await _webApiClient.SearchReservationsByNameAsync(request);\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u30ab\u30ec\u30f3\u30c0\u30fc\u53d6\u5f97\u30c4\u30fc\u30eb\u5b9f\u884c\n    \/\/\/ &lt;\/summary&gt;\n    private async Task&lt;string&gt; CallGetCalendarAsync(Dictionary&lt;string, object&gt;? arguments)\n    {\n        var request = new CalendarRequest();\n\n        if (arguments != null)\n        {\n            if (arguments.TryGetValue(&quot;date&quot;, out var date))\n                request.Date = date?.ToString() ?? string.Empty;\n            if (arguments.TryGetValue(&quot;AreaGroupId&quot;, out var areaGroupId) && int.TryParse(areaGroupId?.ToString(), out var areaGroupIdInt))\n                request.AreaGroupId = areaGroupIdInt;\n        }\n\n        if (string.IsNullOrEmpty(request.Date))\n        {\n            throw new ArgumentException(&quot;date parameter is required&quot;);\n        }\n\n        return await _webApiClient.GetCalendarAsync(request);\n    }\n}\n<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">WebApiClient.cs<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>using System.Text.Json;\nusing KkcMcpServerApi.Models;\n\nnamespace KkcMcpServerApi.Services;\n\n\/\/\/ &lt;summary&gt;\n\/\/\/ WebAPI\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\n\/\/\/ &lt;\/summary&gt;\npublic interface IWebApiClient\n{\n    Task&lt;string&gt; SearchReservationsAsync(ReservationSearchRequest request);\n    Task&lt;string&gt; SearchReservationsByNameAsync(ReservationSearchByNameRequest request);\n    Task&lt;string&gt; GetCalendarAsync(CalendarRequest request);\n}\n\n\/\/\/ &lt;summary&gt;\n\/\/\/ kkc-webapi \u3092\u547c\u3073\u51fa\u3059\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\n\/\/\/ &lt;\/summary&gt;\npublic class WebApiClient : IWebApiClient\n{\n    private readonly HttpClient _httpClient;\n    private readonly ILogger&lt;WebApiClient&gt; _logger;\n    private readonly JsonSerializerOptions _jsonOptions;\n\n    public WebApiClient(HttpClient httpClient, ILogger&lt;WebApiClient&gt; logger)\n    {\n        _httpClient = httpClient;\n        _logger = logger;\n        _jsonOptions = new JsonSerializerOptions\n        {\n            \/\/ Laravel API\u306fPascalCase\u3092\u671f\u5f85\u3057\u3066\u3044\u308b\u305f\u3081\u3001PropertyNamingPolicy\u3092\u8a2d\u5b9a\u3057\u306a\u3044\n            WriteIndented = true\n        };\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u4e88\u7d04\u691c\u7d22API\u547c\u3073\u51fa\u3057\n    \/\/\/ &lt;\/summary&gt;\n    public async Task&lt;string&gt; SearchReservationsAsync(ReservationSearchRequest request)\n    {\n        try\n        {\n            var json = JsonSerializer.Serialize(request, _jsonOptions);\n            var content = new StringContent(json, System.Text.Encoding.UTF8, &quot;application\/json&quot;);\n            \n            _logger.LogInformation(&quot;Calling reservations\/search API with: {Request}&quot;, json);\n            \n            var response = await _httpClient.PostAsync(&quot;\/api\/v1\/reservations\/search&quot;, content);\n            \n            if (!response.IsSuccessStatusCode)\n            {\n                var errorContent = await response.Content.ReadAsStringAsync();\n                _logger.LogError(&quot;API call failed with status {StatusCode}: {Error}&quot;, \n                    response.StatusCode, errorContent);\n                throw new HttpRequestException($&quot;API call failed: {response.StatusCode} - {errorContent}&quot;);\n            }\n            \n            var result = await response.Content.ReadAsStringAsync();\n            _logger.LogInformation(&quot;API response received: {Response}&quot;, result);\n            \n            return result;\n        }\n        catch (Exception ex)\n        {\n            _logger.LogError(ex, &quot;Error calling reservations search API&quot;);\n            throw;\n        }\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u540d\u524d\u306b\u3088\u308b\u4e88\u7d04\u691c\u7d22API\u547c\u3073\u51fa\u3057\n    \/\/\/ &lt;\/summary&gt;\n    public async Task&lt;string&gt; SearchReservationsByNameAsync(ReservationSearchByNameRequest request)\n    {\n        try\n        {\n            var json = JsonSerializer.Serialize(request, _jsonOptions);\n            var content = new StringContent(json, System.Text.Encoding.UTF8, &quot;application\/json&quot;);\n            \n            _logger.LogInformation(&quot;Calling reservations\/search-by-name API with: {Request}&quot;, json);\n            \n            var response = await _httpClient.PostAsync(&quot;\/api\/v1\/reservations\/search-by-name&quot;, content);\n            \n            if (!response.IsSuccessStatusCode)\n            {\n                var errorContent = await response.Content.ReadAsStringAsync();\n                _logger.LogError(&quot;API call failed with status {StatusCode}: {Error}&quot;, \n                    response.StatusCode, errorContent);\n                throw new HttpRequestException($&quot;API call failed: {response.StatusCode} - {errorContent}&quot;);\n            }\n            \n            var result = await response.Content.ReadAsStringAsync();\n            _logger.LogInformation(&quot;API response received: {Response}&quot;, result);\n            \n            return result;\n        }\n        catch (Exception ex)\n        {\n            _logger.LogError(ex, &quot;Error calling reservations search-by-name API&quot;);\n            throw;\n        }\n    }\n\n    \/\/\/ &lt;summary&gt;\n    \/\/\/ \u30ab\u30ec\u30f3\u30c0\u30fcAPI\u547c\u3073\u51fa\u3057\n    \/\/\/ &lt;\/summary&gt;\n    public async Task&lt;string&gt; GetCalendarAsync(CalendarRequest request)\n    {\n        try\n        {\n            var json = JsonSerializer.Serialize(request, _jsonOptions);\n            var content = new StringContent(json, System.Text.Encoding.UTF8, &quot;application\/json&quot;);\n            \n            _logger.LogInformation(&quot;Calling reservations\/calendar API with: {Request}&quot;, json);\n            \n            var response = await _httpClient.PostAsync(&quot;\/api\/v1\/reservations\/calendar&quot;, content);\n            \n            if (!response.IsSuccessStatusCode)\n            {\n                var errorContent = await response.Content.ReadAsStringAsync();\n                _logger.LogError(&quot;API call failed with status {StatusCode}: {Error}&quot;, \n                    response.StatusCode, errorContent);\n                throw new HttpRequestException($&quot;API call failed: {response.StatusCode} - {errorContent}&quot;);\n            }\n            \n            var result = await response.Content.ReadAsStringAsync();\n            _logger.LogInformation(&quot;API response received: {Response}&quot;, result);\n            \n            return result;\n        }\n        catch (Exception ex)\n        {\n            _logger.LogError(ex, &quot;Error calling calendar API&quot;);\n            throw;\n        }\n    }\n}\n<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u7684 MCP Server \u306e\u8a66\u4f5c\u3092\u884c\u3044\u3001MCP \u306e\u6a5f\u80fd\u3092\u78ba\u8a8d\u3059\u308b\u3002 &nbsp; \u65e5\u4ed8\u300c2025\u5e7408\u670802\u65e5\u300d\u3001\u5e97\u8217\u300c\u6625\u65e5\u90e8\u300d\u3092\u898b\u3064\u3051\u51fa\u3057\u3066\u3001\u65e2\u5b58\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u4e88\u7d04\u72b6\u6cc1\u3092\u53d6\u5f97\u3059\u308b\u3002 \u3061\u3087\u3063\u3068\u524d\u306f RAG\uff08Retr &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/11392\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-11392","post","type-post","status-publish","format-standard","hentry","category-dev"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=11392"}],"version-history":[{"count":4,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11392\/revisions"}],"predecessor-version":[{"id":11402,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11392\/revisions\/11402"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=11392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=11392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=11392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}