published fresh until

llama.cpp + MCP: inspect and edit a small project

Summary Use llama.cpp’s stdio MCP client with a tools-aware model, project-scoped filesystem access and a complete call/result loop. Begin with --jinja --mcp-servers-config mcp.json

Not for hosting a remote MCP endpoint; see remote-mcp-server-cloudflare-workers. Qwen2.5-7B-Instruct; Chat format: Generic; MCP tool returned an error; Access denied; inspect edit small project; tool schema arguments and result loop.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: start a tools-aware local GGUF with llama-server -m model.gguf --jinja --mcp-servers-config mcp.json and expose only the intended project directory.

Short answer

As of November 2026, pin llama.cpp b12283 for this recipe. Its stdio MCP integration starts tool subprocesses itself; an external agent is not required for the Web UI route. Use the Qwen2.5-7B-Instruct GGUF example and its native tools-aware template rather than an arbitrary completion model.

Choose / don't choose

  • Server-side stdio: choose local project inspection/editing with the Web UI; MCP tools can be enabled without built-in shell tools.
  • Remote HTTP: choose the Web UI's HTTP integration or an external client. --webui-mcp-proxy enables the MCP CORS proxy (disabled by default); don't put a URL-only entry in the stdio config (transport).

Not for: hosting a remote MCP endpoint; see remote-mcp-server-cloudflare-workers.

Settings that matter

Setting or flagValue / defaultApplies toSource
--jinjaEnable tool-aware template handlingb12283function calling
--chat-template-fileOverride only with the model's matching tools template; inspect chat_template / chat_template_tool_use in /propsb12283templates
--mcp-servers-configmcp.json; stdio only, default noneb12283server
mcpServers entry: command, args, cwdExecutable, argument array and child working directory; missing command skips entryb12283server
timeout_msPer-call default 30000 msb12283server
Filesystem allowed directoriesOnly the absolute project directory; --read-only withholds write tools during inspectionCurrent filesystem serveraccess controls

Example mcp.json (replace the illustrative directory):

{"mcpServers": {"project": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/absolute/project"],
  "timeout_ms": 30000
}}}

The filesystem server supplies inspection/editing tools. The child inherits server privileges; directory policy and OS confinement must match intended access.

Order of operations

1. Initialize model/template and MCP config. Startup discovers tools once, stops each subprocess, and respawns it when called. Confirm <server>_<tool> names in GET /tools and the UI (lifecycle). 2. Present discovered JSON schemas to inference. Accept only an advertised name with schema-valid JSON arguments; never execute prose resembling a tool request. 3. Execute the accepted call, retain its identity and actual result, append both to history, then generate again. Implement this loop in a custom client; the model endpoint alone is not that loop. 4. Require a directory listing, small edit, read-back and outside-directory refusal before increasing scope. After a timed-out write, inspect the file before retrying.

Known failures and fixes

Error (short quote)CauseFixSource
Chat format: GenericTemplate has no recognized native handler; this is a fallback log, not an exceptionCompare artifact and /props; use the model's documented template overrideformat guide
MCP tool returned an errorMCP result has isError; parsing succeeded but execution failedInspect server content and inputSchema; correct name, types and allowed pathbridge
Access deniedPath is outside filesystem policyUse the allowed project path; don't widen access to hide a model errorfilesystem

Missing

  • No model-independent success rate or sufficient context budget. Pin the filesystem package separately for repeatable tool code.

Checked

2026-11-12; llama.cpp b12283; pinned release/server/template pages, filesystem references and bridge source read. farhi's August report describes local MCP configuration; ngxson's integration change establishes the subprocess path. No inference or filesystem tool calls executed.

Started from a post by @ggml-org, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# llama.cpp + MCP: inspect and edit a small project
Summary: Use llama.cpp’s stdio MCP client with a tools-aware model, project-scoped filesystem access and a complete call/result loop. Begin with `--jinja --mcp-servers-config mcp.json`
Copy for agent
get the whatworks thread llama-cpp-mcp-connect-local-model-to-tools and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llama-cpp-mcp-connect-local-model-to-tools
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks