1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[ODC]MCPでExternal Logicを作ってみる

1
Posted at

OutSystemsが提供するODC向けのMCPツールをみていたら、External Logic関連も含まれていたので、簡単なExternal Logic作成手順を試してみる。

環境情報

Claude Code v2.1.302(Opus 5.5)
ODC Personal Edition

MCPのツール

Claude Codeに聞いてみたところ、MCPにはExternal Logicで以下のツールがあった。この中で重要そうなのは、extlib_upload (作ったzipをアップロードする)、extlib_status (uploadやpublishの状況を確認する)、extlib_contents (uploadしたライブラリのActionやStructureをリスト)、extlib_publish (文字通りPublishする)だろうか。Claude CodeだけでExternal Logic開発からPublishまで実践できそうなことが確認できた。

  • extlib_upload
  • extlib_status
  • extlib_logs
  • extlib_contents
  • extlib_publish
  • extlib_operations_list
  • extlib_delete
  • extlib_download_source
  • extlib_download_status

Projectのボイラープレート

Claude Codeに「ODCのExternal Logic向けのボイラープレートLibrary ProjectをC#で作って」と依頼し、auto modeで6分弱したらできた。

出来上がったプロジェクトから、ActionのI/Fを決めるinterfaceを見る。
Greetという動作確認用Action1つのみを含む。属性はあいからわずちゃんとついているように見える。

IOdcBatchExcel.cs
using OutSystems.ExternalLibraries.SDK;

namespace OdcBatchExcel;

/// <summary>
/// The ODC External Logic contract. Every method here becomes a server action in ODC.
/// </summary>
/// <remarks>
/// <see cref="OSInterfaceAttribute.Name"/> is the library's identity in the tenant:
/// keep it stable, or ODC will treat the upload as a brand-new library.
/// </remarks>
[OSInterface(Name = "OdcBatchExcel", Description = "Batch processing of Excel files for ODC apps.")]
public interface IOdcBatchExcel
{
    /// <summary>
    /// Returns a greeting for the given name.
    /// </summary>
    /// <param name="name">The name to greet.</param>
    /// <returns>A greeting message.</returns>
    [OSAction(Description = "Returns a greeting for the given name.", ReturnName = "Greeting")]
    string Greet([OSParameter(Description = "The name to greet.")] string name);
}

Publish

C#プロジェクトを作成したClaude CodeにはすでにOutSystemsのMCP pluginがインストールされているため、完了報告の中に以下のように「External Logicのアップロードまでやろうか?」という趣旨の文言が入っていた。

If you want, I can run extlib_upload and then extlib_contents on artifacts/OdcBatchExcel.zip to check that ODC accepts it and finds Greet. That changes your tenant, so I'll wait for your go-ahead.

というわけでPublishして、と依頼した。

Publishは4分弱で終わった。Publishにはdotnet publishで作ったdllをまとめたzipファイルが必要だが、Claude CodeはMCPの説明からそのことを事前に理解していて、dotnet publish + zip化を行うpackage.shを用意しており、これが自動で使われた。

ちゃんとアップロードが正常終了したか、含めておいたActionが認識されているか、まで含めて確認してくれている。

ODC Portalでも確認できた。
image.png

動作確認 → 「Try library in an app」はMCPではできないらしい

PublishしたExternal Libraryは、「Try library in an app」で既存Appに参照させて動作確認してから、「Release Library」を行なってどのAppでも参照できる正式バージョンにする。
Claude Codeに確認したが、前者の「Try library in an app」はMCPではできないとのことだったので手動で行なった。

Release Library → これもツールがないらしいので手動

Claude Codeがそのツールはないと言っていたので、ODC Portal上で通常の手順を踏んで自分でReleaseした。
一応MCPでなく、ChromeのタブをClaudeが操作する方法でならできる、という提案はあったが。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?