This MCP server allows you to access and query technology documentation using Gemini API's large context window. It acts as a powerful documentation assistant that can provide comprehensive answers by leveraging the entire specification for a technology, rather than just returning search snippets.
Install the Gemini Docs Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @M-Gonzalo/cosa-sai --client claude
After installation, you need to configure the server in your client settings file. For Claude/Roo clients, this is typically located at:
~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
Add the following configuration:
{
"command": "bun",
"args": [
"--watch",
"path/to/repo/cosa-sai-mcp/src/index.ts",
"--verbose"
],
"env": {
"GEMINI_API_KEY": "<your_gemini_api_key>"
},
"disabled": false,
"alwaysAllow": [
"can_x_be_done",
"hints_for_problem",
"is_this_good_practice",
"how_to_do_x"
],
"timeout": 60
}
Make sure to:
<your_gemini_api_key>
with your actual Gemini API keyThe server requires a knowledge base of documentation to function properly. You need to manually gather this documentation through one of these methods:
Use this simple command to mirror a documentation website:
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent --directory-prefix=./local_copy --no-verbose --show-progress $1
After scraping, you can convert HTML files to a more usable format:
#!/bin/bash
directory="${1:-.}" # Default to current directory if no argument is provided
output_file="${2:-concatenated.md}" # Default output file name
# Clear output file if it exists
truncate -s 0 "$output_file"
# Find all files and process them
find "$directory" -type f -name '*.html' | while IFS= read -r file; do
echo "=== ${file#./} ===" >> "$output_file"
cat "$file" \
| grep -v 'base64' \
| html2markdown >> "$output_file"
echo -e "\n" >> "$output_file"
done
The MCP server provides four main tools for interacting with documentation:
Use can_x_be_done
to determine if a specific task can be accomplished with a technology:
{
"tool": "can_x_be_done",
"input": {
"docs": "documentation content",
"prompt": "your prompt",
"x": "the task to check",
"technology": "the technology name"
}
}
Use hints_for_problem
to receive guidance on specific problems:
{
"tool": "hints_for_problem",
"input": {
"docs": "documentation content",
"prompt": "your prompt",
"problem": "description of the problem",
"context": "contextual information",
"environment": "details about your environment"
}
}
Use is_this_good_practice
to evaluate code quality:
{
"tool": "is_this_good_practice",
"input": {
"docs": "documentation content",
"prompt": "your prompt",
"snippet": "code to evaluate",
"context": "context of the code"
}
}
Use how_to_do_x
to learn different approaches for implementing a feature:
{
"tool": "how_to_do_x",
"input": {
"docs": "documentation content",
"prompt": "your prompt",
"x": "what you want to accomplish",
"technology": "the technology name"
}
}
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.