ai-rules
ai-rules copied to clipboard
fix(gemini): use marker instead of name prefix for MCP servers
Problem
Gemini MCP server names were prefixed with ai-rules-generated- to distinguish them from user-configured servers. This breaks MCP tool calls:
- Permission:
mcp__agent-task-queue__run_task - Actual server name:
ai-rules-generated-agent-task-queue - Result: MCP call
mcp__agent-task-queue__run_task()doesn't match the server
Other agents (Cursor, Roo, Claude) use ExternalMcpGenerator which preserves server names.
Solution
Use _aiRulesGenerated: true marker in the server config instead of prefixing the name:
{
"mcpServers": {
"agent-task-queue": {
"command": "uvx",
"args": ["agent-task-queue@latest"],
"_aiRulesGenerated": true
}
}
}
This allows MCP tools to work correctly while still distinguishing generated from user servers for clean/update operations.
Changes
- Replace
prefix_server_names()withmark_as_generated() - Add
is_generated()helper to check for marker - Update all tests
Test plan
- [x] All 16 Gemini tests pass
- [x]
cargo test geminipasses