AgentsCommercialFreeActiveMachine-verified· beginner · ~10 min setup

Wire the DeepWiki MCP into your agent so it looks up repos instead of hallucinating

Give your coding agent the DeepWiki MCP server so it can pull real context about an unfamiliar dependency mid-task, and validate the client config declares the three documented tools before you trust it.

by Shilpa Mitra· verified today· v1.0.0

Run this workflow

CI-verified, 2/2 fixtures passing.

Build this with your agent

One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.

Intended Use

Anyone giving a coding agent repo-lookup context. CI validates the MCP client config: it parses, the DeepWiki server is declared with a URL, all three documented tools are present, and a round-trip fixture (an ask_question call with an expected answer shape) is defined. No network, no live index call. Whether the hosted index is fresh or correct is fenced.

Not for

  • Trusting it as a source of truth, the index can lag the repo and RAG returns confident stale matches; verify security-sensitive details in the actual source
  • Private repos without a Devin account, the free tier is open-source repos only
  • Forgetting an MCP server is a network tool you granted the agent, treat a third-party MCP like running code, and scope its reach

The Stack

Tested Against

DeepWiki MCP (mcp.deepwiki.com) docs, 2026-07node@20

Side effects & data flow

Network
none, local only
Writes
./deepwiki-mcp.json
Credentials
none required

Prerequisites

  • An MCP-capable agent (Claude Code, Cursor, etc.) to actually call the server

Steps

  1. 1

    Write the MCP client config and validate the tools + round-trip

    Declare the DeepWiki MCP server and the three tools your agent will call, plus a round-trip fixture describing what an ask_question call should return. CI checks the config parses, all three tools are present, and the fixture is defined. The live index call is fenced.

    cat > deepwiki-mcp.json <<'JSON'
    {
      "mcpServers": {
        "deepwiki": {
          "url": "https://mcp.deepwiki.com/mcp",
          "tools": ["read_wiki_structure", "read_wiki_contents", "ask_question"]
        }
      },
      "roundtrip_fixture": {
        "tool": "ask_question",
        "input": { "repo": "vercel/next.js", "question": "where is request auth validated" },
        "expected_shape": { "answer": "string", "citations": "array" }
      }
    }
    JSON
    node -e '
    const fs = require("fs");
    const c = JSON.parse(fs.readFileSync("deepwiki-mcp.json", "utf8"));
    function bad(m) { console.error("BAD: " + m); process.exit(1); }
    const srv = (c.mcpServers && c.mcpServers.deepwiki) || null;
    if (!srv || !srv.url) bad("no deepwiki MCP server with a url");
    const required = ["read_wiki_structure", "read_wiki_contents", "ask_question"];
    const tools = srv.tools || [];
    const missing = required.filter(function (t) { return tools.indexOf(t) === -1; });
    if (missing.length) bad("MCP config is missing documented tool(s): " + missing.join(", "));
    const f = c.roundtrip_fixture || {};
    if (!f.tool || !f.input || !f.expected_shape) bad("round-trip fixture needs a tool, input, and expected_shape");
    console.log("config OK: DeepWiki MCP wired (" + required.length + "/3 tools present); round-trip fixture for " + f.tool + " defined (live index fenced)");
    '
  2. 2

    Let the agent query it mid-task (the live index step, not checked by CI)

    Point your agent at the DeepWiki MCP and let it call ask_question when it hits an unfamiliar dependency. Cross-check anything security-sensitive against the real source, because the index can be stale. The live call and its freshness are fenced.

Eval, 2 fixtures

Last passed: verified today
  • mcp-okcontainstimeout 30s · max $0

    Expected: config OK: DeepWiki MCP wired (3/3 tools present); round-trip fixture for ask_question defined (live index fenced)

  • clean-exitexit_codetimeout 30s · max $0

    Expected: 0

Results

DeepWiki (Cognition, makers of Devin) auto-generates a wiki for any public repo and exposes a remote MCP server so your agent can query it: read_wiki_structure, read_wiki_contents, and ask_question. Wired in, an agent looks up an unfamiliar API instead of inventing one. But an MCP that answers from an index is only as current as that index, and it will confidently return the closest match after the repo has moved on, so scope it to reading and orientation, never the sole source for a security-sensitive detail.

Did this work for you?

Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.

Related workflows

Liked this workflow?

Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).