DeepView MCP is a Model Context Protocol server designed to enable IDEs like Cursor and Windsurf to analyze large codebases using Gemini's extensive context window. It lets you load an entire codebase from a single text file and query it using Gemini's AI capabilities.
pip install deepview-mcp
Note: You typically don't need to start the server manually. These parameters are configured in your MCP setup in your IDE.
# Basic usage with default settings
deepview-mcp [path/to/codebase.txt]
# Specify a different Gemini model
deepview-mcp [path/to/codebase.txt] --model gemini-2.0-pro
# Change log level
deepview-mcp [path/to/codebase.txt] --log-level DEBUG
The codebase file parameter is optional. If not provided, you'll need to specify it when making queries.
--model MODEL
: Specify the Gemini model to use (default: gemini-2.0-flash-lite)--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
: Set the logging level (default: INFO)To use DeepView MCP with an IDE like Cursor or Windsurf:
{
"mcpServers": {
"deepview": {
"command": "/path/to/deepview-mcp",
"args": ["/path/to/codebase.txt"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key"
}
}
}
}
The server provides one tool:
question
- The question to ask about the codebasecodebase_file
- Path to a codebase file to load before queryingDeepView MCP requires a single file containing your entire codebase. You can use repomix to prepare your codebase in an AI-friendly format.
# Make sure you're using Node.js 18.17.0 or higher
npx repomix
This will generate a repomix-output.xml
file containing your codebase.
Create a configuration file to customize which files get packaged and the output format:
npx repomix --init
This creates a repomix.config.json
file that you can edit to:
Here's an example repomix.config.json
file:
{
"include": [
"**/*.py",
"**/*.js",
"**/*.ts",
"**/*.jsx",
"**/*.tsx"
],
"exclude": [
"node_modules/**",
"venv/**",
"**/__pycache__/**",
"**/test/**"
],
"output": {
"format": "xml",
"filename": "my-codebase.xml"
}
}
For more information on repomix, visit the repomix GitHub repository.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "deepview" '{"command":"/path/to/deepview-mcp","args":["/path/to/codebase.txt"],"env":{"GEMINI_API_KEY":"your_gemini_api_key"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"deepview": {
"command": "/path/to/deepview-mcp",
"args": [
"/path/to/codebase.txt"
],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"deepview": {
"command": "/path/to/deepview-mcp",
"args": [
"/path/to/codebase.txt"
],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect