Skip to content

Instantly share code, notes, and snippets.

@chunhualiao
Last active November 14, 2025 21:25
Show Gist options
  • Select an option

  • Save chunhualiao/cc8c5b9933e06fa4125fc5bf1dab5d2a to your computer and use it in GitHub Desktop.

Select an option

Save chunhualiao/cc8c5b9933e06fa4125fc5bf1dab5d2a to your computer and use it in GitHub Desktop.
test Deepwiki MCP server

The official doc at https://docs.devin.ai/work-with-devin/deepwiki-mcp is incomplete, letting readers wonder about how exactly to use it.

Found an example from https://platform.openai.com/docs/guides/tools-connectors-mcp

It seems like one just put the github repo id (such as accountID/repoID or rose-compiler/rose-full) into the question, then deepwiki will answer question about that repo.

from openai import OpenAI
import os
import sys

api_key = os.getenv("OPENAI_API_KEY")
if not api_key:
    print("OPENAI_API_KEY is not set. Please export it in your environment.")
    sys.exit(0)

client = OpenAI(api_key=api_key)

question1="What header and source files are used to define Sawyer in (rose-compiler/rose-full) ?"

question2="What transport protocols does the 2025-03-26 version of the MCP spec (modelcontextprotocol/modelcontextprotocol) support?"

resp = client.responses.create(
    model="gpt-5",
    tools=[
        {
            "type": "mcp",
            "server_label": "deepwiki",
            "server_url": "https://mcp.deepwiki.com/mcp",
            "require_approval": {
                "never": {
                    "tool_names": ["ask_question", "read_wiki_structure"]
                }
            }
        },
    ],
    input=question1,
)

print(resp.output_text)
@chunhualiao
Copy link
Author

Cline's MCP server configuration tab exposes the tool details of DeepWiki

Screenshot 2025-11-14 at 12 00 23 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment