Dinos MCPServer-版本1.0.1
Transform your Delphi code into a MCP-server with DMCPServer.
🎯 关于
DMPServer是用Delphi开发的主控协议服务器。
⚙️ 安装
安装是使用 boss install 命令:
boss install github.com/Daniel09Fernandes/DMCPServer⚙️ 协议
| 协议 | 支持 |
|---|---|
| HTTP | ✅ |
| STDIO | ✅ |
经过测试的Delphi版本
| 版本 | 支持 | \ |
|---|---|---|
| >10.x | ✅ | |
| >11.x | ✅ | |
| >12.x | ✅ | |
| >13.X | ✅ |
🚀 注册您的操作
var
lCallbackGetWeather : TMCPAction;
begin
lCallbackGetWeather :=
procedure(var Params: TJSONObject; out Result: TDMCPCallToolsResult; out Error: TDMCPCallToolsContent)
var
Location: string;
EnableLog: Boolean;
WeatherService: IWeatherService;
WeatherData: string;
begin
try
try
// Extract parameters
Location := Params.GetParam('location');
EnableLog := Params.GetParam('EnableLog', trBool);
// Validation of required parameters
if Location.Trim = '' then
raise Exception.Create('Location parameter is required');
WeatherService := TMockWeatherService.Create;
WeatherData := WeatherService.GetWeatherData(Location);
if EnableLog then
TDMCPServer.WriteToLog(Format('Weather data requested for %s', [Location]));
// Assemble the result - There's no need to release it from memory; it's done automatically.
Result := TDMCPCallToolsResult.Create;
Result.Content.AddRange(TDMCPCallToolsContent.Create(ptText, WeatherData));
Error := nil;
finally
Params.Free;
end;
except
on E: Exception do
begin
// Handles exceptions. to MCPServers Defaults
Error := TDMCPCallToolsContent.Create(ptText,
'Weather service error: ' + E.Message);
TDMCPServer.WriteToLog('Error in get_weather: ' + E.Message);
Result := nil;
end;
end;
end;
end;📋 创建并注册您的服务器信息
var
lDMCP: IDMCPServerRegister;
begin
lDMCP := TDMCPServerRegister.New
.SetLogs(True); //Set Logs Request
lDMCP
.RegisterAction('get_weather', 'Get current weather information', lCallbackGetWeather)
.ServerInfo
.SetServerName('DinosMCPServer')
.SetVersion('0.1.0')
.Tools(TMCPServerTools.New
.SetName('get_weather')
.InputSchema
.SetType(ptObject)
.SetProperties('location', ptString)
.SetProperties('Conditions', ptString)
.SetProperties('EnableLog', ptBoolean)
.SetRequired(['location'])
.SetAdditionalProperties(False)
.&End);
lDMCP.Run;
end;为LLM内存添加更多资源以供MCP使用
.ServerInfo
.SetServerName('DinosMCPServer')
.SetVersion('0.1.0')
.Resources(TMCPServerResources.New
.SetUri('file:///C:/Users/danie/Downloads/teste/fatura-exemplo.csv')
.SetName('Model to create sales order')
.SetDescription('Standard budget template to be followed for sales orders.'))附Claude AI
访问开发人员上的配置并编辑配置
在mcpServers节点中,连接MCPServer(STDIO)
对于HTTP:
流动
文档
📖 请在此处阅读完整文档: DMPServer文档
🎬 YouTube上观看 DMPServer-PT-BR
🎬 在Youtube上观看,MCP的完整解释 美国DMCPServer
______________________________________________________________________
该组件是完全免费的,如果它是非常有用的你,如何支付我一杯咖啡来鼓励项目?
像素:
明星历史

