This commit is contained in:
22
docs/snippets/csharp/mcp_server_start.md
Normal file
22
docs/snippets/csharp/mcp_server_start.md
Normal file
@@ -0,0 +1,22 @@
|
||||
```csharp title="C#"
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
var processInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "kreuzberg",
|
||||
Arguments = "mcp",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true
|
||||
};
|
||||
|
||||
var mcpProcess = Process.Start(processInfo);
|
||||
|
||||
Console.WriteLine($"MCP server started with PID: {mcpProcess?.Id}");
|
||||
await Task.Delay(1000);
|
||||
Console.WriteLine("Server is running, listening for connections");
|
||||
|
||||
mcpProcess?.WaitForExit();
|
||||
```
|
||||
Reference in New Issue
Block a user