Skip to content

Conversation

@m0nkmaster
Copy link

@m0nkmaster m0nkmaster commented Jan 21, 2026

Summary

Fixes #168

Cursor IDE converts dots (.) to underscores (_) when invoking MCP tools. This causes all tool calls to fail with Tool not found errors because the server registers tools with dots (e.g., docs.find) but Cursor calls them with underscores (e.g., docs_find). 🤷‍♂️

Changes

  • Wrap server.registerTool to normalise tool names (dots → underscores) at registration time
  • Add documentation note about tool naming conventions

Backwards Compatibility

This change is backwards-compatible. Clients that preserve dots (VS Code, Gemini CLI) will continue to work because underscores are valid characters in tool names for all MCP clients.

Testing

  • Verified tools work correctly in Cursor IDE after the fix
  • Verified tools continue to work in VS Code
  • Server reports all 51 tools registered successfully

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @m0nkmaster, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a compatibility issue with Cursor IDE where tool calls were failing due to a mismatch in tool naming conventions. By intercepting the tool registration process, the server now automatically normalizes tool names, converting dots to underscores, to align with how Cursor IDE invokes these tools. This change ensures seamless integration with Cursor IDE while maintaining backward compatibility for other clients.

Highlights

  • Cursor IDE Compatibility: Implemented a fix to ensure tools are correctly recognized by Cursor IDE, which converts dots in tool names to underscores, leading to 'Tool not found' errors.
  • Tool Name Normalization: Modified the tool registration process to automatically convert dot-separated tool names (e.g., 'docs.find') to underscore-separated names (e.g., 'docs_find') at runtime for broader MCP client compatibility.
  • Documentation Update: Added a new section to the development documentation explaining the tool naming conventions and the automatic normalization process for client compatibility.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an incompatibility with Cursor IDE by normalizing tool names at registration, replacing dots with underscores. The implementation involves monkey-patching the server.registerTool method. While the approach is functional, my review includes a suggestion to refactor the patch to preserve TypeScript's type safety, which is currently compromised by the new implementation. Additionally, a new section in the development documentation clarifies this new naming convention.

@m0nkmaster
Copy link
Author

Thanks for the review feedback @gemini-code-assist! The type safety concern has been addressed - the implementation now uses Parameters<typeof originalRegisterTool> and .apply() to preserve the original type signature.

@gemini-code-assist
Copy link
Contributor

That's excellent news, @m0nkmaster! Using Parameters<typeof originalRegisterTool> and .apply() is indeed the correct and type-safe approach to wrap the registerTool function while preserving its original signature. This effectively addresses the type safety concern.

Thank you for the quick and thorough update!

@m0nkmaster m0nkmaster force-pushed the fix/cursor-tool-name-compatibility branch from a89be7d to ca45e84 Compare January 21, 2026 15:45
@m0nkmaster m0nkmaster force-pushed the fix/cursor-tool-name-compatibility branch from ca45e84 to 797e257 Compare January 21, 2026 15:45
@allenhutchison
Copy link
Contributor

I think we'll need a different approach here. This would be a breaking change for people who have written gemini cli policies against the current tool names, as well as anyone who has written custom slash commands that rely on our MCP names (it would also break the slash commands that we ship in the extension).

I think a better approach would be to ship an adapter that is controlled by a command line flag so that our current names are the default and the command line flag can shift the names to use an _ instead.

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.

Bug: Tools not callable in Cursor IDE due to dot-to-underscore name conversion

2 participants