GLPI MCP Server v2
GLPI MCP Server v2
🌐 English version · 葡萄牙语(巴西)
基于 TypeScript/Node 的 MCP(Model Context Protocol)服务器,用于与 GLPI 集成。它使用 GLPI v2.3 API(通过 OAuth2)直接向 AI 代理提供 ITIL 覆盖和集成工具(tickets、problems、changes、knowledgebase、stats、assets、administration)。
本项目整合了多个工具,避免重复请求,并以适合 LLM 消费的优化格式提供数据。
🌟 鸣谢与致谢
本项目借鉴了以下项目的结构和工具覆盖范围:
GMS64260/mcp-glpi (MIT)
它们已适配新的 GLPI v2.3 API(OAuth2)。感谢原作者(GMS64260 和 DevSkillsIT)在架构设计和 ITIL 映射业务逻辑方面带来的启发。
Related MCP server: GLPI MCP
🚀 功能 (Tools)
提供专注于生产力的工具,包括:
Assistance:创建、更新、搜索(使用 RSQL 过滤器)以及完整读取(包括 1 个请求中的 timeline)Tickets、Problems 和 Changes。统计数据和添加 follow-ups。
Knowledgebase:搜索和读取文章。
Assets:列出和读取 Computers(带有包含详细规格的 flag)。
Administration:搜索用户、读取用户上下文和列出组。
🛠 安装
克隆仓库或下载文件。
安装依赖:
npm install编译项目:
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 客户端
访问 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(按工作区):
{
"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(交互式,用于设置环境变量)。
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)。
替代方案:HTTP 传输
如果客户端不支持 stdio,服务器还提供 StreamableHTTPServerTransport(参见 src/httpServer.ts)。在进程的环境变量中设置 MCP_TRANSPORT=http,并可选择设置 MCP_HTTP_PORT(默认 3000)。端点位于 http://localhost:<porta>/mcp(POST)— 将客户端指向该 URL,而不是本地命令。
📄 OpenAPI Spec (开发参考)
swagger-v2.3.json 文件(API v2.3 的完整 OpenAPI spec,由 GLPI 动态生成)不受版本控制(git 忽略 — 4.6MB,生成文件)。要从正在运行的 GLPI 实例重新生成:
curl -s "http://SEU_GLPI/api.php/doc.json" -o swagger-v2.3.json🌐 HTTP 模式 (Express)
服务器可选地支持通过 HTTP 通信,使用推荐的无状态端点(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"}'许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with GitLab API, supporting both self-hosted instances and gitlab.com. Provides tools for managing issues, merge requests, code review, pipelines, milestones, releases, search, and file access.514MIT
- 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.404The Unlicense
- FlicenseNot gradedqualityCmaintenanceMCP 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
- AlicenseAqualityBmaintenanceMCP server to manage GestSup tickets via an LLM, with tools for creating, reading, commenting, and searching tickets.13MIT
Related MCP Connectors
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Luizcc87/glpi-mcp-v2'
If you have feedback or need assistance with the MCP directory API, please join our Discord server