40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
// See https://aka.ms/new-console-template for more information
|
|
global using MCPSharp;
|
|
using GiteaHelpMCP.Base;
|
|
|
|
public class Program
|
|
{
|
|
public static async Task Main(string[] args)
|
|
{
|
|
GetArgs(args);
|
|
Console.WriteLine("Hello, GiteaHelpMCPServer!");
|
|
GiteaHelp.GetAllReposCommitsSimple();
|
|
await MCPServer.StartAsync("GiteaHelpMCPServer", "1.0.0");
|
|
Console.WriteLine("Server is running. Press any key to stop.");
|
|
Console.ReadKey();
|
|
}
|
|
|
|
public static void GetArgs(string[] args)
|
|
{
|
|
foreach (var arg in args)
|
|
{
|
|
if (arg.Contains("="))
|
|
{
|
|
var argName = arg.Split('=')[0];
|
|
var argValue = arg.Split('=')[1];
|
|
//和 MsBase 的属性一一对应 并赋值
|
|
switch (argName)
|
|
{
|
|
case "url":
|
|
MsBase.url = argValue;
|
|
break;
|
|
|
|
case "token":
|
|
MsBase.token = argValue;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|