Skip to content
What is MCP and how to turn LM Studio into a local AI assistant with superpowers
← ← Back to Thinking AI

What is MCP and how to turn LM Studio into a local AI assistant with superpowers


Introduction

If you already run language models locally—whether for privacy or for full control over your data—you may have noticed a fundamental limitation: your local model is smart but isolated. It can generate text and answer questions, but it cannot browse the web, access files, or remember anything from one conversation to the next.

That is where MCP — Model Context Protocol — comes in: an open standard created by Anthropic that changes the game. In this article we explain what MCP is, how to configure it in LM Studio with Qwen 3 running locally, and give a concrete setup example with two MCP servers: one for browser automation and one for persistent memory based on a knowledge graph.


What is MCP (Model Context Protocol)?

MCP is a standardised protocol that lets language models talk to external tools—databases, APIs, browsers, file systems—through a single interface. Think of MCP as a "universal USB" for AI: instead of building custom integrations for each tool, you use a single protocol that any compatible application understands.

The MCP architecture is based on two main components:

  • MCP Host — the application running the language model and managing connections. In our case, this is LM Studio.
  • MCP Server — an independent program that exposes a set of tools (tools) through the MCP protocol. An MCP server can be anything: a local script accessing files, a service controlling a browser, or a persistent memory system.

The flow works like this: user sends a request → model decides which tool is needed → LM Studio sends the request to the appropriate MCP server → server executes the action → result returns to model → model formulates the final response.

The major advantage? You can add as many MCP servers as you want, and the model has access to all of them simultaneously. A single local model can thus browse the web, read documents, control a browser, and remember previous conversations.


Why Qwen 3 and LM Studio?

LM Studio

LM Studio is a free desktop application that lets you run language models locally, without cloud or API costs. Starting from version 0.3.17, LM Studio works as an MCP Host, meaning you can connect MCP servers directly in the app.

LM Studio supports both local MCP servers (scripts running on your machine) and remote MCP servers (external services accessible via URL). Configuration is done by editing a single file: mcp.json.

Qwen 3

Qwen 3, developed by Alibaba, is one of the most capable open-source model families available today. Qwen 3 models have native support for tool calling (function calling), making them ideal for use with MCP.

What makes Qwen 3 special for our scenario:

  • Native function calling support — the model knows to generate structured function calls, not just text.
  • Thinking mode — Qwen 3 can "think" before deciding which tool to call, leading to better decisions.
  • Multiple size variants — from Qwen3-8B (runnable on 8GB VRAM) to Qwen3-32B for more powerful systems.
  • Excellent multilingual support — works well even in Romanian.

To check if a model supports tool calling in LM Studio, look for the 🔨 (tool) and 🧠 (reasoning) icons next to the model name in the available models list.


Step-by-step setup: LM Studio + Qwen 3 + MCP

Step 1: Install LM Studio

Download LM Studio from lmstudio.ai and install it. Make sure you have version 0.3.17 or newer (earlier versions do not support MCP).

Step 2: Download the Qwen 3 model

In LM Studio:

  1. Open the models tab and search for Qwen3.
  2. Choose the variant suitable for your hardware:
    • Qwen3-8B — recommended if you have at least 8GB VRAM
    • Qwen3-14B — for 12-16GB VRAM
    • Qwen3-32B — for 24GB+ VRAM
  3. Download the model in GGUF format (the quantized Q4_K_M variant offers a good balance between quality and memory consumption).
  4. Load the model and verify that the tool calling icon (🔨) appears next to its name.

Step 3: Configure MCP

Configuring MCP servers in LM Studio is done through the mcp.json file. Here's how to access it:

  1. In LM Studio, go to the right sidebar tab Program (terminal icon).
  2. Click InstallEdit mcp.json.
  3. The configuration file will open in the integrated editor.

The mcp.json file is located at:

  • macOS/Linux: ~/.lmstudio/mcp.json
  • Windows: %USERPROFILE%/.lmstudio/mcp.json

Practical example: Browser MCP + Graph Memory MCP

Now comes the interesting part. We will configure two MCP servers that together transform the local Qwen 3 model into a truly capable assistant:

  1. Playwright MCP — for browser automation (web navigation, data extraction, page interaction)
  2. Knowledge Graph Memory MCP — for persistent memory based on knowledge graph

Prerequisites

Make sure you have installed:

# Node.js (version 18 or newer)
node --version

# npx (comes with Node.js)
npx --version

Configuring the mcp.json file

Open mcp.json in LM Studio and add the following configuration:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    },
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"],
      "env": {
        "MEMORY_FILE_PATH": "/Users/yourname/ai-memory/memory.jsonl"
      }
    }
  }
}

Note for Windows: Replace the path in MEMORY_FILE_PATH with a valid Windows path, e.g., C:\\Users\\YourName\\ai-memory\\memory.jsonl. Create the directory manually before starting the servers.

Save the file. LM Studio will automatically load the defined MCP servers. For each server, LM Studio starts a separate process.

Installing Playwright Browser

On first use, you need to install the Chromium browser for Playwright:

npx playwright install chromium

Verification

After saving mcp.json, verify in LM Studio:

  1. Open a new chat with Qwen 3.
  2. At the bottom of the chat interface, you should see the active MCP servers.
  3. Test with a simple message: "Navigate to wikipedia.org and tell me what is on the main page."

When the model calls a tool, LM Studio displays a confirmation dialog where you can inspect, approve or refuse the action — an important security mechanism.


Browser MCP: Playwright

The Playwright MCP server, developed by Microsoft, gives your local model the ability to control a real browser. This is not just simple web scraping — the model can interact with web pages like a human user.

What it can do

Through Playwright MCP, the model has access to tools such as:

  • browser_navigate — navigate to any URL
  • browser_click — click on page elements
  • browser_fill — fill out forms
  • browser_screenshot — capture screenshots
  • browser_get_text — extract text from pages
  • browser_evaluate — execute JavaScript in the page context

How it works technically

Playwright MCP uses the browser's accessibility tree, not screenshots. This means the model "sees" the web page as a semantic structure: buttons with labels, input fields with names, links with text. This approach is more efficient than visual analysis and works even with models that do not have vision capabilities.

Usage example

You can ask the model:

"Open example.com, fill out the contact form with name John Doe and email john@example.com, then submit the form. Take a screenshot of the confirmation page."

The model will automatically orchestrate the sequence of calls: navigation → fill fields → click submit button → capture screenshot.


Memory MCP: Knowledge Graph Memory

This is probably the most transformative MCP in our setup. The Knowledge Graph Memory server provides your model with persistent, structured memory as a knowledge graph. Information is retained between chat sessions, meaning your local model can "learn" and "remember" things from one conversation to another.

What is a Knowledge Graph?

A knowledge graph is a data structure that organizes information as entities connected by relations. Unlike a classic tabular database or simple text file, a knowledge graph captures context and connections between information.

The knowledge graph used by this MCP server has three fundamental elements:

1. Entities These are the main nodes of the graph. Each entity has a unique name and type. For example:

  • John_Doe — type: person
  • TEN_INVENT — type: company
  • Dashboard_Project — type: project

2. Observations These are atomic pieces of information attached to an entity. Each observation is an individual, clear and specific fact. For example, for the entity John_Doe:

  • "Prefers morning meetings"
  • "Speaks fluent English and Romanian"
  • "Works with Laravel and React"

3. Relations These are directed connections between entities, expressed in active voice. For example:

  • John_Doeworks atTEN_INVENT
  • TEN_INVENTdevelopsDashboard_Project
  • John_DoeleadsDashboard_Project

Why is this model powerful?

The power of the knowledge graph comes from its ability to connect seemingly disparate information. When the model receives a question about a project, it can traverse the graph to find who works on that project, what technologies are used, what deadlines exist and what dependencies there are.

Data is stored locally in a JSONL (JSON Lines) file, meaning:

  • Persistence — information survives between sessions
  • Transparency — you can inspect and edit the file manually
  • Portability — you can move or duplicate the memory file
  • Confidentiality — data never leaves your machine

Available tools

The memory server exposes the following tools:

  • create_entities — create new entities in the graph
  • create_relations — define relations between existing entities
  • add_observations — add new information to an entity
  • search_nodes — search the graph by keywords
  • open_nodes — open specific entities by name
  • read_graph — read the entire knowledge graph
  • delete_entities / delete_relations / delete_observations — delete operations

Concrete example of operation

In the first conversation, you tell the model:

"My name is John, I work at TEN INVENT as a developer. Our main project is called BOB and we use Laravel with React."

The model, configured to use memory, will automatically create:

Entity: John (type: person)
  - Observation: "Is a developer"
  
Entity: TEN_INVENT (type: company)
  - Observation: "Software development company"
  
Entity: BOB (type: project)
  - Observation: "Uses Laravel with React"

Relation: John → works at → TEN_INVENT
Relation: TEN_INVENT → develops → BOB
Relation: John → works on → BOB

In a later conversation, you can ask:

"What projects am I working on?"

The model will search the memory graph, find the "John" entity, traverse the relations and answer with the stored information — without ever having mentioned these details in the current conversation.


Practical tips and optimizations

Choosing the right model

Not all local models work equally well with MCP. For efficient tool calling, recommendations are:

  • Qwen3-8B or larger — minimum recommended threshold
  • "Thinking" variants — handle complex tool sequences better
  • Avoid models under 7B parameters — do not have enough capacity for reliable tool calling

Context management

Tool results consume context. Each response from an MCP server reduces the available space for conversation. A few strategies:

  • Start a new chat when you radically change topics
  • Be specific in requests to minimize returned data
  • Use generous context windows (Qwen 3 supports 32K+ tokens)

Security

MCP servers can execute code and access your system resources. Some basic rules:

  • Only install MCP servers from trusted sources
  • Always review tool calls in LM Studio's confirmation dialog
  • Do not expose MCP servers on the network without authentication

Conclusion

The combination LM Studio + Qwen 3 + MCP demonstrates that local AI no longer means isolated AI. With a few lines of JSON configuration, your local model gains the ability to browse the web, interact with pages and remember previous conversations — all without sending a single byte of data to the cloud.

MCP is a rapidly growing ecosystem. Besides Playwright and Knowledge Graph Memory, there are already hundreds of MCP servers for various integrations: databases, GitHub, Slack, Google Drive, Notion and many others. You can even build your own MCP servers with Python (using FastMCP) or Node.js.

If you're curious to explore further, the community list awesome-mcp-servers on GitHub is an excellent starting point.


This article is part of the technical publication series on the TEN INVENT blog. If you have questions or want to discuss implementing MCP in your projects, contact us.