@cnri/doip-mcp-connector
v1.1.0
Published
MCP server for connecting to a DOIP service
Downloads
39
Maintainers
Readme
DOIP-MCP Connector
Introduction
This project is a locally run MCP server that connects to an implementation of a DOIP service, such as that provided by a Cordra server. It provides an MCP-enabled client application access to the standard DOIP operations search, retrieve, create, update, and delete, as well as any custom operations the DOIP service makes available.
The DOIP-MCP Connector requires CNRI's DOIP Client Library - JavaScript Version.
Prerequisites
DOIP Service
You will need to install or have access to a DOIP service such as a Cordra server. You will need the IP address and port of the server's DOIP interface as well as the user credentials you want the DOIP-MCP Connector to use when making requests.
Node.js
The DOIP-MCP Connector runs on Node.js and requires Node.js v22 or later.
MCP-enabled Client Application
This document assumes you will be using the Claude Desktop App as an MCP client. Other clients can be used assuming they support MCP servers with stdio transport.
Installation and Configuration
Create a file config.json to point at your DOIP service:
{
"authentication": {
"username": "admin",
"password": "password"
},
"serviceInfo": {
"ipAddress": "localhost",
"port": 9000
}
}You may wish to include the property "readOnly": true if you do not
want to allow the MCP-enabled client application to use create,
update, or delete.
You can include an optional property "toolPrefix" which is a string
that will be prepended to each of the tool names (including for
example "search" and "retrieve") advertised to the MCP-enabled client
application. This can help the client application distinguish
different instances of the DOIP-MCP Connector talking to different
DOIP services.
You will need to configure the MCP-enabled client application to start the DOIP-MCP Connector.
To install from DXT file into Claude Desktop:
- In Claude Desktop, go to "Settings" -> "Extensions" -> "Advanced Settings" -> "Install Extension"
- Select the DXT file, click "Install", confirm
- Browse to your config.json file and click "Save"
- Click the slider from "Disabled" to "Enabled"
- Close the settings and go back to Claude chats.
To install from published NPM package via claude_desktop_config.json:
For Claude Desktop, you need to edit the file claude_desktop_config.json.
To find this file:
- Run the Claude Desktop app
- From the menu bar select Claude → Settings...
- Select the "Developer" tab
- Click the "Edit Config" button
That will bring up a file browser pointing at the folder that contains
the claude_desktop_config.json file.
Edit the file adding the DOIP-MCP Connector to the map of MCP servers;
you will need to include the file location of your config.json file.
{
"mcpServers": {
"doip-mcp-connector": {
"command": "npx",
"args": [
"-y",
"@cnri/doip-mcp-connector",
"/path/to/config.json"
]
}
}
}Note: You may need to edit the "command" to point at the correct version of npx.
You can now restart the Claude Desktop App and it should start the DOIP-MCP Connector and list the available tools.
Check that it is working by prompting Claude with "What DOIP operations can you perform?"
Custom DOIP Operations
In the below example JavaScript we implement in Cordra a custom
operation getNthPrime, which returns the prime number specified
in the n argument.
In order to make this operation available to the MCP-enabled client
application, we need to describe the operation. This is done by
implementing a custom operation
20.DOIP/Op.ListOperationsForTypeWithDetails as a static operation to
be performed on a type (Schema) object and/or as a service-level
operation. The DOIP-MCP Connector, on startup, will invoke the
20.DOIP/Op.ListOperationsForTypeWithDetails as a service-level
operation and for all type (Schema) objects found via search, in order
to discover what custom operations are available.
The operation 20.DOIP/Op.ListOperationsForTypeWithDetails returns an
array of JSON objects, where each object describes a custom
operation. Each operation description can have:
- id (required): the identifier of the operation
- description (required): a human-readable description
- attributesSchema (optional): a JSON Schema describing the attributes expected by the operation
- inputSchema (optional): a JSON Schema describing the input expected by the operation
- annotations (optional): an MCP tool annotations object (see MCP
documentation for details)
If the operation is a static operation to be performed on the type
object itself instead of an object of that type, you will need to
include
"isStatic": true.
To use this sample, in Cordra UI:
- Sign in as admin.
- From the Admin menu select "Design JavaScript".
- Copy the below JavaScript into the JavaScript editor.
- Click the "Save" button.
- You will need to restart the Claude Desktop App for it to discover the new operation.
To test that the operation is available in Claude as an MCP tool use the following prompt:
"Use a DOIP operation to calculate the 11th prime number"
exports.staticMethods = {};
exports.staticMethods.getNthPrime = getNthPrime;
exports.staticMethods["20.DOIP/Op.ListOperationsForTypeWithDetails"] = listOperationsForTypeWithDetails;
function getNthPrime(context) {
let n = context.params.n;
let count = 0, num = 1;
while (count < n) {
num++;
let isPrime = true;
for (let i = 2; i * i <= num; i++) {
if (num % i === 0) {
isPrime = false;
break;
}
}
if (isPrime) count++;
}
return num;
}
function listOperationsForTypeWithDetails(obj, context) {
return [
{
isStatic: true,
id: "getNthPrime",
description: "Get the nth prime",
inputSchema: {
"type": "object",
"properties": {
"n": {
"type": "integer",
"minimum": 1,
"maximum": 10000,
"description": "The position of the prime number to find (e.g. 5 for the 5th prime)"
}
},
"additionalProperties": false
}
}
];
}License
See the LICENSE.txt file for details.
