Chat-Client:
Code: Select all
public PersistentAgentsClient CreateChatClient()
{
return new PersistentAgentsClient("",
new ChainedTokenCredential(
#if DEBUG
new VisualStudioCredential(),
new AzureCliCredential(),
#endif
new ManagedIdentityCredential()
));
}
Code: Select all
var agentMetaData = await client.Administration.CreateAgentAsync(
model: "gpt-4.1",
name: agentName.ToString(),
description: agent.Description,
instructions: string.Concat(
"\nDescription: " + agent.Description,
"\nInstructions: " + agent.Instructions,
"\nPrinciples: " + agent.Principles,
"\nResponse Type: " + agent.ResponseDataType,
"\nResponse Schema: " + agent.ResponseSchema),
tools: tools,
toolResources: toolResources);
https://github.com/microsoft/azure-devops-mcp
https://learn.microsoft.com/en-us/agent ... che-csharp
Obwohl ich die Tools unten auflisten kann, konnte jemand sie in den Persistent Agent integrieren, da ListToolsAsync eine Sammlung von McpClientTool zurückgibt, während PeristentAgent als Tools a akzeptiert ToolDefinition-Instanz?
Und wenn jemand herausfinden kann, wie man das Anmeldefenster umgehen kann, das mit einem alternativen, sagen wir, PAT-Token erscheint?
Code: Select all
await using var mcpClient = await McpClientFactory.CreateAsync(new StdioClientTransport(new()
{
Name = "MCPServer",
Command = "npx",
Arguments = "args": [
"-y",
"@azure-devops/mcp@next",
""
],
}));
var mcpTools = await mcpClient.ListToolsAsync().ConfigureAwait(false);
 Mobile version
 Mobile version