get-stable-version
Retrieve the current production-ready React Native version for upgrade planning. Provides the stable release number to use with migration tools.
Instructions
Gets the latest stable version of React Native from GitHub releases.
OVERVIEW: This version represents the most recent production-ready release that has been thoroughly tested and is recommended for use in applications.
VERSION FORMAT: • The version number follows semantic versioning (e.g. 0.72.0) • Excludes any release candidates or beta versions
USAGE: • This tool is commonly used before planning an upgrade to ensure targeting the latest stable release • Must be called before calling get-react-native-diff tool • The output of this tool will be used as the toVersion parameter in the get-react-native-diff tool
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:54-59 (handler)The tool handler function that calls getStableVersion helper and formats the response as MCP tool output.async () => { const version = await getStableVersion(); return { content: [{ type: "text", text: version }] } }
- src/tools.ts:36-60 (registration)Registration of the 'get-stable-version' tool including title, description, and handler function.server.registerTool('get-stable-version', { title: "Get Stable Version", description: `Gets the latest stable version of React Native from GitHub releases. OVERVIEW: This version represents the most recent production-ready release that has been thoroughly tested and is recommended for use in applications. VERSION FORMAT: • The version number follows semantic versioning (e.g. 0.72.0) • Excludes any release candidates or beta versions USAGE: • This tool is commonly used before planning an upgrade to ensure targeting the latest stable release • Must be called before calling get-react-native-diff tool • The output of this tool will be used as the toVersion parameter in the get-react-native-diff tool`, }, async () => { const version = await getStableVersion(); return { content: [{ type: "text", text: version }] } } );
- src/services.ts:5-9 (helper)Core helper function implementing the logic to fetch the latest stable React Native version from GitHub API by getting the latest release tag and stripping the 'v' prefix.export const getStableVersion = async () => { const response = await fetch(`https://api.github.com/repos/facebook/react-native/releases/latest`); const data = await response.json() as { tag_name: string }; return data.tag_name.replace('v', ''); }