This repository contains various examples for how to use the two main parts of AI Hub: the ObjectScript SDK, which provides an API for agents to call regular ObjectScript methods as tools, and the iris-mcp-server, which allows clients to call tools exposed by InterSystems IRIS as MCP endpoints.
To load the examples in this repository:
USER> Do $SYSTEM.OBJ.Import("/path/to/Samples-AIHub/objectscript/cls", "ck", "*.cls", .errors, .imported)- An InterSystems IRIS instance with AI Hub. To download an AI Hub-enabled kit, go to downloads.intersystems.com.
- While not strictly required, most of the examples in this repository (with the exception of the
/mcp/calculatorexample) assume that you have at least tried the Quickstart examples for both the ObjectScript SDK and MCP Server from the documentation.
In /objectscript/cls/Sample/AI:
ToolsandToolSet- Example tools.Agent- Example Agents. These examples create agents declaratively by creating subclasses of%AI.Agentwith defined class parameters.Skill- Examples of how to define and use skills.Policies- Examples of how to create policies to audit tool calls.Examples- A sampler of various examples that uses one or more of the previous concepts.Proglang- A "Programming Language Professsor" agent and includes an MCP service example. You should refer to the Calculator example before exploring this one.Orders- Helper classes and scaffolding for other examples.Utils.cls- Helper functions for the various examples.
In /objectscript/cls/Sample/MCP/Service:
MCP_Service_README.md- Instructions for how to expose a simple calculator MCP endpoint in InterSystems IRIS.Calculator.cls- A basic example of an MCP service class which uses the tools defined inToolSet\BasicMath.cls.