Skip to content

mia-platform/console-mcp-server

Repository files navigation

Mia-Platform Console MCP Server

pipeline status license

Introduction

The Mia-Platform Console MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Mia-Platform Console APIs, enabling advanced automation and interaction capabilities for developers and tools.

Prerequisites

  1. To run the server in a container, you will need to have Docker installed.
  2. Once Docker is installed, you will also need to ensure Docker is running.
  3. Lastly you will need to a way ot authenticate to your Mia-Platform Console installation, you either have to:
    • Create a Mia-Platform Service Account with Client Secret Basic authorization mode (the only one supported at this time) the Client Secret Basic one.
    • Use miactl authentication: if you have miactl installed you can run any command to login, the same session will then be used by the mcp server to authenticate.

Warning

When using miactl session, auto-refresh by the MCP Server is not currently supported, once the session created with miactl expires you have to refresh it with miactl again.


Important

When using miactl session, the host you provide to the MCP Server MUST be the exact same as the one you have logged in with miactl, including scheme and any possible trailing slash.

How to Run

To run the MCP server on your machine you can follow the instructions in the Setup Documentation

Run from sources

If you don't have Docker installed, you can use NPM and Node.js for running it locally. Once you have cloned the project you can run the commands:

npm ci
npm run build

These commands will install all the dependencies and then transpile the typescript code in the build folder.
Once these steps are completed you can setup the MCP server using the node command like the following:

{
  "mcp": {
    "servers": {
      "mia-platform-console": {
        "command": "node",
        "args": [
          "${workspaceFolder}/mcp-server",
          "start",
          "--stdio",
          "--host=https://console.cloud.mia-platform.eu"
        ],
        "env": {
          "MIA_PLATFORM_CLIENT_ID": "<YOUR_CLIENT_ID>",
          "MIA_PLATFORM_CLIENT_SECRET": "<YOUR_CLIEND_SECRET>"
        }
      }
    }
  }
}

Local Development

To help with the development of the server you need Node.js installed on your machine.
The recommended way is to use a version manager like nvm or mise.

Once you have setup your environment with the correct Node.js version declared inside the .nvmrc file you can run the following command:

npm ci

Once has finished you will have all the dependencies installed on the project, then you have to prepare an environent file by copying the default.env file and edit it accordingly.

cp default.env .env

Finally to verify everything works, run:

set -a && source .env
npm run local:test

If you are not targeting the Console Cloud installation you can use the --host flag and specify your own host

npm run local:test  -- --host https://CONSOLE_HOST

This command will download and launch the MCP inspector on http://localhost:6274 where you can test if the implementation will work correctly testing the tools discovery and calls without the needs of a working llm environment.

To run tests for new implementations you can use:

npm test

Or running a test for a single file run:

node --test --import tsx <FILE_PATH>

About

Mia-Platform Console MCP Server

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 5