c5e0e5cfe3
Agents can now use Model Context Protocol servers. End to end: - SharedKernel seam IMcpGateway (ListToolsAsync / CallToolAsync) + McpToolDescriptor / McpToolResult, so the Assembler discovers and can invoke MCP tools without referencing Integrations' tables. - Integrations: McpServerConfig (org-scoped, owner-only; auth headers AES-GCM encrypted, never returned — only their names) + AddMcpServers migration. McpClient: a dependency-free Streamable-HTTP JSON-RPC 2.0 client (initialize → notifications/initialized → tools/list / tools/call), carrying the Mcp-Session-Id and parsing both application/json and text/event-stream replies. McpGateway resolves an org's servers, decrypts headers server-side, and is best-effort: an unreachable server is logged and skipped, never failing the run. CRUD + connectivity-test endpoints (create/test/delete owner-only via ManageApiKeys; list via ConfigureAgents to bind). - OrgBoard: Agent gains McpServerIds (uuid[]; migration backfills existing agents to empty) flowing through ConfigureAgent + AgentRunContext. - Assembler: AgentRunExecutor lists the agent's MCP tools (best-effort) and PromptAssembler renders a "# Tools (MCP)" catalog — labelled as data, never instructions — and records it in the run trace. - Client: SeatsPage gains an MCP servers card (add/test/delete, encrypted auth header) and a per-agent MCP server multi-select; api client gains del(). Note: discovery + the governed call gateway are in place now; the autonomous model-driven tool-call loop (model emits tool_calls → gated execution → feedback) needs a tool-calling model client and is the next increment — the stub model can't drive it. Verified: ArchitectureTests 8/8, IntegrationTests 53/53 (McpClientTests: JSON-RPC handshake/session, json + SSE; McpServerRegistryTests: owner-only, encrypted-header-never-returned, graceful test, Member 403; PromptAssemblerMcpTests: catalog + trace, omitted when empty), client build green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
118 lines
4.1 KiB
C#
118 lines
4.1 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using TeamUp.Modules.Integrations.Persistence;
|
|
|
|
#nullable disable
|
|
|
|
namespace TeamUp.Modules.Integrations.Persistence.Migrations
|
|
{
|
|
[DbContext(typeof(IntegrationsDbContext))]
|
|
partial class IntegrationsDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasDefaultSchema("integrations")
|
|
.HasAnnotation("ProductVersion", "10.0.8")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("TeamUp.Modules.Integrations.Domain.ApiConfig", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("CreatedByMemberId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("EncryptedKey")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Endpoint")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<string>("Model")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("character varying(120)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("character varying(120)");
|
|
|
|
b.Property<Guid>("OrganizationId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Provider")
|
|
.IsRequired()
|
|
.HasMaxLength(60)
|
|
.HasColumnType("character varying(60)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrganizationId");
|
|
|
|
b.HasIndex("OrganizationId", "Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("api_configs", "integrations");
|
|
});
|
|
|
|
modelBuilder.Entity("TeamUp.Modules.Integrations.Domain.McpServerConfig", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("CreatedByMemberId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("Enabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("EncryptedHeaders")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Endpoint")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("character varying(120)");
|
|
|
|
b.Property<Guid>("OrganizationId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrganizationId");
|
|
|
|
b.HasIndex("OrganizationId", "Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("mcp_servers", "integrations");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|