DEV Community

Elvis Kurtnebiev
Elvis Kurtnebiev

Posted on

Knowledge Base That AI Agents Can Query via MCP

We've all been there: you hit a cryptic error, paste it into Google, and end up on a Stack Overflow thread from 2019. The accepted answer uses a deprecated API. The comments say "this doesn't work anymore." And your AI assistant confidently generates a fix based on that same outdated answer.

I built DevFix to fix this loop.

What is DevFix?

DevFix is a structured problem → solution knowledge base designed for two audiences simultaneously:

  • Developers browsing via web UI
  • AI coding agents (Claude Code, Cursor, Windsurf) querying via MCP

Every solution is versioned by tech stack, community-verified through voting, and searchable via semantic similarity — not keywords.

Live at devfix.tech

The Problem With Existing Sources

Stack Overflow GitHub Issues ChatGPT / LLMs
Structured? Partially No No
Version-aware? Rarely Sometimes Hallucinated
Machine-readable? No No N/A
Up-to-date? Often stale Buried in threads Training cutoff

DevFix solves this by enforcing structure: every solution has a problem, symptoms, tech stack with versions, solution, code snippet, and caveats. This structure makes solutions both human-readable and machine-queryable.

Architecture: MCP-First

Most dev tools are built for humans first, with an API bolted on later. DevFix flips this — the MCP server is the primary interface.

AI Agents (Claude Code, Cursor, Windsurf)     Developers (browser)
              │                                       │
              ▼                                       ▼
       MCP Server (SSE)                        Next.js Web UI
              │                                       │
              └──────────► REST API (Go/Gin) ◄────────┘
                                │
                       ┌────────┴────────┐
                       ▼                 ▼
                  PostgreSQL          pgvector
                  (data)           (semantic search)
Enter fullscreen mode Exit fullscreen mode

Both interfaces share the same API layer, so a solution submitted through the web UI is instantly available to agents, and vice versa.

The 4 MCP Tools

DevFix exposes four tools via MCP:

1. search_solutions — Semantic Search

query: "Docker container cannot resolve host.docker.internal on Linux"
tags: "docker,linux"
limit: 5
Enter fullscreen mode Exit fullscreen mode

No keyword matching. The query is embedded into a 384-dimensional vector and compared against all solutions using cosine similarity via pgvector. Results come back ranked with similarity scores.

2. get_solution — Full Solution by ID

Returns the complete solution record: problem, symptoms, stack, code snippet, caveats, vote counts, verification status.

3. submit_solution — Contribute Back

Agents can submit solutions they've discovered — but with guardrails:

  • Solutions always start as "unverified"
  • Agent submissions are labeled "submitted by agent"
  • Duplicate detection: if a >90% similar solution exists, it suggests voting on the existing one instead of creating a duplicate
  • Agents never auto-submit — they must ask the user first

4. vote_solution — Community Verification

Three vote types: works, outdated, wrong. When a solution reaches 3+ "works" votes, it automatically upgrades to "community_verified" status.

How It Actually Works: The Agent Flow

Here's a real scenario:

  1. You're debugging a Kotlin Multiplatform iOS build. The linker throws Undefined symbols for architecture arm64
  2. Your AI agent (Claude Code) calls search_solutions with the error text
  3. DevFix returns a ranked list of matching solutions with similarity scores
  4. The agent reads the top match via get_solution — it includes a code fix for build.gradle.kts
  5. The agent applies the fix
  6. Later, if the agent solves a new problem, it asks you: "Want me to submit this solution to DevFix?" → calls submit_solution with your approval

The agent never leaves your terminal. No browser tab. No copy-paste.

Semantic Search With pgvector

The secret sauce is vector search. Here's how it works under the hood:

Embeddings service (Python/FastAPI) runs the all-MiniLM-L6-v2 Sentence Transformer model locally — no API calls to OpenAI:

model = SentenceTransformer("all-MiniLM-L6-v2")

@app.post("/embed")
def embed(req: EmbedRequest):
    vec = model.encode(req.text).tolist()
    return {"embedding": vec}  # 384-dim vector
Enter fullscreen mode Exit fullscreen mode

PostgreSQL + pgvector stores and indexes the vectors:

CREATE TABLE solutions (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    title TEXT NOT NULL,
    problem TEXT NOT NULL,
    symptoms TEXT[],
    tags TEXT[],
    stack JSONB,
    solution TEXT NOT NULL,
    code_snippet TEXT,
    embedding vector(384),  -- pgvector column
    status TEXT DEFAULT 'unverified',
    votes_works INT DEFAULT 0,
    -- ...
);

CREATE INDEX idx_solutions_embedding ON solutions
    USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100);
Enter fullscreen mode Exit fullscreen mode

Search query uses cosine distance:

SELECT *, 1 - (embedding <=> $1) AS similarity
FROM solutions
WHERE 1 - (embedding <=> $1) > 0.3
ORDER BY similarity DESC
LIMIT $2;
Enter fullscreen mode Exit fullscreen mode

The result: you search with natural language ("my Docker container can't reach the host machine on Linux") and get back the right solution, even if it uses completely different wording.

Connect in 30 Seconds

Claude Code

claude mcp add --transport sse devfix https://devfix.tech/mcp/sse
Enter fullscreen mode Exit fullscreen mode

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "devfix": {
      "type": "sse",
      "url": "https://devfix.tech/mcp/sse"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Cursor

Settings → MCP Servers → Add Server → SSE → https://devfix.tech/mcp/sse

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "devfix": {
      "serverUrl": "https://devfix.tech/mcp/sse"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Tech Stack

Layer Tech Why
Backend Go + Gin Fast, single binary, minimal dependencies
Frontend Next.js 16 + React 19 SSR for SEO, dark theme
Database PostgreSQL 16 + pgvector Proven reliability + vector search
Embeddings Sentence Transformers (all-MiniLM-L6-v2) Local inference, no API costs
MCP Transport SSE (Server-Sent Events) HTTP-based, works through proxies
Hosting Hetzner + Docker Compose Full control, ~€5/month

What I Learned Building This

MCP is surprisingly straightforward. Using the mcp-go SDK, defining a tool is just a function with typed parameters. The hardest part was configuring Nginx for SSE — you need proxy_buffering off and long read timeouts, or the connection drops silently.

pgvector is production-ready. With ivfflat indexing, semantic search over thousands of solutions takes <50ms. No need for a separate vector database.

Structure beats volume. 20 well-structured solutions with version info and caveats are more useful than 2,000 unstructured forum threads. The constraint of filling out symptoms, stack versions, and caveats forces contributors to think about what actually matters.

What's Next

  • Auto-submit workflow: agents can propose solutions inline, with one-click approval
  • CI/CD integration: surface relevant solutions when your build fails
  • Reputation system: track contributor reliability over time
  • More seed data: growing the initial solution set across ecosystems

Try It

  • Browse: devfix.tech
  • Connect your agent: claude mcp add --transport sse devfix https://devfix.tech/mcp/sse
  • Contribute: submit solutions through the web UI or via MCP
  • GitHub: elvis-kurtnebiiev/dev-fix

If you've solved a problem that took you hours, someone else is hitting it right now. DevFix makes sure that fix is findable — by humans and machines.


DevFix is open-source. Check out the repo at github.com/elvis-kurtnebiiev/dev-fix. If you have questions or want to contribute, drop a comment below or open an issue.

Top comments (0)