Introduction

I wanted to rethink my development setup around Serena MCP and treat it as the center of a local AI coding environment. The goal was not just to run a local LLM, but to connect notes written in Obsidian to code completion, agent execution, and day-to-day work in VS Code.

What mattered here was practicality. I wanted a setup that stayed local, reflected repository-specific context, improved completion quality, and reduced hallucinations. I also wanted the planning surface and the coding surface to stay connected instead of scattering intent across different tools.

Background and Goal

The source note states the intent directly:

  • serena MCPでlocal LLM、github copilotの精度を向上させる
  • obsidianをベースにserenaでinstructionsを生成、ローカルLLMもしくはGithub copilotをベースにしてオートコンプリート、エージェントを活用できるようにローカルマシンに構築する。VSCODEでも利用する

That makes the direction clear. This is not just about model hosting. It is about turning Obsidian notes into actionable instructions, feeding those instructions into a context-aware assistant, and using either a local LLM or GitHub Copilot inside the editor with more project-specific grounding.

Serena MCP: Enhancing Local LLM and GitHub Copilot Accuracy

The central idea is to use Serena MCP as a context engine for both local LLMs and GitHub Copilot. Instead of relying on generic completions, the system draws from repository code, comments, and documentation so suggestions better match the actual project.

The source explicitly names Qwen-Coder-v3, Gemma-3, and an Ollama-hosted model as examples. I read that less as a commitment to one model and more as a flexible local-model layer that Serena MCP can enrich with repository-specific context.

Key Features

FeatureWhat It DoesPractical Example
Local LLM Fine-TuningTrains a model on your repository’s code, comments, and documentation.A Python project with 10k lines of code gets a model that understands project-specific naming conventions.
GitHub Copilot Accuracy BoostUses the fine-tuned model as a secondary suggestion engine, filtering Copilot’s output.Copilot suggests a generic def foo(): but Serena MCP replaces it with def calculate_total_price(items): after matching repository patterns.
Obsidian-Based Instruction GenerationGenerates Markdown instructions that guide the LLM or Copilot.An Obsidian note titled “Add unit tests” automatically creates a prompt: “Write pytest tests for calculate_total_price.”
Auto-Complete & Agent IntegrationProvides context-aware auto-completion and a lightweight agent that can execute code snippets.While typing in VS Code, Serena MCP completes df. to df.groupby() based on pandas usage in the repo.
VS Code ExtensionInstalls a side-panel that displays Serena-generated instructions and suggestions.A developer sees a “Suggested refactor” button that, when clicked, runs the agent to rename variables.

What stands out is that instruction authoring and execution support live in the same loop. Notes become prompts, prompts shape completion, and the agent can validate or run follow-up actions.

How It Works

The system is described as a five-step flow.

  1. Repository Analysis: Serena MCP scans the repository, extracting code, comments, and existing documentation. It builds a knowledge graph that captures function signatures, class hierarchies, and common patterns.

  2. Fine-Tuning: Using the extracted data, Serena MCP fine-tunes a chosen local LLM. For example, Qwen-Coder-v3 receives a 4-epoch training run on a 16-GB GPU, achieving a perplexity drop from 35 to 22 on the project’s test set.

  3. Instruction Generation: In Obsidian, a user writes a high-level goal: “Implement pagination for the API.” Serena MCP translates this into a detailed prompt:

      ## Task: Add pagination to the API endpoint `/items`
    - Use FastAPI
    - Return 20 items per page
    - Include `next_page` and `prev_page` links
      
  4. Auto-Complete & Agent: When the developer types return inside the endpoint function, Serena MCP’s auto-complete suggests return paginate_items(items, page, per_page=20). The agent can execute a test harness:

      $ serena agent run tests/test_pagination.py
    PASS
      
  5. VS Code Integration: The Serena extension shows a sidebar with current instruction set, suggested code snippets, agent execution status, and quick-access to the local LLM’s inference API.

This flow is appealing because the note in Obsidian is not dead documentation. It becomes an operational input to the coding environment.

Benefits

BenefitWhy It Matters
Higher AccuracyFine-tuned models reduce irrelevant suggestions by 30-40% compared to vanilla Copilot.
PrivacyAll inference happens locally; no code leaves the machine.
SpeedLocal inference delivers sub-second responses, even on modest hardware.
CustomizabilityUsers can swap LLMs (Qwen-Coder-v3, Gemma-3, Ollama) without changing the workflow.
Unified InterfaceObsidian for planning, VS Code for coding, Serena for execution – all in one ecosystem.

For me, the most important ones are privacy and interface unification. Keeping code local matters, but so does keeping intent local.

Getting Started

  # 1. Install Serena MCP
pip install serena-mcp

# 2. Initialize your project
serena init

# 3. Choose an LLM
serena llm install qwen-coder-v3

# 4. Fine-tune
serena llm fine-tune

# 5. Install VS Code extension
code --install-extension serena.mcp

# 6. Open Obsidian, create an instruction note, and sync
  

The related note makes it clear that this idea can grow into a broader local-first platform.

  • Reproducibility and Evidence: MLflow, SBOM, signing, and Feast for preserving how outputs were produced
  • Data and Retrieval Foundation: Trino, Iceberg, lakeFS/Nessie/Polaris, Qdrant, and pgvector for broader cross-document search
  • Observability and Runtime: Prometheus/Grafana/Loki with OpenTelemetry, and Podman Quadlets as the practical runtime path with k3s as a future expansion
  • Development Productivity: Devcontainer, pre-commit, Devbox/Nix flakes, and Playwright/k6 for reproducible environments

What Is Still Missing

The direction is strong, but there are still gaps.

First, the source is conceptual. It does not include concrete Serena MCP configuration, editor settings, or synchronization details between Obsidian and VS Code.

Second, the minimal path and the expanded platform path are still mixed together. I would separate them into:

  • A minimal setup: Serena MCP + local LLM + Obsidian + VS Code
  • An extended setup: Podman, MLflow, Qdrant, Trino, Iceberg, and observability

Results

What this note made clear is that Serena MCP can serve as the bridge between planning in Obsidian and execution in a local AI coding workflow. The combination of repository analysis, fine-tuning, instruction generation, autocomplete, agent execution, and VS Code integration creates a much more coherent system than a generic prompt workflow.

Future Work

The next step should be pinning down the minimal implementation path: Serena MCP configuration, a rule for generating instructions from Obsidian notes, and a clear way to load those instructions inside VS Code.

After that, I would expand only the parts that prove necessary in practice, starting with Podman, MLflow, Qdrant, and observability. That keeps the first version small while leaving a clean path toward the broader platform.