This repo provides a template to kickstart development with AI Hub.
- ./skills - agent skills with information on using AI hub for AI agents. Move these to a suitable location for your preferred AI coding agent.
- ./src/Sample - Basic sample classes for tools, toolsets, agents and MCP servers. These are installed with zpm when the container is build.
- ./src/Python - An example stdio MCP server defined in Python and used in the IRIS Toolsets
- Download an AI Hub container from the Early Access Program Portal. The docker-containers end with
docker.tar.gz, ensure you choose the version suitable for your operating system (arm64 for macOS).
OR
-
Copy AI Hub Container from your Flash Drive
-
Load the image with:
docker load -i /path/to/iris-community-2026.2.0AI.162.0-docker.tar.gz
Once it's complete you should see
Loaded image: docker.iscinternal.com/docker-intersystems/intersystems/iris-community:2026.2.0AI.162.0(if not you can usedocker imagesto find the image name). -
Change the Image name in the Dockerfile to match your version and operating system (image name printed above).
- Clone this repo:
git clone https://github.com/intersystems-community/ai-hub-dev-template
cd ai-hub-dev-template-
Add an OPENAI_API_KEY to a file called .env in this repo. You can see an example in .env.example. If you want to use another provider, change the Sample.Agent class in src/. If you don't want to use any agents at the moment (e.g. you want to create MCP tools to access from outside the container), create an empty .env file (
touch .env) or remove theenv_filetag from docker-compose.yml -
Build the container with:
docker-compose up -d --build You can find the Management Portal at http://localhost:52773/csp/sys/UtilHome.csp.
Login with: - SuperUser / SYS
You can access the IRIS Terminal with:
docker-compose exec -it iris iris session irisor the bash terminal with:
docker-compose exec -it iris iris session irisThere is a basic agent in src/Sample.Agent, a simple way to use it from objectscript is to run the following (note this does require an OPENAI_API_KEY to be added to .env before running th container).
zn "IRISAPP"
Set agent = ##class(Sample.Agent).%New()
Set sc = agent.%Init()
write:sc'=1 $SYSTEM.Status.GetErrorText(sc), !
Set session = agent.CreateSession()
Set request = "What tools do you have?"
Set response = agent.Chat(session, request)
Do ##class(%AI.System).RenderMarkdown(response.Content)You can also use the agents in streaming mode as follows:
// Create Stream Renderer
Set renderer = ##class(%AI.Shell.StreamRenderer).%New()
// Request requires using both tools defined in Sample.Tools and packaged in Sample.ToolSet
Set request = "Add a person named Peter aged 16, and then get people younger than 35."
// Stream Response
Set response = agent.StreamChat(session, request , renderer, "OnChunk")
do ##class(%AI.System).Shell("openai", $System.Util.GetEnviron("OPENAI_API_KEY"), "gpt-5-nano", "Sample.ToolSet")The build process installs an MCP server web application at http://localhost:52773/mcp/sample. You can check this MCP server is running by going to http://localhost:52773/mcp/sample/v1/services.
For the MCP Server to be usable, there is an additional step of starting this via a Rust binary which connects to IRIS through the web gateway protocol. The Binary is installed in /usr/irissys/bin (should already be in PATH).
A sample configuration is shown in config.toml, which serves a remote HTTP server on port 8080 (which is exposed by the docker-compose file). Please note, the port for the remote HTTP server is not the same as the web server port!
To start the transport, open a bash terminal within the container:
docker-compose exec -it iris bash Then start the iris-mcp-server
iris-mcp-server -c config.toml run You can now connect the MCP server to your MCP Client of choice (e.g. coding agents like claude code) using the address: http://localhost:8080/mcp/sample.
An example python MCP client is shown in test_mcp.py, which uses Langchain's MCP adapters module. To try this, run:
pip install langchain-mcp-adapters
python test_mcp.py