Skip to content

Conversation

@kirillzh
Copy link
Contributor

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() with mark_as_generated()
  • Add is_generated() helper to check for marker
  • Update all tests

Test plan

  • All 16 Gemini tests pass
  • cargo test gemini passes

Previously, Gemini MCP server names were prefixed with
"ai-rules-generated-" to distinguish them from user-configured
servers. This breaks MCP tool calls since the permission
`mcp__agent-task-queue__run_task` doesn't match
`mcp__ai-rules-generated-agent-task-queue__run_task`.

Now uses `_aiRulesGenerated: true` marker in the server config
instead of prefixing the name. This allows MCP tools to work
correctly while still distinguishing generated from user servers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant