Imagine typing in Claude AI: " Generate a report of QZDASOINIT jobs ".
Twenty seconds later, a full table appears: per-job summary, color-coded statuses, execution details, real-time data coming straight from your IBM i.
Sounds impossible?
Yet that’s exactly what we’re going to set up with .NET and NTi.
In this article, we will see how to:
- Create an MCP server in .NET 8
- Connect this server to an IBM i using NTi
- Expose it to Claude Desktop in secure mode stdio
- Execute a first real-time request
In the next articles, we will go further: calling RPG programs, running CL commands, and executing read/write SQL.
But let’s start at the beginning: install and configure an MCP server for IBM i.
What Is Model Context Protocol (MCP)?
Model Context Protocol is an open standard, released by Anthropic in 2024, that allows any AI agent to communicate with external data sources, databases, APIs, ERPs, or in our case, an IBM i.
Before MCP, the AI agent was essentially confined to its own bubble. It could answer general questions, generate text, analyze documents, but had no way to retrieve data directly from a third-party system.
In practice, you create an MCP server from .NET, which exposes functionality as tools. When you ask Claude Desktop a question, it analyzes your request, identifies the appropriate tool, calls it with the right parameters, retrieves the data from the IBM i, and responds in natural language.
You write no code on the Claude side. Everything happens on the .NET side.

What is striking is the simplicity of the implementation: a .NET application, the ModelContextProtocol package, NTi for the IBM i connection, Claude Desktop as the AI agent, and your system responds to Claude in seconds.
Why connect IBM i to an AI agent?
A user wants to know why a customer order has not been shipped? Instead of navigating through multiple 5250 screens, he asks the question in natural language. Claude queries the order, status and stock tables, and returns a clear summary.
An operations manager notices a slowdown? He asks Claude "What are the most CPU-intensive jobs right now?". The AI agent queries the QSYS2 system views and returns a table.
A sales manager wants to visualize the evolution of current month sales. He asks "show me daily sales with a comparison against the previous month". Claude queries DB2 for i, aggregates the data, then generates a dashboard with trend charts, cumulative totals, etc…
In all these cases, the AI agent relies on the tools you have exposed through your MCP server. Each tool encapsulates an SQL query, an RPG program call, or a system view read.
Once these access points are properly defined, Claude can query multiple sources successively, leverage the returned results and produce a visual and structured summary.
Privacy and Security
The MCP server operates in two modes:
- SSE (Server-Sent Events): the server is exposed via HTTP on your network and can be consumed by authorized clients.
- stdio: the server runs locally on the same machine as Claude Desktop, with no network exposure.
This is the second mode we will be using in this article.
In both cases, data stays within your infrastructure, the MCP server does not transmit anything on its own to the outside. When Claude calls a tool, the returned results are sent to the model in order to generate the response.
IBM i access is managed through NTi. The AI agent has no additional privileges, it operates strictly with the permissions of the IBM i profile used for the connection.
Confidentiality therefore depends on:
- The data you choose to expose through your tools,
- The network configuration of your MCP server,
- The data processing policies of the model provider you use.
Prerequisites
Before getting started, here is what you need. Allow about twenty minutes to get everything up and running.
Development side
- .NET 8 SDK or higher
- Visual Studio 2022 or VS Code with the C# extension
IBM i side
- An IBM i connection with a development user account (read-only recommended)
- The NTi data provider : Free evaluation license available.
For testing
- Claude Desktop (free): the AI agent that will consume your MCP server, downloadable here.
Step 1: Project Setup
Open a terminal and navigate to your projects folder.
Create the project and open it in Visual Studio:
dotnet new console -n NTiMcpServer -f net8.0
cd NTiMcpServer
start devenv NTiMcpServer.csproj
Then add the following packages:
dotnet add package Aumerial.Data.Nti
dotnet add package ModelContextProtocol --prerelease
dotnet add package Microsoft.Extensions.Hosting
dotnet add package DapperStep 2: MCP Server Configuration
Open program.cs and replace its content with the following code:
using Aumerial.Data.Nti;
using NTiMcpServer.Tools;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using ModelContextProtocol;
var builder = Host.CreateApplicationBuilder(args);
builder.Logging.AddConsole(o => o.LogToStandardErrorThreshold = LogLevel.Trace);
builder.Services
.AddSingleton(new NTiConnection("server=***;user=***;password=***;"))
.AddMcpServer()
.WithStdioServerTransport()
.WithTools();
await builder.Build().RunAsync();
Replace the connection string values (server, user, password) with your IBM i credentials.
It is recommended to use a dedicated profile with limited permissions for testing.
Step 3: First Tool - AdminTools
Create a Tools folder in your project, then add an AdminTools.cs file inside it:
using Aumerial.Data.Nti;
using Dapper;
using ModelContextProtocol.Server;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace NTiMcpServer.Tools
{
public class AdminTools
{
private readonly NTiConnection _conn;
public AdminTools(NTiConnection conn)
{
_conn = conn;
}
[McpServerTool]
[Description("List active QZDASOINIT jobs on the IBM i")]
public IEnumerable GetActiveJobs()
{
return _conn.Query("SELECT * FROM TABLE(QSYS2.ACTIVE_JOB_INFO()) WHERE JOB_NAME LIKE '%QZDASOINIT%'");
}
}
}
We specify the dynamic type because the exact columns returned by QSYS2.ACTIVE_JOB_INFO are not known in advance.
The [McpServerTool] attribute exposes the method as a tool available to the AI agent. Any method annotated this way becomes accessible via the MCP protocol. The clearer the description, the more accurately the agent will select the right tool.
Step 4: Starting the Server and Setting Up Claude Desktop
Once the code is in place, build and start the server from the terminal:
dotnet run
The server starts and listens for incoming messages via stdio.
Then open the Claude Desktop configuration file. On Windows, it is located here:
%AppData%\Claude\claude_desktop_config.json
💡To verify that Claude Desktop is properly installed, you should find several folders and files there. If the folder is empty or missing, Claude Desktop is not properly installed.
Then add the following configuration, adapting the path to your project:
{
"mcpServers": {
"ntimcpServer": {
"command": "dotnet",
"args": [
"run",
"--project",
"C:\\ABSOLUTE\\PATH\\TO\\PROJECT"
]
}
}
}
⚠️ Pay close attention to indentation and JSON validity. A missing comma or an unclosed curly brace will prevent Claude Desktop from starting properly. You can validate your file on jsonlint before saving.
Save the file and restart Claude Desktop.
To verify that your server is properly detected, click the "+" icon at the bottom of the conversation window, then hover over connectors.
You should see ntimcpserver appear in the list.

Step 5: First Test
Your server is connected, and your IBM i is accessible. It is time to test.
Open a new conversation in Claude Desktop and ask for example:
" List the active jobs on the IBM i and display the result using IBM's Carbon Design System. "
Claude will call the GetActiveJobs tool, retrieve the data from the IBM i, and generate an HTML render formatted with the Carbon Design System (IBM's official design system, instantly recognizable).

Pour aller plus loin
The MCP server is up and running, the IBM i connection is working, and you have seen what an AI agent can produce from a simple natural language question. The rest of the series will go deeper into the possible interactions between an AI agent and an IBM i:
- Execute read/write SQL queries on DB2 for i
- Call an RPG program from an AI agent
- Run CL commands in natural language
All examples in this series are built on NTi data provider, the reference .NET / IBM i connector.
It handles the DB2 for i connection, RPG program calls, and CL command execution from a .NET application.
A 30-day evaluation license is available for free.
Everything in this series can be built and tested within the trial period.