About Mcp_usehooks
mcp-usehooks is an MCP server that gives access to React hooks from usehooks.io. It is intended for developers and AI assistants that need hook lookups, with JSON or Markdown output and result caching.
Key features
- 01List hooks, optionally filtered by category
- 02Search hooks by keyword
- 03Retrieve hook implementation code and examples
- 04Output in JSON or Markdown
- 05Cache results with a 5-minute TTL
Use cases
- 01Letting an AI assistant find reusable React hooks
- 02Browsing hooks by category and fetching example code
MCP support
This project is an MCP server that exposes the list_hooks, get_categories, search_hooks and get_hook tools to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
4Saved tool list · updated 2w ago
This tool takes no parameters.
Details
From the project READMEmcp-usehooks
A Model Context Protocol (MCP) server for accessing React hooks from usehooks.io with enhanced formatting options and caching.
Features
- Access all hooks from the usehooks.io repository
- Search hooks by keyword or category
- Get detailed information about specific hooks including implementation code
- View examples with code snippets
- Format output as JSON or Markdown
- Efficient caching for improved performance
- Comprehensive error handling
Installation
Quick Install (Recommended)
Use our installation scripts for an automated setup:
Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/small-lab-io/usehooks.io/main/packages/usehooks-mcp/scripts/install.sh | bash
Windows:
Download and run scripts/install.bat from the repository.
Manual Installation
npm install -g mcp-usehooks
Or install locally:
npm install mcp-usehooks
Usage
Starting the Server
If installed globally:
mcp-usehooks
If installed locally:
npx mcp-usehooks
Or run it directly from the repository:
node mcp_usehooks_server.js
Development Mode
For development with auto-restart on file changes:
npm run dev
Integration with IDEs
Claude Desktop
To use this MCP server with Claude Desktop:
- Install the package globally:
npm install -g mcp-usehooks - In Claude Desktop, go to Settings > MCP Servers
- Add a new MCP server with the following configuration:
- Name: UseHooks
- Command:
mcp-usehooks
Once connected, Claude will have access to the hooks through the MCP tools.
VSCode and Windsurf IDE
For detailed instructions on integrating with VSCode, Windsurf IDE, and other development environments, see the IDE Integration Guide.
Quick Setup for VSCode:
- Install globally:
npm install -g mcp-usehooks - Install Claude Desktop or Cline extension
- Add MCP server configuration:
{ "usehooks": { "command": "mcp-usehooks", "args": [] } }
Quick Setup for Windsurf IDE:
- Install globally:
npm install -g mcp-usehooks - Go to Settings → Extensions → MCP Servers
- Add new server with command:
mcp-usehooks
Available Tools
list_hooks
Lists all available React hooks, optionally filtered by category.
Parameters:
category(optional): Filter hooks by category (e.g., "state", "browser", "utility")format(optional): Output format, either "json" or "markdown" (default: "markdown")
Example:
{
"server_name": "usehooks",
"tool_name": "list_hooks",
"args": {
"category": "state",
"format": "markdown"
}
}
get_categories
Retrieves all available hook categories.
Parameters:
with_counts(optional): Include the number of hooks in each category (default: false)
Example:
{
"server_name": "usehooks",
"tool_name": "get_categories",
"args": {
"with_counts": true
}
}
search_hooks
Searches for hooks by keyword in name, title, or description.
Parameters:
keyword: Keyword to search for in hook names, titles, and descriptionscategory(optional): Filter search results by categoryformat(optional): Output format, either "json" or "markdown" (default: "markdown")
Example:
{
"server_name": "usehooks",
"tool_name": "search_hooks",
"args": {
"keyword": "storage",
"category": "browser",
"format": "markdown"
}
}
get_hook
Retrieves detailed information about a specific hook, including its implementation code and examples.
Parameters:
name: Name of the hook to retrieve (e.g., "use-counter", "use-local-storage")format(optional): Output format, either "json" or "markdown" (default: "markdown")include_examples(optional): Include example code snippets (default: true)
Example:
{
"server_name": "usehooks",
"tool_name": "get_hook",
"args": {
"name": "use-counter",
"format": "markdown",
"include_examples": true
}
}
Features in Detail
Caching
The server implements an efficient caching mechanism with a 5-minute TTL (Time To Live) to improve performance and reduce API calls. The cache includes:
- List of all hooks
- Hooks organized by category
- Individual hook details
Markdown Formatting
All tools support markdown output format for better readability when used with AI assistants. The markdown output includes:
- Properly formatted headings
- Code blocks with syntax highlighting
- Lists and descriptions
- Examples with code snippets
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.