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)



execution results:
Different runs may generate different results,
compared to web interface used to ask the same question. The web interface responds with much more details answer:
https://deepwiki.com/search/what-header-and-source-files-a_734bbdd6-16b1-47b1-85b9-ea79bae8124e?mode=fast