mcp-ollama mcp

v1.0.0 · MCP Tool · ai · registry.pascalai.org

Local Ollama inference server (default: http://localhost:11434). Operations: list (models), show (model info), generate (text completion), chat (conversation), embed (embeddings), pull (download model), push (upload model), copy (copy model), delete (remove model), running (list loaded models).

ollamallmlocalinferencechatgpt

Input Parameters

ParameterTypeDescription
operationrequired string Operation to perform. One of: list, show, generate, chat, embed, pull, push, copy, delete, running.
hostoptional string Ollama host URL (default: http://localhost:11434). Default: http://localhost:11434.
modeloptional string Model name (e.g. llama3.2, mistral, codellama). Required for generate, chat, embed, show, pull, push, copy, delete.
promptoptional string Text prompt for generate or embed.
messagesoptional string JSON array of chat messages: [{"role":"user","content":"..."}]. Required for chat.
system_optional string System prompt for generate/chat.
optionsoptional string JSON object with generation options (e.g. {"temperature":0.8,"top_p":0.9}).
from_optional string Source model name for copy operation.
to__optional string Destination model name for copy operation.
textsoptional string JSON array of strings for batch embed.
keepAliveoptional string How long to keep model loaded (e.g. 5m, 10m, -1 = forever).

Output Fields

FieldTypeDescription
models array[object]
response string
message object
embeddings array[any]
done boolean
error string

Examples

List available models

// Input
{
  "operation": "list"
}

// Output
{
  "models": [
    {
      "name": "llama3.2",
      "size": 2048000000
    }
  ]
}

Chat with a model

// Input
{
  "operation": "chat",
  "model": "llama3.2",
  "messages": "[{\"role\":\"user\",\"content\":\"Hello!\"}]"
}

// Output
{
  "message": {
    "role": "assistant",
    "content": "Hello! How can I help?"
  },
  "done": true
}

Install & Discovery

Install

ppm install mcp-ollama

Get JSON Schema

GET /v1/packages/mcp-ollama/1.0.0/schema

Discover by keyword

GET /v1/mcp/discover?q=ollama
Discovery hint: Install with ppm install mcp-ollama or invoke remotely via POST /v1/invoke/mcp-ollama on the MCP Service.

PascalAI Usage

uses toolslib;
var Tool := LoadTool('mcp-ollama');
var R := Tool.Call(JsonObj(['operation','generate','model','llama3.2','prompt','Hello world']));
Writeln(R.ToJSON);