Skip to content

Commit 623b078

Browse files
committed
fix: add mcp server explanation and scripts
1 parent ed91c2f commit 623b078

File tree

7 files changed

+483
-2
lines changed

7 files changed

+483
-2
lines changed

packages/usehooks-mcp/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# mcp-usehooks
22

3+
## 1.2.1
4+
5+
### Added
6+
7+
- Comprehensive IDE Integration Guide (`IDE_INTEGRATION.md`)
8+
- Configuration examples for VSCode, Windsurf IDE, and Claude Desktop
9+
- Example configuration files in `examples/ide-configs.json`
10+
- Troubleshooting section for common integration issues
11+
- Support for local development setup instructions
12+
13+
### Improved
14+
15+
- Updated README with quick setup instructions for popular IDEs
16+
- Enhanced documentation for MCP server configuration
17+
318
## 1.2.0
419

520
### Minor Changes
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# IDE Integration Guide for UseHooks MCP Server
2+
3+
This guide explains how to integrate the UseHooks MCP server with popular IDEs like VSCode and Windsurf IDE.
4+
5+
## Overview
6+
7+
The UseHooks MCP server provides access to React hooks from usehooks.io through the Model Context Protocol (MCP). This allows AI assistants in your IDE to browse, search, and fetch React hooks with detailed implementation code and examples.
8+
9+
## Prerequisites
10+
11+
- Node.js 16.0.0 or higher
12+
- npm or pnpm package manager
13+
- VSCode or Windsurf IDE with MCP support
14+
15+
## Installation
16+
17+
### Global Installation (Recommended)
18+
19+
```bash
20+
npm install -g mcp-usehooks
21+
```
22+
23+
### Local Installation
24+
25+
```bash
26+
npm install mcp-usehooks
27+
```
28+
29+
## IDE Configuration
30+
31+
### VSCode Integration
32+
33+
#### Method 1: Using Claude Desktop Extension
34+
35+
1. Install the Claude Desktop extension in VSCode
36+
2. Open VSCode settings (Cmd/Ctrl + ,)
37+
3. Search for "MCP" or "Claude"
38+
4. Add the following MCP server configuration:
39+
40+
```json
41+
{
42+
"claude.mcpServers": {
43+
"usehooks": {
44+
"command": "mcp-usehooks",
45+
"args": [],
46+
"env": {}
47+
}
48+
}
49+
}
50+
```
51+
52+
#### Method 2: Using Cline Extension (formerly Claude Dev)
53+
54+
1. Install the Cline extension in VSCode
55+
2. Open the extension settings
56+
3. Navigate to MCP Servers configuration
57+
4. Add a new server with:
58+
- **Name**: `usehooks`
59+
- **Command**: `mcp-usehooks`
60+
- **Args**: `[]` (empty array)
61+
62+
#### Method 3: Manual Configuration File
63+
64+
Create or edit your MCP configuration file (usually `~/.config/claude-desktop/claude_desktop_config.json`):
65+
66+
```json
67+
{
68+
"mcpServers": {
69+
"usehooks": {
70+
"command": "mcp-usehooks",
71+
"args": []
72+
}
73+
}
74+
}
75+
```
76+
77+
### Windsurf IDE Integration
78+
79+
#### Using Built-in MCP Support
80+
81+
1. Open Windsurf IDE
82+
2. Go to Settings → Extensions → MCP Servers
83+
3. Click "Add New Server"
84+
4. Configure the server:
85+
- **Server Name**: `UseHooks`
86+
- **Command**: `mcp-usehooks`
87+
- **Arguments**: Leave empty or `[]`
88+
- **Working Directory**: Leave default
89+
90+
#### Alternative Configuration
91+
92+
If Windsurf uses a configuration file, add this to your MCP config:
93+
94+
```json
95+
{
96+
"servers": {
97+
"usehooks": {
98+
"command": "mcp-usehooks",
99+
"args": [],
100+
"env": {}
101+
}
102+
}
103+
}
104+
```
105+
106+
## Local Development Setup
107+
108+
If you're working with the source code locally:
109+
110+
1. Clone the repository:
111+
```bash
112+
git clone https://github.com/small-lab-io/usehooks.io.git
113+
cd usehooks.io/packages/usehooks-mcp
114+
```
115+
116+
2. Install dependencies:
117+
```bash
118+
npm install
119+
```
120+
121+
3. Use the local path in your IDE configuration:
122+
```json
123+
{
124+
"usehooks": {
125+
"command": "node",
126+
"args": ["/path/to/usehooks.io/packages/usehooks-mcp/mcp_usehooks_server.js"]
127+
}
128+
}
129+
```
130+
131+
## Verification
132+
133+
To verify the integration is working:
134+
135+
1. Restart your IDE after configuration
136+
2. Open a chat with your AI assistant
137+
3. Ask questions like:
138+
- "Show me available React hooks"
139+
- "Search for storage-related hooks"
140+
- "Get details about the use-counter hook"
141+
142+
## Available Commands
143+
144+
Once integrated, your AI assistant can use these tools:
145+
146+
- **list_hooks**: List all available React hooks, optionally filtered by category
147+
- **search_hooks**: Search hooks by keyword in name, title, or description
148+
- **get_hook**: Get detailed information about a specific hook with implementation code
149+
- **get_categories**: Get all available hook categories
150+
151+
## Troubleshooting
152+
153+
### Common Issues
154+
155+
1. **Command not found**: Ensure `mcp-usehooks` is installed globally or use the full path
156+
2. **Permission denied**: Check file permissions and ensure Node.js is properly installed
157+
3. **Server not starting**: Verify Node.js version (16.0.0+) and dependencies are installed
158+
159+
### Debug Mode
160+
161+
Run the server manually to check for errors:
162+
163+
```bash
164+
# Global installation
165+
mcp-usehooks
166+
167+
# Local installation
168+
npx mcp-usehooks
169+
170+
# From source
171+
node mcp_usehooks_server.js
172+
```
173+
174+
### Logs
175+
176+
Check your IDE's MCP server logs for connection issues. Most IDEs provide MCP server status in their settings or developer tools.
177+
178+
## Configuration Options
179+
180+
### Environment Variables
181+
182+
You can configure the server behavior using environment variables:
183+
184+
```json
185+
{
186+
"usehooks": {
187+
"command": "mcp-usehooks",
188+
"args": [],
189+
"env": {
190+
"DEBUG": "true",
191+
"CACHE_TTL": "300"
192+
}
193+
}
194+
}
195+
```
196+
197+
### Custom Port (if needed)
198+
199+
Some configurations might require specifying a port:
200+
201+
```json
202+
{
203+
"usehooks": {
204+
"command": "mcp-usehooks",
205+
"args": ["--port", "3001"]
206+
}
207+
}
208+
```
209+
210+
## Support
211+
212+
If you encounter issues:
213+
214+
1. Check the [GitHub Issues](https://github.com/small-lab-io/usehooks.io/issues)
215+
2. Create a new issue with:
216+
- Your IDE and version
217+
- Configuration used
218+
- Error messages or logs
219+
- Steps to reproduce
220+
221+
## Contributing
222+
223+
Contributions to improve IDE integration are welcome! Please submit pull requests or issues on the [GitHub repository](https://github.com/small-lab-io/usehooks.io).

packages/usehooks-mcp/README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ A Model Context Protocol (MCP) server for accessing React hooks from usehooks.io
1414

1515
## Installation
1616

17+
### Quick Install (Recommended)
18+
19+
Use our installation scripts for an automated setup:
20+
21+
**Linux/macOS:**
22+
```bash
23+
curl -fsSL https://raw.githubusercontent.com/small-lab-io/usehooks.io/main/packages/usehooks-mcp/scripts/install.sh | bash
24+
```
25+
26+
**Windows:**
27+
Download and run `scripts/install.bat` from the repository.
28+
29+
### Manual Installation
30+
1731
```bash
1832
npm install -g mcp-usehooks
1933
```
@@ -54,7 +68,9 @@ For development with auto-restart on file changes:
5468
npm run dev
5569
```
5670

57-
### Integration with Claude Desktop
71+
### Integration with IDEs
72+
73+
#### Claude Desktop
5874

5975
To use this MCP server with Claude Desktop:
6076

@@ -66,6 +82,28 @@ To use this MCP server with Claude Desktop:
6682

6783
Once connected, Claude will have access to the hooks through the MCP tools.
6884

85+
#### VSCode and Windsurf IDE
86+
87+
For detailed instructions on integrating with VSCode, Windsurf IDE, and other development environments, see the [IDE Integration Guide](./IDE_INTEGRATION.md).
88+
89+
**Quick Setup for VSCode:**
90+
1. Install globally: `npm install -g mcp-usehooks`
91+
2. Install Claude Desktop or Cline extension
92+
3. Add MCP server configuration:
93+
```json
94+
{
95+
"usehooks": {
96+
"command": "mcp-usehooks",
97+
"args": []
98+
}
99+
}
100+
```
101+
102+
**Quick Setup for Windsurf IDE:**
103+
1. Install globally: `npm install -g mcp-usehooks`
104+
2. Go to Settings → Extensions → MCP Servers
105+
3. Add new server with command: `mcp-usehooks`
106+
69107
## Available Tools
70108

71109
### list_hooks
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"claude_desktop_config": {
3+
"description": "Configuration for Claude Desktop (~/.config/claude-desktop/claude_desktop_config.json)",
4+
"config": {
5+
"mcpServers": {
6+
"usehooks": {
7+
"command": "mcp-usehooks",
8+
"args": []
9+
}
10+
}
11+
}
12+
},
13+
"vscode_cline_extension": {
14+
"description": "Configuration for VSCode Cline extension settings",
15+
"config": {
16+
"cline.mcpServers": {
17+
"usehooks": {
18+
"command": "mcp-usehooks",
19+
"args": [],
20+
"env": {}
21+
}
22+
}
23+
}
24+
},
25+
"windsurf_ide": {
26+
"description": "Configuration for Windsurf IDE MCP settings",
27+
"config": {
28+
"servers": {
29+
"usehooks": {
30+
"command": "mcp-usehooks",
31+
"args": [],
32+
"env": {},
33+
"description": "React hooks from usehooks.io"
34+
}
35+
}
36+
}
37+
},
38+
"local_development": {
39+
"description": "Configuration for local development (using source code)",
40+
"config": {
41+
"usehooks": {
42+
"command": "node",
43+
"args": ["/path/to/usehooks.io/packages/usehooks-mcp/mcp_usehooks_server.js"],
44+
"env": {
45+
"DEBUG": "true"
46+
}
47+
}
48+
}
49+
},
50+
"with_custom_options": {
51+
"description": "Configuration with custom environment variables",
52+
"config": {
53+
"usehooks": {
54+
"command": "mcp-usehooks",
55+
"args": [],
56+
"env": {
57+
"DEBUG": "true",
58+
"CACHE_TTL": "300",
59+
"NODE_ENV": "development"
60+
}
61+
}
62+
}
63+
}
64+
}

packages/usehooks-mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"access": "public"
55
},
66
"private": false,
7-
"version": "1.2.0",
7+
"version": "1.2.1",
88
"description": "MCP server to explore React hooks from usehooks.io with enhanced formatting and caching",
99
"type": "module",
1010
"bin": {

0 commit comments

Comments
 (0)