/outsystems:outsystems-custom-codefrom OutSystems - MCP
Builds, tests, and deploys C# class-library External Logic libraries for OutSystems Developer Cloud (ODC). Covers SDK attributes, data types, runtime constraints, unit/container tests, and deployment via the OutSystems MCP.
Ships in OutSystems - MCP. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Beta Feature. This skill is a Beta Feature: a non-final OutSystems capability provided to collect customer feedback. It can change significantly, including through breaking changes, or be discontinued. The first time you use this skill in a conversation, tell the user it's a Beta Feature and share https://www.outsystems.com/legal/beta-features-agreement.
This file describes how to create, build, test, and deploy C# libraries for the OutSystems Developer Cloud (ODC) External Logic feature.
Load the main outsystems skill before uploading: upload, polling and publish rules come from it (read the live tool catalog, poll long-running operations to terminal, confirm before every tenant write). The main skill's upload, polling and publish rules apply, and this skill's two confirmations (see Upload and publish) always apply on top of them. For building and packaging the library, follow this skill.
OutSystems ODC External Logic allows extending ODC apps with custom C# code. The C# class library project is built locally, published as a ZIP file to the ODC platform. OutSystems generates a wrapper around the code that exposes the decorated interfaces as server actions consumable by ODC applications.
These are hard limits enforced by the ODC platform. Never design functions that approach or exceed them:
| Constraint | Limit |
|---|---|
| Max execution duration | 95 seconds per function call |
| Max memory | 1,024 MB |
| Max ephemeral storage | 512 MB |
| Max payload (inputs + outputs combined) | 5.5 MB |
For large data: stream in chunks, use references/URLs instead of raw bytes.
<OutputType>Library</OutputType>).If dotnet --list-sdks shows no 10.x SDK, or docker info fails, tell the user and stop at the
step that needs it: the build and unit tests need the SDK, the container tests need Docker.
<PackageReference Include="OutSystems.ExternalLibraries.SDK" Version="1.7.0" />
Always use the latest stable version. Check: https://www.nuget.org/packages/OutSystems.ExternalLibraries.SDK
.csproj<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OutSystems.ExternalLibraries.SDK" Version="1.7.0" />
</ItemGroup>
</Project>
Note: the SDK package itself may only ship net8.0/netstandard2.0 assets (no net10.0-specific
build) — that's fine, NuGet resolves the closest compatible asset and it runs correctly under a
net10.0-targeted project.
[OSInterface] – Exposes the interface to ODCApplied to a public interface. Every method on this interface becomes a server action in ODC.
using OutSystems.ExternalLibraries.SDK;
namespace MyCompany.MyLibrary
{
[OSInterface(
Name = "MyLibrary",
Description = "Short description of what this library does."
)]
public interface IMyLibrary
{
[OSAction(Description = "Greets a person by name")]
string Greet(
[OSParameter(Description = "Name to greet")] string name
);
}
}
Name: The library name in ODC. It also decides whether an upload creates a new library or a new revision, so always set it. Required for ODC Forge submission.Description: Shown in ODC Portal. Required for Forge submission.IconResourceName: the embedded resource name of the library's PNG icon. Required for Forge submission. Add the icon to the project as an EmbeddedResource item and set <RootNamespace>MyCompany.MyLibrary</RootNamespace> in the .csproj; the resource name is then the root namespace, the folder and the file name, joined with dots (for an icon in Resources, MyCompany.MyLibrary.Resources. followed by the file name). Keep these out of the minimal .csproj: the build fails when the icon file doesn't exist.[OSAction] – Customise action metadata (optional)Applied to individual interface methods to override defaults.
[OSAction(
Description = "Validates an IBAN and returns structured result.",
ReturnName = "ValidationResult",
ReturnDescription = "The validation outcome."
)]
ValidationResult ValidateIban(string iban); // ValidationResult: an [OSStructure] struct, defined elsewhere
[OSParameter] – Customise parameter metadata (optional)void ProcessData(
[OSParameter(Description = "Raw input bytes", DataType = OSDataType.BinaryData)]
byte[] data,
[OSParameter(Description = "Output result")]
out string result
);
To make a server action parameter optional in ODC, the C# parameter must be both nullable and have a default value of null.
// In interface:
[OSAction(Description = "Sends a notification")]
void SendNotification(
[OSParameter(Description = "Recipient address")] string recipient,
[OSParameter(Description = "Optional message subject")] string? subject = null,
[OSParameter(Description = "Optional priority level")] int? priority = null
);
// In implementation:
public void SendNotification(string recipient, string? subject = null, int? priority = null)
{
var resolvedSubject = subject ?? "No Subject";
var resolvedPriority = priority ?? 0;
// ...
}
Rules to make parameter optional:
string?, int?, bool?, decimal?, etc.= null as the default value in both the interface and the implementation.byte[]? (Binary Data) and struct types decorated with [OSStructure] can also be made optional the same way.out parameters cannot be optional.[OSStructure] – Exposes a struct as an ODC StructureApplied to a public struct (not class). Used for complex input/output types.
[OSStructure(Description = "Represents a parsed IBAN value.")]
public struct IbanResult
{
[OSStructureField(Description = "Two-letter country code", IsMandatory = true)]
public string Country { get; set; }
[OSStructureField(Description = "Basic Bank Account Number")]
public string Bban { get; set; }
[OSStructureField(Description = "Whether the IBAN is valid")]
public bool IsValid { get; set; }
}
[OSIgnore] – Hides a member from ODCApply to methods or properties that should not be exposed as actions or structure fields.
OriginalName – on every decorated element (optional)[OSInterface], [OSAction], [OSParameter], [OSStructure] and [OSStructureField] all accept an
OriginalName property. It holds the original name, so the key ODC calculates stays the same when you
rename the namespace, interface, method, parameter or struct, and the apps that use the library keep
working. On [OSInterface] it's the previous namespace plus the previous library name.
[OSInterface(Name = "MyLibrary", OriginalName = "MyCompany.MyLibrary.MyLibrary")]
To log from your custom code, including informational messages and errors, use the Microsoft.Extensions.Logging ILogger interface in your C# code. Only Information and higher levels show in the ODC Portal logs. The library class receives the ILogger in its constructor. The OutSystems SDK package doesn't bring it, so add the Microsoft.Extensions.Logging.Abstractions package (<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.12" />): it holds ILogger, LogInformation and NullLogger, which is all a library needs, because ODC creates the logger and passes it in. It adds about 60 KB of Microsoft DLLs to the upload ZIP, so add it only when the library logs. The ODC SDK README names the full Microsoft.Extensions.Logging package, which also works: it depends on this one and adds about 120 KB more for creating loggers, which a library doesn't do.
The logging version of the MyLibrary class from the Implementation Pattern:
using Microsoft.Extensions.Logging;
using System.Diagnostics;
namespace MyCompany.MyLibrary
{
public class MyLibrary : IMyLibrary
{
private readonly ILogger _logger;
public MyLibrary(ILogger logger)
{
_logger = logger;
}
public string Greet(string name)
{
using var activity = Activity.Current?.Source.StartActivity("MyLibrary.Greet");
_logger.LogInformation($"Greeting {name}");
return $"Hello, {name}!";
}
}
}
A library that logs takes the logger in its constructor, so its tests pass NullLogger.Instance
(using Microsoft.Extensions.Logging.Abstractions;): new MyLibrary(NullLogger.Instance).
Only these types are valid as method parameters and return types:
| C# Type | ODC Type |
|---|---|
string | Text |
int | Integer |
long | Long Integer |
bool | Boolean |
decimal | Decimal |
float | Decimal |
double | Decimal |
DateTime | DateTime |
byte[] | Binary Data |
struct with [OSStructure] | Structure |
IEnumerable<T> of any above | List |
Not supported: classes, dictionaries, enums (wrap in int/string), generics other than
IEnumerable/out — including Task and Task<T>.
Nullable forms of the supported value types (int?, bool?, decimal?, …) ARE valid, but only
as the optional-parameter form described under Optional Parameters — a
nullable type with an = null default. Do not use one as a return type or a structure field.
[OSInterface] methodsOSAction methods must return one of the supported types directly (or void) — never Task or
Task<T>. An interface method declared as Task<string> function(...) fails at library-generation
time with:
The struct decorated with OSStructure ''Evaluate' return value' contains a public
property/field that uses an unsupported parameter type 'Task`1'. (OS-ELG-MODL-05015)
If the implementation needs to call an async API (e.g. an async SDK client), keep the interface method synchronous and block on the async call inside the implementation:
// Interface — synchronous signature, required by ODC
string Evaluate(string rule, string input);
// Implementation — awaits internally, blocks with GetAwaiter().GetResult()
public string Evaluate(string rule, string input)
{
var response = SomeAsyncClient.CallAsync(input).GetAwaiter().GetResult();
return response.ToString();
}
This applies even when the sample code for a third-party library you're wrapping is async/await
end-to-end — adapt it to a synchronous boundary at the [OSInterface] method.
Keep the test projects next to the library project, not inside its folder: a project compiles every
.cs file under its own folder, so test code inside MyLibrary/ would be built into the library.
MyLibrary.slnx # `dotnet new sln` creates .slnx on the .NET 10 SDK
global.json # opts `dotnet test` into Microsoft.Testing.Platform (see Unit Tests)
MyLibrary/
├── MyLibrary.csproj
├── Interfaces/
│ └── IMyLibrary.cs # [OSInterface]-decorated interface
├── Implementations/
│ └── MyLibrary.cs # Class implementing the interface
├── Structures/
│ └── MyResult.cs # [OSStructure]-decorated structs
└── Resources/ # the PNG icon, as an EmbeddedResource (see IconResourceName)
MyLibrary.UnitTests/
└── MyLibraryTests.cs
MyLibrary.IntegrationTests/
└── ContainerTests.cs
The interface and the implementing class must be in the same assembly. ODC finds the implementation via the interface.
// Interfaces/IMyLibrary.cs
using OutSystems.ExternalLibraries.SDK;
namespace MyCompany.MyLibrary
{
[OSInterface(
Name = "MyLibrary",
Description = "Short description of what this library does."
)]
public interface IMyLibrary
{
[OSAction(Description = "Greets a person by name")]
string Greet(
[OSParameter(Description = "Name to greet")] string name
);
}
}
// Implementations/MyLibrary.cs
namespace MyCompany.MyLibrary
{
public class MyLibrary : IMyLibrary
{
public string Greet(string name) => $"Hello, {name}!";
}
}
Use out parameters for multiple return values:
// In interface (MyResult: an [OSStructure] struct, defined elsewhere):
void Parse(string input, out bool success, out string errorMessage, out MyResult result);
// In implementation:
public void Parse(string input, out bool success, out string errorMessage, out MyResult result)
{
// ...
}
Use standard .NET test frameworks. The library code has no ODC runtime dependency, so it can be tested directly.
<!-- MyLibrary.UnitTests.csproj — xUnit v3: the test project is an executable -->
<OutputType>Exe</OutputType>
<PackageReference Include="xunit.v3" Version="4.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.*" />
<ProjectReference Include="../MyLibrary/MyLibrary.csproj" />
xUnit v3 renames the package from xunit to xunit.v3. The Visual Studio / dotnet test runner
keeps its name, xunit.runner.visualstudio, but must be 3.0.0 or later; its 4.0.0 was released
alongside xunit.v3 4.0.0.
Put the test class in a namespace under the library's, as below: xUnit v3 generates code under the
test project's root namespace (MyLibrary.UnitTests), so in the global namespace MyLibrary would
resolve to that namespace instead of the class.
using Xunit;
namespace MyCompany.MyLibrary.UnitTests
{
public class MyLibraryTests
{
private readonly IMyLibrary _sut = new MyLibrary();
[Fact]
public void Greet_ReturnsExpectedString()
{
var result = _sut.Greet("World");
Assert.Equal("Hello, World!", result);
}
}
}
Run: dotnet test
On the .NET 10 SDK, dotnet test runs xUnit v3 tests only through Microsoft.Testing.Platform, so
add a global.json at the solution root. Without it, dotnet test fails with "Testing with VSTest
target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later".
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Integration tests should run the code in a container matching the ODC runtime environment.
Base image: mcr.microsoft.com/dotnet/aspnet:10.0 — match the .NET version the library
targets, or the tests validate a runtime the library will never run on.
Set up MyLibrary.IntegrationTests like the unit-test project (the same .csproj, with OutputType
Exe), with its tests in ContainerTests.cs.
Example Dockerfile for integration tests, at the solution root:
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish MyLibrary.IntegrationTests/MyLibrary.IntegrationTests.csproj -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "MyLibrary.IntegrationTests.dll"]
Add a .dockerignore next to it, so the host's build outputs aren't copied into the image:
**/bin/
**/obj/
The runtime image has no SDK, so dotnet test and dotnet vstest are not available in it. An
xUnit v3 test project is an executable (<OutputType>Exe</OutputType>, as in the unit tests), so
running its .dll runs the tests and exits non-zero when one fails.
The dotnet publish in this Dockerfile builds the integration-test project for the test container.
It is not the upload artifact — for that, see Package.
Run integration tests:
docker build --platform linux/amd64 -t mylibrary-integration-tests .
docker run --rm --platform linux/amd64 --memory=1g --memory-swap=1g mylibrary-integration-tests
ODC runs linux-x64, so --platform linux/amd64 runs the tests on that platform, also on an Apple
Silicon Mac. The build stage stays on the machine's own platform (--platform=$BUILDPLATFORM),
because the SDK build crashes under emulation. --memory=1g --memory-swap=1g applies the 1 GB limit.
Docker can't enforce the 512 MB storage or the 95-second limit, so the tests measure those themselves.
What to validate in integration tests:
For a library other apps will depend on, add smoke tests that call the published library through a real ODC app.
See the UltimatePDF_ExternalLogic.E2ETests project in the primary worked example.
Publish the library project (not a test project) for the Linux x64 runtime ODC runs it on:
dotnet publish MyLibrary/MyLibrary.csproj -c Release -r linux-x64 --self-contained false
Then zip the contents of MyLibrary/bin/Release/net10.0/linux-x64/publish/ to the root of the ZIP.
That ZIP is what you upload.
cd MyLibrary/bin/Release/net10.0/linux-x64/publish && zip -r ../MyLibrary.zip .Compress-Archive -Path MyLibrary\bin\Release\net10.0\linux-x64\publish\* -DestinationPath MyLibrary.zipThe ODC docs also give a portable form without -r linux-x64; the runtime-specific form above is
the one they require when the library has runtime-specific dependencies. It is also the form
OutSystems' own public external-library repositories use (see Worked Examples).
--no-self-contained is the same flag as --self-contained false.
Upload and publish with the main outsystems skill's "Publish a new external library" flow: upload the ZIP, poll until the library is ready for review (pull the operation logs on a validation failure), publish it, and poll until it is published. If the outsystems MCP server isn't connected, follow the main skill's setup for your harness.
The upload sends the ZIP inside the request as base64 text, so keep it small: add only the packages the library uses.
Before the upload, run dotnet test and the container tests, and upload only when they pass.
[OSInterface] Name. A name match is only a hint: the library key comes from the interface's namespace plus Name (or OriginalName). Restate the upload ("upload the external library MyLibrary from MyLibrary.zip") and say whether it looks like a new library or a new revision of the existing one, with that library's key, or that you can't tell; don't guess. Wait for explicit confirmation. After the upload, the status gives the library key: compare it with the existing library's key. Before the publish, restate it ("publish the external library MyLibrary"), say whether it is a new library or a new revision, and wait again. Don't offer to approve them in advance. These two confirmations always apply, even when the user asked for the upload or the publish in the same request.Public OutSystems repositories to read end to end. Read the code; where a repository's prose docs disagree with its code, trust the code.
src/UltimatePDF_ExternalLogic/IUltimatePDF_ExternalLogic.cs
(the [OSInterface] / [OSAction] surface, with optional nullable [OSStructure] parameters),
src/UltimatePDF_ExternalLogic/UltimatePDF_ExternalLogic.csproj (net10.0), the unit, integration
and live-tenant E2E test projects under src/, and generate_upload_package.ps1 (publish + zip). Read these scripts; do not run them: they change the
user's PowerShell execution policy.XmlToJson/IXmlToJson.cs, XmlToJson/XmlToJson.csproj, XmlToJson/generate_upload_package.ps1, which also changes the execution policy: read it, don't run it).
Its README states "THIS CODE IS NOT SUPPORTED BY OUTSYSTEMS" — read it as a minimal SDK sample,
not as supported OutSystems practice.| Error | Cause | Fix |
|---|---|---|
| Interface not found | Implementing class not in same assembly | Ensure interface and class are in the same .csproj |
| Unsupported type | Using class instead of struct for complex types | Use struct with [OSStructure] |
| ZIP structure wrong | Folder nested inside ZIP | Zip the contents of /publish, not the folder itself |
| Payload too large | Input/output exceeds 5.5 MB | Chunk data, use URLs, or split into multiple actions |
Server is busy, retry shortly on upload | All upload slots on the server were busy | Transient when it arrives as a CapacityError, or as a ValidationError from older servers: retry with backoff, as the main outsystems skill describes |
| Timeout | Single action takes more than 95 seconds | Break up long-running work; split the work across several actions |
| Missing icon | Forge submission fails | Embed PNG as EmbeddedResource and set IconResourceName |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub outsystems/outsystems-mcp --plugin outsystems7 skills in this plugin
/outsystemsOutSystems Developer Cloud (ODC) over MCP. Edit apps, publish, deploy, search tenant elements, manage external libraries. Load this skill before calling any tool from the OutSystems ODC MCP server, including read-only calls such as listing apps. Use for ANY OutSystems task on ODC. Not for OutSystems 11 (O11) modules open in Service Studio. When the Service Studio (O11) MCP server is also connected and the request names neither ODC nor O11, ask the user which platform before calling any OutSystems tool./outsystems-app-architecture[Beta] Generate an interactive HTML graph of a single OutSystems app's architecture — UI flows + screens, server/client/service actions with signatures, entities with attributes and relationships, static enums, structures, roles, AI model connections, library dependencies and where the app is deployed — with OutSystems-themed dark mode styling. ONE app per invocation — do NOT iterate over multiple apps in a single call (run the skill explicitly per-app; for more than 3 named apps, ask the user and wait for an explicit answer first). For 'every app' / 'all apps' requests and tenant-wide views, use outsystems-tenant-architecture instead: its scope guard asks before any per-app run, without listing the apps first. Use when the user asks for the architecture of a specific app, 'show me the architecture of [app]', 'explore [app]', 'what's inside [app]', 'give me an overview of [app]', or similar. Not for OutSystems 11 (O11) or Service Studio./outsystems-dependency-impact[Beta] Build an interactive HTML REVERSE-dependency explorer — answers 'who depends on this library/agent/connection?' from the platform's deletion-impact analysis (read-only; nothing is deleted). One named target is one analysis: seconds, a few K tokens. A whole-tenant map is one analysis per library/agent/connection in parallel batches (estimate: ~0.5K tokens per target plus ~0.1–0.15K per dependent found). Use ONLY for reverse questions like 'who depends on [library/agent]', 'if I publish [library] who breaks', 'blast radius of [library/agent]', 'reverse dependency map', 'library impact audit', 'agent impact audit'. For forward questions about a specific app ('what does App X depend on', 'deps of App X'), use outsystems-app-architecture or the app's references directly. Not for OutSystems 11 (O11) or Service Studio./outsystems-design-to-app[Beta] Drive ODC Mentor to bootstrap an OutSystems app from a design source — Figma URL, screenshot/image, HTML mockup, or structured front-end code (TSX/React/HTML, the highest-fidelity input). EXPERIMENTAL — greenfield-from-design layers on top of Mentor (built for in-flow edits) and fidelity varies; treat results as draft scaffolds, NOT ship-ready apps. Authors the design into a styling-complete spec.json (real OS UI blocks, not fake CSS; tokens, data model, sample data, chart series), then drives Mentor in batches and publishes. For prose-only briefs with NO concrete design or code, this skill does not apply. Use when the user asks to "build this design as an OutSystems app", "implement this Figma in OutSystems", "design to model", "design to app", "generate a screen from this mockup", "build this screen", or provides a Figma URL / image path / HTML or TSX file and wants it turned into a live OutSystems app. Not for OutSystems 11 (O11) or Service Studio./outsystems-spec-driven-build[Beta] Drive ODC Mentor to bootstrap an OutSystems app from a TEXT-ONLY structured spec. For Figma/image/HTML inputs, use `outsystems-design-to-app` instead. EXPERIMENTAL — Mentor is built for in-flow edits, so treat results as draft scaffolds for review, NOT ship-ready apps. A spec check first confirms every screen names a role the spec defines and that entities are listed, and warns when relationships or integrations are not stated; then it drives Mentor in two parts, data model then screens, each published, with guardrails against its known mistakes. Three entry modes — your own markdown spec file, an interview, or clone from an example template. Use when the user asks to "build a new app from spec", "generate an app from requirements", "have Mentor build [app] from this spec", "build an app from this written description", "write a spec for a new app and build it", or similar spec- or requirements-driven greenfield asks with NO design artifact. Not for OutSystems 11 (O11) or Service Studio./outsystems-tenant-architecture[Beta] Generate an interactive HTML graph of an OutSystems Developer Cloud tenant's assets (web/mobile apps, agents and agent definitions, AI model connections, knowledge bases, libraries, integrations) with filter-by-type controls, where each asset is deployed (revision drift per environment), a 7-day Production traffic/error overlay and an AI governance view (model providers, Trial vs Customer entitlement, test/demo-named and stale agents). ONE tenant-level pass per invocation, no per-app deep dives (use outsystems-app-architecture for one app); also the entry point for 'architecture of every app' requests, which it confirms before any per-app run. First run 2-5 min; cached re-runs ~5s. Use when the user asks for a tenant overview, architecture diagram, asset inventory, 'what's in my tenant', 'show me my apps', 'what is deployed where', an AI inventory, 'audit my AI', 'which models are we using', 'show me my agents', AI governance, or similar. Not for OutSystems 11 (O11) or Service Studio.Other plugins' skills for the same job