GLPI MCP Server v2
GLPI MCP Server v2
🌐 English version · Português (Brasil)
MCP-сервер (Model Context Protocol) на TypeScript/Node для интеграции с GLPI. Использует API GLPI v2.3 (через OAuth2) для обеспечения покрытия ITIL и интегрированных инструментов (tickets, problems, changes, knowledgebase, stats, assets, administration) непосредственно для ИИ-агентов.
Этот проект объединяет множество инструментов, избегает повторения запросов и предоставляет данные в форматах, оптимизированных для потребления LLM.
🌟 Благодарности
Этот проект использует структуру и покрытие инструментов из:
GMS64260/mcp-glpi (MIT)
Адаптированы для нового API GLPI v2.3 (OAuth2). Благодарность оригинальным авторам (GMS64260 и DevSkillsIT) за архитектурное вдохновение и бизнес-логику маппинга ITIL.
Related MCP server: mcp-itop
🚀 Возможности (Tools)
Предоставляются инструменты, ориентированные на продуктивность, включая:
Assistance: Создание, обновление, поиск (с фильтрами RSQL) и полное чтение (включая timeline в 1 запросе) Tickets, Problems и Changes. Статистика и добавление follow-ups.
Knowledgebase: Поиск и чтение статей.
Assets: Перечисление и чтение Computers (с флагом для включения подробных спецификаций).
Administration: Поиск пользователей, чтение контекста пользователя и перечисление групп.
🛠 Установка
Клонируйте репозиторий или скачайте файлы.
Установите зависимости:
npm installСкомпилируйте проект:
npm run build
⚙️ Конфигурация (.env)
Создайте файл .env в корне проекта на основе файла .env.example:
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Как создать OAuth2 API-клиент в GLPI
Откройте GLPI (версия 11 / v2.3 включена).
Перейдите в Конфигурация → OAuth-клиенты (
/front/oauthclient.php).Добавьте нового клиента.
В Разрешениях добавьте
Senha(password grant — рекомендуется для скриптов/агентов).В Областях выберите как минимум
api(иuser, если будете использовать инструменты контекста пользователя).Сохраните и скопируйте Client ID (identifier) и Client Secret, отображаемые в сохранённом элементе.
🔌 Регистрация в 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 (для workspace):
{
"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 выше следуют публичной документации каждого проекта на момент написания, но не были протестированы напрямую с этим сервером. Проверьте подключение локально (перечислите доступные tools) перед использованием в production.
Альтернатива: HTTP-транспорт
Если клиент не поддерживает stdio, сервер также предоставляет StreamableHTTPServerTransport (см. src/httpServer.ts). Установите MCP_TRANSPORT=http и, опционально, MCP_HTTP_PORT (по умолчанию 3000) в переменных окружения процесса. Конечная точка находится по адресу http://localhost:<porta>/mcp (POST) — укажите клиенту этот URL вместо локальной команды.
📄 Спецификация OpenAPI (справочник для разработки)
Файл swagger-v2.3.json (полная OpenAPI-спецификация API v2.3, динамически генерируемая GLPI) не версионируется (git-ignored — 4.6MB, генерируется). Чтобы перегенерировать из работающего экземпляра GLPI:
curl -s "http://SEU_GLPI/api.php/doc.json" -o swagger-v2.3.json🌐 HTTP-режим (Express)
Сервер опционально поддерживает связь через HTTP, используя рекомендуемый stateless-эндпоинт (POST /mcp). Чтобы активировать этот режим, задайте переменные окружения:
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"}'Лицензия
Available Tools
30 toolsglpi_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
Scored across 30 tools
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.
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.
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.
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
Related MCP Connectors
MCP server for GLPI: tickets, ITIL, assets, knowledge base. GLPI 10/11. Not affiliated with Teclib'.
MCP server for Support & Service Management
MCP server for Getfly CRM — customers, opportunities, orders, tickets and tasks.
Gleap's official MCP server: tickets, contacts, CRM, help center and support stats. OAuth sign-in.
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server allowing an AI assistant to interact directly with your GLPI instance via its REST API, enabling ticket management, knowledge base operations, and statistics.404-
- FlicenseNot gradedqualityDmaintenanceMCP 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-
- AlicenseAqualityDmaintenanceMCP server to manage GestSup tickets via an LLM, with tools for creating, reading, commenting, and searching tickets.13MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for ticketing automation that exposes tools to create, search, and update IT helpdesk tickets, with metrics tracking.-