Skip to main content
Glama

local-llm-mcp (draft)

Small MCP side-channel so an orchestrator (e.g. Grok Bot) can ask a local LLM (Ollama) without replacing its own cloud model.

Typical layout:

[Grok Bot / Cursor]  --MCP-->  [this server]
                                    |
                              Tailscale / LAN
                                    |
                              [your PC: Ollama :11434]

What this is / is not

  • Is: ask_local / list_local_models / redact_text for drafts, summaries, and output-only DLP on text returned over MCP.

  • Is not: a full replacement for Grok Bot’s brain, nor a guarantee that every secret format is caught by heuristics.

Related MCP server: query-sanitizer-mcp

Privacy policy (output-only DLP)

Prompts to the local model may include secrets / PII. That is intentional: the prompt stays on your machine (Ollama) and is not the leak path this server hardens.

Answers returned via MCP to Grok Bot / cloud must be filtered. Redaction applies to the model’s response before it leaves this server — not to the inbound local prompt.

Mechanism

Behavior

No-echo system hint

Prefixed into ask_local unless allow_echo=true — steers the model not to repeat secrets in its answer

redactOutput()

Regex masks IBAN, card-like digit runs, rodné číslo, email, phone, API-key-ish tokens, Bearer, AKIA… on returned text

redact_text tool

Same redaction without calling the model

REDACT_OUTPUT=true

Default: redact ask_local answers before MCP return

Limits: heuristics miss novel formats. Treat redaction as defense-in-depth on the outbound MCP answer, not as a reason to scrub the local prompt. Hard secrets that must never leave the box still belong in env / secret forms on the MCP host when practical — but putting sensitive context in the local prompt is allowed.

Requirements

  • Node.js 20+

  • Ollama on your machine with at least one model pulled

  • Optional: Tailscale so the host running this MCP can reach Ollama at a stable Tailscale IP

Configure

cp .env.example .env
# set OLLAMA_BASE_URL=http://100.x.y.z:11434   # Tailscale IP of the PC with Ollama
# set OLLAMA_MODEL=llama3.2
# set REDACT_OUTPUT=true
npm install
npm start

Tools

Tool

Purpose

list_local_models

List models known to Ollama

ask_local

Prompt local model (secrets/PII in the prompt OK); redacts the answer before MCP return by default

redact_text

Redact text only (no LLM call) — for outbound/MCP-bound text

Wire into Grok Bot / Cursor

  1. Run this MCP somewhere reachable (same Tailscale network as Ollama, or on the PC itself).

  2. Add it as a custom MCP (stdio or HTTP URL, depending on how you run it).

  3. Keep OLLAMA_BASE_URL / model name in env on the MCP host. Sensitive context may go in the local ask_local prompt; rely on output redaction for what comes back to the cloud orchestrator.

Stdio (local process)

{
  "mcpServers": {
    "local-llm": {
      "command": "node",
      "args": ["/path/to/local-llm-mcp/src/index.js"],
      "env": {
        "OLLAMA_BASE_URL": "http://127.0.0.1:11434",
        "OLLAMA_MODEL": "llama3.2",
        "REDACT_OUTPUT": "true"
      }
    }
  }
}

Security notes

  • Local prompts may contain secrets/PII; they stay on the Ollama host. The critical boundary is the MCP return path to Grok Bot / cloud.

  • Prefer Tailscale ACLs so only your Grok Bot host / laptop can reach :11434.

  • Do not expose Ollama to the public internet.

  • Output redaction is defense-in-depth, not a vault — leave REDACT_OUTPUT=true unless you intentionally need raw answers.

Status

Draft scaffold for experimentation. APIs and packaging may change.

License

MIT

Available Tools

3 tools
ask_localA

Ask the local Ollama model. Secrets/PII in the prompt are allowed (stay on Ollama). By default appends a no-echo system hint and redacts the answer before returning it over MCP (output-only DLP).

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoOverride default OLLAMA_MODEL
promptYesUser prompt / question (may include secrets/PII; processed only on local Ollama)
redactNoRedact answer before MCP return (default: env REDACT_OUTPUT, usually true). Does not scrub the inbound prompt.
systemNoOptional system instruction (merged with no-echo policy)
allow_echoNoIf true, skip the built-in no-echo system add-on (weakens output DLP; not recommended)

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden but does so well: it discloses the no-echo system hint, that the *answer* (not the prompt) is redacted before returning over MCP (output-only DLP), and by implication that the inbound prompt is not scrubbed. It omits error behavior, timeouts, or model context limits, preventing a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with the core action and the key security trait front-loaded, and no redundant restatement of the name. Dense and mostly waste-free, though the parenthetical and asterisk emphasis are slightly informal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with no annotations and no output schema, this covers the operationally critical facts: locality, default no-echo behavior, and output-only redaction. It stops short of describing the return shape or failure modes, but the essential invocation context is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all five parameters including the redact/allow_echo defaults are already documented in the schema. The description reinforces the DLP/default behavior but adds no syntax or format detail beyond what the schema provides, so baseline 3 is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Ask the local Ollama model"), clearly positioning it as the query/inference tool distinct from sibling list_local_models (enumeration) and redact_text (scrubbing). It never names those siblings to differentiate explicitly, so it lands at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It implies usage context by noting secrets/PII are allowed because processing stays local, which is a meaningful hint about when this tool is appropriate. However, it gives no explicit when-not guidance and does not route the agent to redact_text for standalone redaction, so usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_local_modelsA

List models available on the configured Ollama instance.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. The verb 'List' implies a read-only operation with no side effects, which is useful, but the description does not explicitly state read-only behavior, authentication requirements, or return format details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single clear sentence that is front-loaded with the core action and resource. It contains no wasted words and is appropriately sized for a simple listing tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity, zero parameters, and lack of annotations or output schema, the description is nearly complete. It could specify the return format or read-only nature more explicitly, but the essential information is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline score is 4 per the rubric. The description adds no parameter information, but none is needed since the input schema is empty.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (List) and resource (models available on the configured Ollama instance). It is unambiguous and clearly distinct from sibling tools like redact_text and ask_local, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention the sibling tools or any conditions that would select this tool over another.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

redact_textA

Redact likely sensitive patterns from outbound/MCP-bound text (IBAN, cards, emails, tokens, etc.). Heuristic output DLP only — not for scrubbing local prompts.

ParametersJSON Schema
NameRequiredDescriptionDefault
skipNoRule ids to skip, e.g. email, phone_eu, card
textYesText to redact

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses an important behavioral trait: the redaction is 'heuristic output DLP only', which sets expectations about reliability and false positives/negatives. However, it does not state whether redaction is reversible, what the output looks like (replacement tokens vs removal), or whether the operation is side-effect free.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short, dense sentences with no waste. The primary purpose and critical limitation are both front-loaded and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description should ideally cover what the redacted output looks like and any limits of the heuristic. It covers the use case well but leaves return-format and reliability details unstated. Adequate but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both parameters are already documented in the schema, including examples for skip rule ids. The description adds no parameter-level detail beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (redact) and resource (sensitive patterns) with an explicit scope: 'outbound/MCP-bound text'. The parenthetical examples clarify what counts as sensitive. It doesn't explicitly differentiate from siblings, but siblings (list_local_models, ask_local) are unrelated, so no differentiation is needed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear context of when to use it (outbound/MCP-bound text) and explicitly says when not to use it ('not for scrubbing local prompts'). No named alternatives, but the use-case boundary is well defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.2.0
    • First observedask_local
    • First observedlist_local_models
    • First observedredact_text

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation4/5

The three tools target distinct actions: listing models, redacting text, and asking the model. However, redact_text overlaps with ask_local's built-in output redaction, which could leave an agent unsure when to invoke redact_text directly versus relying on ask_local's automatic DLP.

Naming Consistency4/5

All three names are verb-first and snake_case, which is predictable. list_local_models follows verb_adjective_noun while ask_local is verb_adjective and redact_text is verb_noun, a minor structural deviation but still readable and consistent in style.

Tool Count4/5

Three tools is on the lean side but appropriate for a narrow local-LLM proxy whose purpose is model discovery, inference, and output DLP. Each tool earns its place, though the surface is minimal.

Completeness3/5

The core workflow (list models, ask, redact) is covered, but there are notable gaps: no model lifecycle operations (pull/delete), no conversation/session management, and no history handling. These are plausible for the scope but leave the surface thin for sustained use.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Exposes local Ollama instances as tools for Claude Code, allowing users to offload code generation, text drafting, and embedding tasks to local GPUs. It supports multi-turn conversations and model management through the Model Context Protocol.
    MIT
  • F
    license
    Not graded
    quality
    F
    maintenance
    A local DLP middleware that redacts sensitive information from prompts using local models before they reach external LLMs. It provides tools to sanitize queries, restore placeholders in responses, and manage a ledger of redactions to maintain data privacy.
    1
    -