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)

How to configure deepwiki MCP server with Cline?
The chat window of Cline's bottom has a series of icons. One of them (three bricks) is to configure MCP .
Prompts in Cline
Now, with MCP server enabled, you can pose questions like the following (mention the github repo ID using accountID/repoID form)
Cline will figure out this should be handled by the deepwiki MCP server, ask for your permission to use it, then route the question/answer for you.
The raw response from the MCP server within Cline:
To create a variable declaration statement like
int i;using the ROSE compiler framework API, you should use theSageBuilder::buildVariableDeclarationfunction. This function is part of the high-level AST construction interface provided bySageBuilderandSageInterfacenamespaces.The
buildVariableDeclarationfunction handles the creation of theSgVariableDeclarationnode, along with associated symbol table entries and source file position information, transparently.Here's how you would typically use it:
The
buildVariableDeclarationfunction has several overloads, allowing you to specify the variable name asSgName,std::string, orconst char*. It also takes an optionalSgInitializerfor cases where the variable is initialized at declaration.After building the
SgVariableDeclarationnode, you would typically insert it into the AST using functions likeSageInterface::appendStatement(),prependStatement(), orinsertStatement(). These functions ensure that all necessary side effects for symbol tables, source file information, scope, and parent pointers are handled correctly.For example, to insert the declaration into a scope:
SageInterface::appendStatement(varDecl, scope);The internal implementation of
buildVariableDeclarationcreates a newSgVariableDeclarationobject and sets itsfirstNondefiningDeclarationto itself. It also handles the creation ofSgInitializedNameobjects and their association with the declaration. If a scope is provided, it will attempt to fix the variable declaration within that scope, which includes managing symbol tables.Notes:
The
buildVariableDeclaration_nfifunction is a "non-file-info" version, which is used internally and might have specific use cases related to how file information is handled or when reusing existingSgInitializedNameobjects. For general use,buildVariableDeclarationis recommended.Wiki pages you might want to explore:
View this search on DeepWiki: https://deepwiki.com/search/how-to-create-a-variable-decla_8b406500-10f2-4111-8fef-ee66e777594a
Cline further summarized it to be more brief
Thinking:The MCP tool returned a good example. It shows how to create a variable declaration like "int i;" using SageBuilder::buildVariableDeclaration.
To create a variable declaration statement like
int i;in the ROSE compiler framework, use theSageBuilder::buildVariableDeclarationfunction from the high-level AST construction interface. Here's an example:After creating the declaration, insert it into the AST using functions like
SageInterface::appendStatement():SageInterface::appendStatement(varDecl, scope);This handles creating the
SgVariableDeclarationnode, symbol table entries, and source file position information automatically. The function has overloads for different name types and supports optional initializers.