Loading McpBase.slnx +2 −0 Original line number Diff line number Diff line <Solution> <Project Path="src/McpBase.McpServer/McpBase.McpServer.csproj" /> <Project Path="src/McpBase.Request/McpBase.Request.csproj" /> <Project Path="src/McpBase.Shared/McpBase.Shared.csproj" /> </Solution> src/McpBase.McpServer/McpBase.McpServer.csproj +10 −0 Original line number Diff line number Diff line Loading @@ -40,4 +40,14 @@ <PackageReference Include="shRabbit.Base" Version="1.12.1" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\McpBase.Request\McpBase.Request.csproj" /> <ProjectReference Include="..\McpBase.Shared\McpBase.Shared.csproj" /> </ItemGroup> <!-- McpBase.Request 输出文件路径与项目路径 --> <PropertyGroup> <McpBaseRequestProjectPath>$(MSBuildThisFileDirectory)..\McpBase.Request\McpBase.Request.csproj</McpBaseRequestProjectPath> <McpBaseRequestOutputPath>$(MSBuildThisFileDirectory)..\McpBase.Request\bin\$(Configuration)\$(TargetFramework)\</McpBaseRequestOutputPath> </PropertyGroup> </Project> src/McpBase.McpServer/Program.cs +2 −0 Original line number Diff line number Diff line using System.Reflection; using McpBase.McpServer.Tools; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; Loading @@ -19,6 +20,7 @@ builder.Services .WithStdioServerTransport() .WithTools<RandomNumberTools>() .WithTools<NetworkTools>() .WithTools<RequestTools>() .WithTools<ProcessState>(); await builder.Build().RunAsync(); No newline at end of file src/McpBase.McpServer/Tools/RequestTools.cs 0 → 100644 +29 −0 Original line number Diff line number Diff line using System.ComponentModel; using System.Diagnostics; using McpBase.Shared; using ModelContextProtocol.Server; namespace McpBase.McpServer.Tools; public class RequestTools { [McpServerTool, Description("进行无限等待。由用户决定是否结束。")] public async Task InfiniteWait([Description("message")]string? msg) { var self = Process.GetCurrentProcess().Id; var psi = new ProcessStartInfo(Path.Join(AppDomain.CurrentDomain.BaseDirectory, "McpBase.Request.exe")) { ArgumentList = { SendInfWaitTransport.GetTransportString(new SendInfWaitTransport { Pid = self, Message = msg ?? string.Empty }) }, UseShellExecute = true }; await Process.Start(psi)?.WaitForExitAsync()!; } } No newline at end of file src/McpBase.Request/McpBase.Request.csproj 0 → 100644 +18 −0 Original line number Diff line number Diff line <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net10.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <InvariantGlobalization>true</InvariantGlobalization> <RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers> <SelfContained>true</SelfContained> <PublishSelfContained>true</PublishSelfContained> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\McpBase.Shared\McpBase.Shared.csproj" /> </ItemGroup> </Project> Loading
McpBase.slnx +2 −0 Original line number Diff line number Diff line <Solution> <Project Path="src/McpBase.McpServer/McpBase.McpServer.csproj" /> <Project Path="src/McpBase.Request/McpBase.Request.csproj" /> <Project Path="src/McpBase.Shared/McpBase.Shared.csproj" /> </Solution>
src/McpBase.McpServer/McpBase.McpServer.csproj +10 −0 Original line number Diff line number Diff line Loading @@ -40,4 +40,14 @@ <PackageReference Include="shRabbit.Base" Version="1.12.1" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\McpBase.Request\McpBase.Request.csproj" /> <ProjectReference Include="..\McpBase.Shared\McpBase.Shared.csproj" /> </ItemGroup> <!-- McpBase.Request 输出文件路径与项目路径 --> <PropertyGroup> <McpBaseRequestProjectPath>$(MSBuildThisFileDirectory)..\McpBase.Request\McpBase.Request.csproj</McpBaseRequestProjectPath> <McpBaseRequestOutputPath>$(MSBuildThisFileDirectory)..\McpBase.Request\bin\$(Configuration)\$(TargetFramework)\</McpBaseRequestOutputPath> </PropertyGroup> </Project>
src/McpBase.McpServer/Program.cs +2 −0 Original line number Diff line number Diff line using System.Reflection; using McpBase.McpServer.Tools; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; Loading @@ -19,6 +20,7 @@ builder.Services .WithStdioServerTransport() .WithTools<RandomNumberTools>() .WithTools<NetworkTools>() .WithTools<RequestTools>() .WithTools<ProcessState>(); await builder.Build().RunAsync(); No newline at end of file
src/McpBase.McpServer/Tools/RequestTools.cs 0 → 100644 +29 −0 Original line number Diff line number Diff line using System.ComponentModel; using System.Diagnostics; using McpBase.Shared; using ModelContextProtocol.Server; namespace McpBase.McpServer.Tools; public class RequestTools { [McpServerTool, Description("进行无限等待。由用户决定是否结束。")] public async Task InfiniteWait([Description("message")]string? msg) { var self = Process.GetCurrentProcess().Id; var psi = new ProcessStartInfo(Path.Join(AppDomain.CurrentDomain.BaseDirectory, "McpBase.Request.exe")) { ArgumentList = { SendInfWaitTransport.GetTransportString(new SendInfWaitTransport { Pid = self, Message = msg ?? string.Empty }) }, UseShellExecute = true }; await Process.Start(psi)?.WaitForExitAsync()!; } } No newline at end of file
src/McpBase.Request/McpBase.Request.csproj 0 → 100644 +18 −0 Original line number Diff line number Diff line <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net10.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <InvariantGlobalization>true</InvariantGlobalization> <RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers> <SelfContained>true</SelfContained> <PublishSelfContained>true</PublishSelfContained> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\McpBase.Shared\McpBase.Shared.csproj" /> </ItemGroup> </Project>