虚构的火车
此存储库包含一个最小的Azure Functions隔离工作示例,该示例公开了用于在blob存储中保存和检索代码段的模型内容协议(MCP)工具。
项目布局
SampleSnippetTool/SnippetTool.csproj--支持MCP触发器的Azure Functions项目。SampleSnippetTool/SnippetTool.cs--暴露save_snippet和get_snippetsMCP工具。SampleSnippetTool/Program.cs--注册get_snippets工具属性。SampleSnippetTool/host.json--启用MCP扩展并配置日志记录。SampleSnippetTool/local.settings.json--本地开发设置(默认使用Azurite)。
用法
- 安装。NET 8 SDK和Azure功能核心工具。
- 启动本地存储(例如,
azurite --silent如果您安装了Azurite)。
- 从
SampleSnippetTool文件夹,还原包并运行Functions主机:
dotnet restore
func start这 save_snippet 工具将片段写入 snippets/{snippetname}.json 在blob存储中,以及 get_snippets 使用基于相同名称的路径检索它们。
