Skip to content

Model Context Protocol

Endi S. Dewata edited this page May 19, 2025 · 20 revisions

Overview

Warning
This feature is still under development. Do not use in production.

PKI server provides an MCP server that can be used by an MCP client to access PKI services using LLM. Currently the MCP server is still a prototype so it’s only available as a source and not included in the distribution.

Prerequisites

Installing MCP Server

The MCP server can be used directly from its source directory at base/server/mcp. If necessary, the source directory can be copied into a different directory (e.g. /usr/share/pki/server/mcp).

Installing LLM

To install Ollama with LLama 3.2:

$ curl -fsSL https://ollama.com/install.sh | docker exec -i pki sh
$ ollama run llama3.2

Installing MCP CLI

The MCP CLI can be used directly from the source:

$ git clone https://github.com/chrishayuk/mcp-cli.git

Configuring MCP CLI

To configure MCP CLI, edit the server_config.json in its source directory:

{
  "mcpServers": {
    "pki-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/usr/share/pki/server/mcp",
        "run",
        "main.py"
      ]
    }
  }
}

Finding CA Users

$ uv run mcp-cli cmd \
    --provider=ollama \
    --model=llama3.2 \
    --server pki-server \
    --prompt "show me all users in CA subsystem"
...
Processing request of type CallToolRequest
Here is the answer to the user's question:

The users in the CA subsystem are:

* CA-pki.example.com-8443 (agentType)
* caadmin (adminType)

These users are currently active.

Current Limitations

  • Some of the prerequisites are not available in Fedora.

  • There’s no guarantee that the prompt will match the correct method in MCP server.

  • The MCP server uses pki-server CLI so it only works with local CA.

  • The MCP server uses STDIO transport so it only works with local MCP CLI.

  • The MCP CLI only supports local Ollama.

See Also

Clone this wiki locally