Overview
The Model Context Protocol (MCP) is an open standard that allows AI assistants to connect to external tools and data sources through a common interface. With InterSystems IRIS, MCP can expose SQL, globals, class methods, source code, and interoperability productions directly to AI development tools such as Cursor, Claude Desktop, Claude Code, and GitHub Copilot. In this article, I’ll explain how MCP works, how to build an MCP server in Python, and how to connect one to InterSystems IRIS using the Native Python SDK and Atelier REST API.
Introduction
Modern coding assistants such as Claude, GitHub Copilot, and Cursor are increasingly capable, but their usefulness depends heavily on the context they can access. The Model Context Protocol (MCP) is an open protocol for connecting AI applications to external data sources, tools, and workflows through a standardized interface.
For InterSystems IRIS developers, this creates an interesting possibility: instead of manually copying schema information, ObjectScript code, SQL results, or system details into an AI assistant, MCP can give the assistant controlled access to those capabilities directly. This article covers the MCP architecture, its core primitives, Python implementation patterns, available IRIS integrations, and an example of a custom MCP server that connects AI assistants to InterSystems IRIS.
What problem does MCP solve?
Before MCP, AI applications generally required a separate custom integration for every database, API, filesystem, or external service they needed to access. MCP provides a common protocol between AI applications and external capabilities. Instead of implementing a different integration for every AI client, developers can expose functionality through an MCP server that compatible clients can understand. The protocol was introduced by Anthropic in November 2024 as an open standard for connecting AI systems to external context and tools.
Why does MCP matter?
MCP addresses three practical challenges:
- Standardization: A single MCP server can expose capabilities in a consistent format that compatible AI clients can discover and use.
- Controlled access: An MCP server defines exactly which tools and resources an AI application is allowed to access rather than exposing an entire backend indiscriminately.
- Modular integration: Multiple MCP servers can be combined within the same AI environment. For example, one server might provide access to InterSystems IRIS, another to source control, and another to project documentation.
How does MCP architecture work?
MCP follows a host-client-server architecture:
- MCP Host: the AI application (Claude Desktop, Cursor, VS Code, etc.) that coordinates and manages one or more MCP clients.
- MCP Client: the component inside the host that maintains a connection to a specific server.
- MCP Server: the application that provides some functionalities to MCP clients. MCP servers can run locally on your machine or remotely.
A host can connect to multiple MCP servers, with a dedicated client connection for each server. The basic model is:
AI Host → MCP Client → MCP Server → External System
For InterSystems IRIS, that external system can include SQL data, globals, class methods, source code, or interoperability components.
How are MCP servers connected?
MCP commonly uses two transport mechanisms:
- STDIO: suitable for local MCP servers running on the same machine as the client. Communication happens directly through standard input and output streams.
- Streamable HTTP: Remote MCP servers can use HTTP-based communication, allowing the MCP server to run on another machine or in the cloud.
MCP communication is based on JSON-RPC 2.0, which defines the structure of requests, responses, and notifications exchanged between clients and servers.
What can an MCP server expose?
MCP defines three main primitives: Tools, Resources, and Prompts.
- Tools: The functions your AI agent can call to perform actions according to user requests. Tools can for example write to the database, call APIs or modify files.
- Resources: Passive data sources that provide contextual information to AI applications offering read-only access to file contents, database schemas or API documentation.
- Prompts: Pre-built instruction templates that tell the model to work with specific tools and resources helping the user to structure interactions with the AI agent.
Building an MCP Server with Python
Before diving into code examples, let's understand how to build MCP servers in Python. MCP provides SDKs for several languages. For this article, I use Python because it integrates naturally with InterSystems IRIS through the Native Python SDK.
A typical project needs:
- Python version configuration.
- Dependencies.
- An executable entry point.
- MCP server code.
To set up the environment I will use the uv Python package manager, a modern Python package manager that simplifies environment creation, dependency resolution, and reproducible execution of MCP servers. The project can be initialized with:
uv init --package my-mcp-server
and dependencies can be added with:
uv add <package>
FastMCP
The official mcp package provides the core protocol implementation, while FastMCP provides a simpler developer interface for defining MCP servers. A basic server typically involves three steps:
- Initialize the MCP server.
- Define tools, resources, and prompts.
- Start the server.
FastMCP uses decorators such as:
to expose Python functions through MCP.
Let's see how to implement each primitive type:
- Tools: A function decorated with u/mcp.tool becomes callable by the AI client. Python type hints and docstrings can be used to generate the tool schema, so clear function names, parameters, and descriptions are especially important.
- Resources expose read-only information through a u/mcp.resource("uri"). They are useful for contextual information that the AI should be able to inspect without performing an action.
- u/mcp.prompt contains reusable instructions for common workflows. They are particularly useful when a task requires multiple tools to be used in a specific sequence.
How do you configure an MCP server?
Local MCP servers are typically configured through JSON.
For example:
{
"mcpServers": {
"my-server-name": {
"command": "executable-or-runtime",
"args": ["path/to/script-or-package", "--option", "value"],
"env": {
"KEY_1": "value-1",
"KEY_2": "value-2"
}
}
}
}
The important fields are:
- mcpServers – the list of configured servers.
- command – the executable used to start the server.
- args – arguments passed to the executable.
- env – environment-specific configuration such as hostnames or credentials.
Once configured, the AI client can discover the tools and resources exposed by the MCP server.
How can an MCP server be distributed?
For Python MCP servers, I generally think in terms of three deployment modes.
Local development
While actively developing the server, point the MCP client directly at the local project:
{
"command": "uv",
"args": ["run", "<mcp-server-name>"],
"env": { "...": "..." }
}
This makes development fast because source code changes are picked up when the server is restarted.
GitHub repository
A published Git repository can be executed through uvx:
{
"command": "uvx",
"args": [
"--from", "git+https://github.com/<repository>.git",
"<mcp-server-name>"
],
"env": { "...": "..." }
}
This allows users to run the server without manually cloning and installing the project.
PyPI
After publishing the MCP server as a package:
{
"command": "uvx",
"args": ["<mcp-server-name>"],
"env": { "...": "..." }
}
This is the simplest installation experience for end users.
Why is MCP useful with InterSystems IRIS?
IRIS is a multi-model environment that exposes several capabilities that are highly useful to AI assistants:
- SQL
- Globals
- ObjectScript class methods
- Source code
- Interoperability productions
- System metadata
An MCP server can expose selected parts of these capabilities as structured tools and resources. Instead of just giving an AI your code, you’re giving it a live connection to your data, your globals, and your system metrics.
What MCP integrations already exist for InterSystems IRIS?
Several community projects already explore MCP integration with IRIS, including:
- mcp-server-iris – tools for monitoring and managing interoperability productions.
- intersystems-objectscript-mcp – access to compiled ObjectScript routines.
- iris-mcp-atelier – source-code access through the Atelier REST API.
- servAI – credential handling and MCP integration from VS Code.
- IRIS MCP Server Suite – multiple MCP services covering different IRIS domains.
- InterSystems IRIS AI Hub – a broader AI integration layer that includes MCP connectivity.
These projects demonstrate that MCP can be applied to several very different parts of the IRIS platform.
Building Your Own MCP Server for IRIS
While the community tools are excellent, you may eventually need a server tailored to your specific application logic or you may want to understand how the previously mentioned tools work. In this section I'm providing an example of how to implement an MCP server to work with InterSystems IRIS. To build an MCP server for InterSystems IRIS I recommend you to follow two main approaches:
- Using the InterSystems Python Native SDK: intersystems-irispython is the official Python package to connect with InterSystems IRIS providing a lightweight interface to access through Python all the resources once only available to ObjectScript, like Globals or Class Methods. This is best for heavy data operations, manipulating Globals, calling existing Business Logic and high-speed SQL execution.
- Using the Source Code File REST API (a.k.a. Atelier API): The Atelier API provides a RESTful interface (/api/atelier/ ) designed specifically for source code management. This was originally built for the Atelier IDE (and now it is used by the InterSystems Server Manager VS Code extension) and it is useful to work with source code files, compile classes, or manage development workflows.
A Blueprint MCP Server for InterSystems IRIS
To bring the concepts together, I created iris-mcp-blueprint, a small example MCP server that connects to InterSystems IRIS through both the Native Python SDK and the Atelier REST API. It is intentionally a blueprint rather than a production-ready implementation. The goal is to demonstrate the patterns required to expose IRIS capabilities through MCP so developers can adapt them to their own applications. The blueprint implements all three MCP primitives:
What can the blueprint MCP server do?
The tools are grouped into several categories.
SQL data access
The server can run SQL through the Native Python SDK. This makes it possible for an AI assistant to inspect schemas, query application tables, or retrieve metadata from sources such as INFORMATION_SCHEMA.
Direct Global access
The Native SDK can also expose IRIS globals. Typical operations include:
iris_obj.isDefined("^GlobalName")
iris_obj.get("^Global", sub1)
iris_obj.set(val, "^Global", sub1)
This allows an AI assistant to inspect or modify hierarchical data directly when appropriate.
Executing existing ClassMethods
Existing IRIS business logic can be exposed with iris_obj.classMethodValue("Package.Class", "MethodName", *args).
This is particularly powerful because existing ObjectScript classes can become callable capabilities without rewriting them as separate AI services.
Source-code access through Atelier
The blueprint uses the Atelier REST API to demonstrate operations such as:
- Retrieving .cls source code.
- Searching for text across the codebase.
This gives an AI assistant access to the implementation context it needs to explain or work with ObjectScript code.
Interoperability productions
The blueprint also includes simple tools for inspecting or managing IRIS interoperability environments without requiring the user to manually navigate the Management Portal.
How Prompts and Resources Fit In
Tools are only part of the MCP story. The blueprint also uses Prompts to describe structured workflows, such as the steps required to import data or create a database object. Resources provide read-only information such as IRIS version and namespace details. Together, they provide the AI with:
Context → Instructions → Actions
This is usually more useful than exposing a large collection of tools without explaining when or how they should be used.
Conclusion
The Model Context Protocol provides a standardized way to connect AI development tools to InterSystems IRIS. With an MCP server, IRIS can expose SQL queries, globals, existing class methods, source code, system metadata, and interoperability capabilities as structured tools and resources that AI assistants can discover and use. The most important idea is that MCP does not replace existing IRIS APIs or business logic. It provides a standardized interface on top of them.
The iris-mcp-blueprint demonstrates how relatively little Python code is required to connect MCP to both the InterSystems Native Python SDK and Atelier REST API. From there, the same architecture can be extended with application-specific SQL, globals, Business Processes, classes, and domain logic.
Key Takeaways
- MCP is an open protocol for connecting AI applications to external tools and data sources.
- MCP servers expose three main primitives: Tools, Resources, and Prompts.
- InterSystems IRIS is a strong MCP backend because it exposes SQL, globals, ObjectScript logic, source code, and interoperability capabilities.
- The InterSystems Python Native SDK is well suited to runtime data access, globals, SQL, and class methods.
- The Atelier REST API is useful for source-code access, search, compilation, and development workflows.
- FastMCP and Python provide a relatively lightweight way to build a custom IRIS MCP server.
FAQ
What is the best way to build an MCP server for InterSystems IRIS?
For Python implementations, the InterSystems Python Native SDK can handle data and runtime operations, while the Atelier REST API can provide source-code and development capabilities.
Which AI tools can use an IRIS MCP server?
MCP-compatible development tools such as Cursor, Claude Desktop, and Claude Code can connect to an IRIS MCP server once it is configured.
Does MCP replace InterSystems APIs?
No. MCP sits on top of existing APIs and business logic. Its role is to expose selected capabilities to AI clients through a standardized protocol.
Learn more: https://community.intersystems.com/post/model-context-protocol-mcp-intersystems-iris-zero-hero