Metadata-Version: 2.4
Name: glpic
Version: 99.0.202509251424
Summary: GLPI client
Author-email: Karim Boumedhel <karimboumedhel@gmail.com>
License: ASL
Project-URL: Homepage, http://github.com/karmab/glpic
Description-Content-Type: text/markdown
Requires-Dist: fastmcp
Requires-Dist: prettytable

This repo contains code for a lightweight client to interact with GLPI and a MCP to consume it from any LLM

# Requirements

- Available glpi instance
- valid user and API token
- prettytable python library

# Installation

```
pip3 install glpic
```

# Using client

Store your creds in any env file such as [glpic.env.sample](glpic.env.sample) and set data accordingly
You can then use the following commands

- List users

```
glpic list users
```

- List computers

```
glpic list computers
```

- Get information on a specific computer

```
glpic info computer $computer
```

- List reservations

```
glpic list reservations
```

- Get information on a specific reservation

```
glpic info reservation $reservation
```

- Update a given reservation

```
glpic update reservation $reservation -P end=20240601
```

- Update all reservations

```
glpic update reservations
```

# Using MCP

The server is started and configured differently depending on what transport you want to use

For STDIO, you can include the following configuration snippet In VSCode or Claude Desktop:

```json
"mcpServers": {
    "glpi": {
        "command": "python3",
        "args": ["/path/to/glpic/src/glpic/mcp_server.py", "--stdio"],
        "env": {
            "GLPI_URL": "https://server/apirest.php",
            "GLPI_USER": "myuser",
            "GLPI_TOKEN": "mytoken"
            }
        }
    }
```

For Streamable HTTP, first start the server in a terminal:

```
glpimcp
```

You can then point to the server from your client with a modified snippet

```json
"mcpServers": {
         "glpi": {
             "command": "/usr/local/bin/npx",
             "args": ["mcp-remote", "http://your_server:8000/mcp", "--allow-http",
             "--header", "GLPI_URL: https://server/apirest.php",
             "--header", "GLPI_USER: myuser",
             "--header", "GLPI_TOKEN: mytoken"]
        }
    }
```

For Claude Code, you can add the mcp directly from command line:

```
claude mcp add --transport http glpi http://your_server:8000/mcp -H "GLPI_URL: https://server/apirest.php" -H "GLPI_USER: myuser" -H "GLPI_TOKEN: mytoken"
```
