Sponsored by Deepsite.site

Mcp Usehooks

Created By
packages5 months ago
A Model Context Protocol (MCP) server for accessing React hooks from usehooks.io with enhanced formatting options and caching.
Content

usehooks.io

A comprehensive collection of production-ready React hooks

Build better React applications with our curated library of reusable hooks and powerful CLI tool

🌐 Website🚀 Quick Start📚 Hooks🛠️ CLI🤝 Contributing

React 18+ TypeScript 5.8+ MIT License


✨ Features

  • 🎯 30+ Production-Ready Hooks - Carefully crafted and battle-tested
  • 🚀 Zero Configuration - Works out of the box with any React project
  • 📦 CLI Tool - Add hooks to your project with a single command
  • 🔍 Smart Search - Find hooks by name, description, or category
  • 🛡️ Type Safe - Full TypeScript support with comprehensive type definitions
  • 📱 Modern APIs - Leverages latest browser APIs and React patterns
  • 🎨 Customizable - Flexible configuration options for every use case
  • 📋 Well Documented - Comprehensive docs with examples and best practices

🚀 Quick Start

# Initialize usehooks in your project
npx usehooks-cli@latest init

# Add a specific hook
npx usehooks-cli@latest add use-counter

# List all available hooks
npx usehooks-cli@latest list

# Get detailed information about a hook
npx usehooks-cli@latest info use-geolocation

📚 Available Hooks

Our collection includes 30+ hooks organized by category:

🏪 State Management

  • useArray - Helper methods for array state manipulation
  • useCounter - Counter state with increment, decrement, and reset
  • useLocalStorage - Sync state with localStorage
  • useSet - Comprehensive Set data structure management
  • useToggle - Boolean toggle state with convenient methods

📡 Sensors & Device APIs

  • useAudioRecorder - Audio recording with real-time analysis
  • useBarcodeDetector - Barcode and QR code detection
  • useDeviceOrientation - Device orientation data access
  • useGeolocation - User location with GPS tracking
  • useHover - Element hover detection with callbacks
  • useIsMobile - Mobile device detection using media queries and user agent
  • useIsTablet - Tablet device detection with comprehensive device identification
  • useMediaSession - Media notifications and control actions
  • useNetworkInformation - Network connection monitoring
  • useUserMedia - Camera and microphone access
  • useVibration - Device vibration control

🌐 Browser APIs

  • useBluetooth - Bluetooth Low Energy device interaction
  • useClipboard - Clipboard operations with state management
  • useContactPicker - Contact selection with user permission
  • useFullscreen - Fullscreen mode management
  • useStorage - Browser storage quotas and persistence
  • useWebShare - Native sharing mechanisms
  • useWindowSize - Window dimensions tracking

🔧 Utilities

  • useDebounce - Value debouncing for performance
  • useThrottle - Value throttling for rate limiting
  • usePrevious - Access to previous state/prop values
  • useIsMounted - Component mount status checking
  • useTimeout - Timeout management with controls

🔄 Lifecycle

  • useDeepCompareEffect - useEffect with deep equality check
  • useUpdateEffect - useEffect that skips initial render

🌍 Network

  • useFetch - HTTP requests with loading states and error handling

🔐 Authentication

  • useRoleGuard - Role-based access control 💡 Tip : Run npx usehooks-cli@latest list to see the complete list with descriptions and categories.

🛠️ CLI Tool

Our powerful CLI tool makes it easy to discover, install, and manage hooks in your projects.

Key Features

  • 🚀 Quick Installation - Add hooks with a single command
  • 🔍 Smart Search - Find hooks by name, description, or category
  • 📋 Detailed Information - Get comprehensive details about any hook
  • 🔄 Update Management - Keep hooks up-to-date
  • 🗑️ Clean Removal - Remove hooks and dependencies safely
  • 📱 Interactive Mode - User-friendly prompts and confirmations

Commands

# Initialize project
npx usehooks-cli@latest init

# Add hooks
npx usehooks-cli@latest add use-counter use-toggle

# List all hooks
npx usehooks-cli@latest list

# Get hook information
npx usehooks-cli@latest info use-geolocation

# Update hooks
npx usehooks-cli@latest update --all

# Remove hooks
npx usehooks-cli@latest remove use-counter

🏗️ Project Structure

This monorepo contains several packages:

usehooks.io/
├── packages/
│   ├── hooks/              # 🪝 Core hooks library
│   ├── usehooks-cli/       # 🛠️ CLI tool for hook management
│   ├── ui/                 # 🎨 Shared UI components
│   ├── eslint-config/      # 📏 ESLint configuration
│   └── typescript-config/  # 📝 TypeScript configuration
├── apps/
    └── www/               # 🌐 Documentation website

🤝 Contributing

We welcome contributions! Here's how you can help:

Adding a New Hook

  1. Fork and clone the repository
  2. Create a new hook directory in packages/hooks/src/
  3. Follow the hook template :
    use-your-hook/
    ├── index.ts      # Hook implementation
    ├── meta.json     # Hook metadata
    └── doc.json      # Documentation
    
  4. Add comprehensive tests
  5. Update the index.json file
  6. Submit a pull request

Guidelines

  • ✅ TypeScript first - All hooks must be written in TypeScript
  • ✅ Comprehensive tests - Include unit tests and edge cases
  • ✅ Clear documentation - Provide examples and use cases
  • ✅ Performance focused - Optimize for minimal re-renders
  • ✅ Browser compatibility - Support modern browsers
  • ✅ Accessibility - Consider a11y implications

📖 Documentation

  • 🌐 Website : usehooks.io
  • 📚 Hook Documentation : Each hook includes comprehensive docs with examples
  • 🛠️ CLI Documentation : Run npx usehooks-cli@latest --help
  • 🎯 Examples : Check the /examples directory in each hook

🔧 Requirements

  • Node.js : 20 or higher
  • React : 18 or higher
  • TypeScript : 5.8 or higher (recommended)

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Server Config

{
  "mcpServers": {
    "usehooks": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-usehooks"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Serper MCP ServerA Serper MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code