{"slug": "using-ui-mcp-proxy-in-llama-cpp", "title": "Using ui-mcp-proxy in Llama-cpp", "summary": "A developer created a simple MCP server for local LLMs to call Rust-coded tools, but encountered CORS errors. The llama-cpp feature ui-mcp-proxy, passed as an argument to llama-server, sets up a proxy that eliminates CORS errors by placing the MCP server on the same server as llama-cpp, simplifying code by removing CORS middleware.", "body_md": "Yesterday I developed a simple **MCP server**, which allows local LLMs to call tools that I have written in Rust code. This worked well, but I ran into **CORS errors**—CORS is a security feature on web browsers. I found that `llama-cpp`\n\nhas a special feature to avoid these issues.\n\nWith `ui-mcp-proxy`\n\n, passed as an **argument** to `llama-server`\n\n, a proxy server is set up so that the MCP server is on the same server as `llama-cpp`\n\n. This **eliminates** the CORS errors altogether.\n\nI was able to remove the middleware logic that set up CORS headers—it wasn't a huge win, but anything that **simplifies code** is a **benefit**. After all, code is a burden and having the minimal amount of necessary code will make life easier.\n\nAccording to the Model Context Protocol specification, **JSON-encoded messages** must be used, so there will always be some complexity due to decoding and encoding messages. That is essential complexity here.", "url": "https://wpnews.pro/news/using-ui-mcp-proxy-in-llama-cpp", "canonical_source": "https://www.dotnetperls.com/2026_7_26_using-ui-mcp-proxy-llama-cpp", "published_at": "2026-07-26 07:00:00+00:00", "updated_at": "2026-07-26 14:23:34.190827+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models"], "entities": ["llama-cpp", "MCP server", "Rust", "llama-server", "ui-mcp-proxy"], "alternates": {"html": "https://wpnews.pro/news/using-ui-mcp-proxy-in-llama-cpp", "markdown": "https://wpnews.pro/news/using-ui-mcp-proxy-in-llama-cpp.md", "text": "https://wpnews.pro/news/using-ui-mcp-proxy-in-llama-cpp.txt", "jsonld": "https://wpnews.pro/news/using-ui-mcp-proxy-in-llama-cpp.jsonld"}}