Skip to content

[mcp] Make tool more reliable and fix integration issues with babel #33074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 30, 2025

Conversation

jorge-cab
Copy link
Contributor

Summary

Fix babel presets, and add a bit more context to the tool so that it is more reliable

How did you test this change?

Manually tested the mcp integrated with claude desktop

@jorge-cab jorge-cab requested a review from poteto April 30, 2025 22:02
@jorge-cab jorge-cab changed the title Fix mcp runtime [mcp] Make tool more reliable and fix integration issues with babel Apr 30, 2025
@@ -356,7 +356,7 @@ Server Components - Shift data-heavy logic to the server whenever possible. Brea

server.tool(
'review-react-runtime',
'Review the runtime of the code and get performance data to evaluate the proposed solution, the react code that is passed into this tool MUST contain an App component.',
'Review the runtime of the code and get performance data to evaluate the proposed solution, the react code that is passed into this tool MUST contain an App functional component without arrow function. And DO NOT export anything',
Copy link
Member

Choose a reason for hiding this comment

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

Can you also add something like "run this tool every time you propose a performance related change to verify if your suggestion actually improves performance"

@@ -48,10 +45,10 @@ export async function measurePerformance(code: any) {
* @param {Object} opts - Transformation options
* @returns {Promise<string>} - The transpiled code
*/
async function transformAsync(ast: babel.types.Node) {
async function transformAsync(ast: babel.types.Node, options: any) {
Copy link
Member

Choose a reason for hiding this comment

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

you can fix the any here by just removing this function and parseAsync. You can inline it directly into measurePerformance so everything is typed correctly.

@jorge-cab jorge-cab merged commit d8074cb into facebook:main Apr 30, 2025
20 checks passed
github-actions bot pushed a commit to code/lib-react that referenced this pull request May 1, 2025
…acebook#33074)

## Summary

Fix babel presets, and add a bit more context to the tool so that it is
more reliable

## How did you test this change?

Manually tested the mcp integrated with claude desktop

DiffTrain build for [d8074cb](facebook@d8074cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants