Skip to main content
Glama
GLPI MCP Server v2

GLPI MCP Server v2

by Luizcc87

GLPI MCP Server v2

🌐 英語版 · ポルトガル語(ブラジル)

GLPIと統合するためのTypeScript/Node製MCP(Model Context Protocol)サーバー。GLPI API v2.3(OAuth2経由)を使用し、ITILカバレッジと統合ツール(チケット、問題、変更、ナレッジベース、統計、資産、管理)をAIエージェントに直接提供します。

このプロジェクトは複数のツールを統合し、リクエストの重複を回避し、LLMが消費しやすい形式でデータを提供します。

🌟 クレジットと謝辞

このプロジェクトは、以下のツールの構造とカバレッジを再利用しています:

新しいGLPI API v2.3(OAuth2)に適合させています。ITILマッピングのアーキテクチャ的インスピレーションとビジネスロジックを提供してくれた原作者(GMS64260およびDevSkillsIT)に感謝します。

Related MCP server: mcp-itop

🚀 機能(ツール)

生産性に焦点を当てたツールが提供されます:

  • アシスタンス:チケット、問題、変更の作成、更新、検索(RSQLフィルター付き)、完全な読み取り(1リクエストでタイムラインを含む)。統計とフォローアップの追加。

  • ナレッジベース:記事の検索と読み取り。

  • 資産:コンピューターの一覧表示と読み取り(詳細な仕様を含めるフラグ付き)。

  • 管理:ユーザー検索、ユーザーコンテキストの読み取り、グループの一覧表示。

🛠 インストール

  1. リポジトリをクローンするか、ファイルをダウンロードします。

  2. 依存関係をインストールします:

    npm install
  3. プロジェクトをコンパイルします:

    npm run build

⚙️ 設定(.env)

プロジェクトのルートに.env.exampleファイルに基づいて.envファイルを作成します:

GLPI_BASE_URL=http://localhost:8080
GLPI_CLIENT_ID=seu_client_id_oauth2
GLPI_CLIENT_SECRET=seu_client_secret_oauth2
GLPI_USERNAME=usuario_glpi
GLPI_PASSWORD=senha_glpi

GLPIでOAuth2 APIクライアントを作成する方法

  1. GLPIにアクセスします(バージョン11 / v2.3有効)。

  2. 設定 → OAuthクライアント(/front/oauthclient.php)に移動します。

  3. 新しいクライアントを追加します。

  4. 許可で、パスワード(パスワードグラント — スクリプト/エージェントに推奨)を追加します。

  5. スコープで、少なくともapi(ユーザーコンテキストツールを使用する場合はuserも)を選択します。

  6. 保存し、保存されたアイテムに表示されるクライアントID(identifier)とクライアントシークレットをコピーします。

🔌 MCPクライアントへの登録

サーバーはstdio経由で実行されるため(node dist/index.js + 環境変数)、互換性のあるMCPクライアントならどれでも登録できます。以下にクライアント別の例を示します。

Claude Desktop / Claude Code

claude_desktop_config.json(Desktop)または.mcp.json(Claude Code、プロジェクトのルート)ファイル:

{
  "mcpServers": {
    "glpi-v2": {
      "command": "node",
      "args": [
        "caminho/absoluto/para/glpi-mcp-v2/dist/index.js"
      ],
      "env": {
        "GLPI_BASE_URL": "http://localhost:8080",
        "GLPI_CLIENT_ID": "seu_client_id_oauth2",
        "GLPI_CLIENT_SECRET": "seu_client_secret_oauth2",
        "GLPI_USERNAME": "usuario_glpi",
        "GLPI_PASSWORD": "senha_glpi"
      }
    }
  }
}

Antigravity(IDEおよびCLI)

~/.gemini/config/mcp_config.json(グローバル)または.agents/mcp_config.json(ワークスペースごと)ファイル:

{
  "mcpServers": {
    "glpi-v2": {
      "command": "node",
      "args": [
        "caminho/absoluto/para/glpi-mcp-v2/dist/index.js"
      ],
      "env": {
        "GLPI_BASE_URL": "http://localhost:8080",
        "GLPI_CLIENT_ID": "seu_client_id_oauth2",
        "GLPI_CLIENT_SECRET": "seu_client_secret_oauth2",
        "GLPI_USERNAME": "usuario_glpi",
        "GLPI_PASSWORD": "senha_glpi"
      }
    }
  }
}

Codex CLI(OpenAI)

~/.codex/config.toml(グローバル)または.codex/config.toml(プロジェクトごと、信頼できる環境)ファイル:

[mcp_servers.glpi-v2]
command = "node"
args = ["caminho/absoluto/para/glpi-mcp-v2/dist/index.js"]

[mcp_servers.glpi-v2.env]
GLPI_BASE_URL = "http://localhost:8080"
GLPI_CLIENT_ID = "seu_client_id_oauth2"
GLPI_CLIENT_SECRET = "seu_client_secret_oauth2"
GLPI_USERNAME = "usuario_glpi"
GLPI_PASSWORD = "senha_glpi"

またはcodex mcp add glpi-v2 --command node --args caminho/absoluto/para/glpi-mcp-v2/dist/index.js(env vars用の対話式)を使用します。

Hermes Agent

hermes mcp add glpi-v2 --command "node caminho/absoluto/para/glpi-mcp-v2/dist/index.js"

環境変数(GLPI_BASE_URL、GLPI_CLIENT_IDなど)は、Hermesが実行される環境で利用可能である必要があります。または、プロジェクトディレクトリの.envで設定します(サーバーはdotenvを介して読み込みます。該当する場合 — src/config.tsを確認してください)。

OpenClaw

~/.openclaw/openclaw.jsonファイル:

{
  "mcp": {
    "servers": {
      "glpi-v2": {
        "command": "node",
        "args": [
          "caminho/absoluto/para/glpi-mcp-v2/dist/index.js"
        ],
        "transport": "stdio",
        "env": {
          "GLPI_BASE_URL": "http://localhost:8080",
          "GLPI_CLIENT_ID": "seu_client_id_oauth2",
          "GLPI_CLIENT_SECRET": "seu_client_secret_oauth2",
          "GLPI_USERNAME": "usuario_glpi",
          "GLPI_PASSWORD": "senha_glpi"
        }
      }
    }
  }
}

注: 上記のHermes AgentとOpenClawの例は、執筆時点での各プロジェクトの公開ドキュメントに従っていますが、このサーバーに対して直接テストされていません。本番環境で依存する前に、ローカルで接続を検証してください(公開されたツールを一覧表示)。

代替:HTTPトランスポート

クライアントがstdioをサポートしない場合、サーバーはStreamableHTTPServerTransportも公開します(src/httpServer.tsを参照)。プロセスの環境変数でMCP_TRANSPORT=httpを設定し、オプションでMCP_HTTP_PORT(デフォルト3000)を設定します。エンドポイントはhttp://localhost:<ポート>/mcp(POST)にあります — ローカルコマンドの代わりにクライアントをこのURLにポイントします。

📄 OpenAPI仕様(開発リファレンス)

swagger-v2.3.jsonファイル(GLPIによって動的に生成されるAPI v2.3の完全なOpenAPI仕様)はバージョン管理されていません(git-ignored — 4.6MB、生成済み)。実行中のGLPIインスタンスから再生成するには:

curl -s "http://SEU_GLPI/api.php/doc.json" -o swagger-v2.3.json

🌐 HTTPモード(Express)

サーバーはオプションで、推奨されるステートレスエンドポイント(POST /mcp)を使用したHTTP通信をサポートします。このモードを有効にするには、環境変数を設定します:

  • MCP_TRANSPORT=http(デフォルトはstdio)

  • MCP_HTTP_PORT=3000(オプション、Expressサーバーのポートを定義)

curlを使用してツールを一覧表示するリクエストの例:

curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'

ライセンス

MIT

Available Tools

30 tools
glpi_add_change_followupA

Adiciona um followup (acompanhamento) à timeline de um change.

Inputs: id (required), content (required), is_private.

glpi_add_problem_followupB

Adiciona um followup (acompanhamento) à timeline de um problem.

Inputs: id (required), content (required), is_private.

glpi_add_ticket_followupC

Adiciona um followup (acompanhamento) à timeline de um ticket.

Inputs: id (required), content (required), is_private.

glpi_create_changeC

Cria um novo change.

Inputs: input (required).

glpi_create_problemC

Cria um novo problem.

Inputs: input (required).

glpi_create_ticketB

Cria um novo ticket.

Inputs: input (required).

glpi_get_asset_statsC

Retorna estatísticas de ativos (assets) associados a chamados, mudanças ou problemas.

Inputs: itemtype (required), date_end, date_start.

glpi_get_changeA

Retorna o contexto completo de UM change, incluindo timeline, sem precisar de múltiplas chamadas.

Inputs: id (required).

glpi_get_change_statsC

Retorna as estatísticas de um change.

Inputs: id (required).

glpi_get_change_timelineB

Retorna a timeline de UM change (followups, tasks, etc).

Inputs: id (required).

glpi_get_computerC

Retorna o contexto completo de UM computador, incluindo especificações de hardware (CPU, memória, disco, rede) e software instalado.

Inputs: id (required).

glpi_get_knowbase_itemA

Retorna o conteúdo completo de um artigo da base de conhecimento.

Inputs: id (required), language.

glpi_get_problemC

Retorna o contexto completo de UM problem, incluindo timeline, sem precisar de múltiplas chamadas.

Inputs: id (required).

glpi_get_problem_statsC

Retorna as estatísticas de um problem.

Inputs: id (required).

glpi_get_problem_timelineA

Retorna a timeline de UM problem (followups, tasks, etc).

Inputs: id (required).

glpi_get_ticketA

Retorna o contexto completo de UM ticket, incluindo timeline, sem precisar de múltiplas chamadas.

Inputs: id (required).

glpi_get_ticket_statsC

Retorna as estatísticas de um ticket.

Inputs: id (required).

glpi_get_ticket_timelineA

Retorna a timeline de UM ticket (followups, tasks, etc).

Inputs: id (required).

glpi_get_user_contextC

Retorna o contexto de UM usuário, incluindo itens usados e gerenciados.

Inputs: id (required).

glpi_list_computersC

Busca e lista computadores (Assets). Permite paginação (start, limit) e filtros (filter em RSQL).

Inputs: limit, start, filter, include_specs.

glpi_list_groupsA

Busca e lista grupos (Groups). Permite paginação e filtros.

Inputs: limit, start, filter.

glpi_search_changesC

Busca e lista changes. Permite paginação (start, limit) e filtros (filter em RSQL).

Inputs: limit, start, filter.

glpi_search_faqA

Busca artigos marcados como FAQ na base de conhecimento (is_faq=true). Use para dúvidas rápidas de uso do GLPI antes de abrir ticket.

Inputs: limit, query, start, language.

glpi_search_knowbaseA

Busca artigos na base de conhecimento (Knowledgebase). Permite paginação (start, limit) e filtros (filter).

Inputs: limit, start, filter, language.

glpi_search_problemsA

Busca e lista problems. Permite paginação (start, limit) e filtros (filter em RSQL).

Inputs: limit, start, filter.

glpi_search_ticketsB

Busca e lista tickets. Permite paginação (start, limit) e filtros (filter em RSQL).

Inputs: limit, start, filter.

glpi_search_userA

Busca e lista usuários (Users). Permite paginação e filtros.

Inputs: limit, start, filter.

glpi_update_changeA

Atualiza campos de um change existente.

Inputs: id (required), input (required).

glpi_update_problemC

Atualiza campos de um problem existente.

Inputs: id (required), input (required).

glpi_update_ticketC

Atualiza campos de um ticket existente.

Inputs: id (required), input (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 30 tools

    Disambiguation4/5

    Tools mostly target distinct resources and actions: tickets, problems, changes, knowledgebase, computers, users, and groups are clearly named. Some overlap exists between full-context getters and standalone timeline getters, and between knowledgebase search and FAQ search, but the descriptions help disambiguate them.

    Naming Consistency4/5

    Nearly all tools follow glpi_verb_entity snake_case with consistent create/update/search/get/add patterns for the main ITSM entities. Minor deviations include list_computers/list_groups versus search_* for the other collections, and get_knowbase_item versus get_computer/get_ticket.

    Tool Count2/5

    At 30 tools, this is above the 25-tool heavy threshold and the set includes redundant timeline endpoints that duplicate the full-context getters. A leaner set around 20-22 tools could cover the same GLPI modules without extra selection burden.

    Completeness3/5

    The core ticket/problem/change lifecycle is well covered with search, get, create, update, and followup, and there is read access to knowledgebase, computers, users, and groups. However, there are no create/update/delete operations for computers, users, or groups, no knowledgebase write tools, and no task/solution-specific endpoints for tickets, problems, or changes.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      MCP server allowing an AI assistant to interact directly with your GLPI instance via its REST API, enabling ticket management, knowledge base operations, and statistics.
      40
      4
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for iTop ITSM that provides 19 tools for analytics, ticket management, comments, knowledge base, and CI impact analysis, enabling AI assistants to interact with iTop.
      1
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for ticketing automation that exposes tools to create, search, and update IT helpdesk tickets, with metrics tracking.
      -