Skip to content

Commit edb3e55

Browse files
committed
Add MCP server for intelligent documentation search
- Add Node.js MCP server with intelligent search capabilities - Support section-specific filtering (developers, operators, resources, etc.) - Implement relevance scoring with context snippets - Include comprehensive README and installation script - Add distributable quick-start guide for easy sharing - Enable AI assistants to search 500+ documentation files - Support configurable result limits and line number references
1 parent 92015ed commit edb3e55

File tree

7 files changed

+695
-13
lines changed

7 files changed

+695
-13
lines changed

install-mcp.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Neutron Docs MCP Server Installation Script
4+
5+
echo "🚀 Installing Neutron Docs MCP Server..."
6+
7+
# Check if npm is installed
8+
if ! command -v npm &> /dev/null; then
9+
echo "❌ npm is required but not installed. Please install Node.js and npm first."
10+
exit 1
11+
fi
12+
13+
# Install dependencies
14+
echo "📦 Installing dependencies..."
15+
npm install
16+
17+
# Make server executable
18+
echo "🔧 Making server executable..."
19+
chmod +x mcp-server.js
20+
21+
# Test the server
22+
echo "🧪 Testing server..."
23+
timeout 2s node mcp-server.js 2>&1 | head -1
24+
25+
echo "✅ Neutron Docs MCP Server installed successfully!"
26+
echo ""
27+
echo "📋 Usage:"
28+
echo " Direct: node mcp-server.js"
29+
echo " With MCP client: Add to your MCP configuration"
30+
echo ""
31+
echo "📖 See mcp-server-README.md for detailed setup instructions"
32+
echo ""
33+
echo "🔍 Available tool: search"
34+
echo " - Search across comprehensive Neutron documentation"
35+
echo " - Supports section filtering (developers, operators, resources, etc.)"
36+
echo " - Intelligent relevance scoring"
37+
echo ""
38+
echo "Example configuration for Claude Desktop:"
39+
echo '{'
40+
echo ' "mcpServers": {'
41+
echo ' "neutron-docs": {'
42+
echo ' "command": "node",'
43+
echo ' "args": ["'$(pwd)'/mcp-server.js"],'
44+
echo ' "cwd": "'$(pwd)'"'
45+
echo ' }'
46+
echo ' }'
47+
echo '}'

mcp-server-README.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Neutron Docs MCP Server
2+
3+
A Model Context Protocol (MCP) server that provides intelligent search capabilities across the Neutron blockchain documentation.
4+
5+
## Overview
6+
7+
This MCP server enables AI assistants to search through Neutron's comprehensive documentation, including:
8+
- Developer guides and tutorials
9+
- Module references and APIs
10+
- Operator documentation
11+
- Network resources and contracts
12+
- Concepts and DeFi information
13+
14+
## Features
15+
16+
- **Intelligent Search**: Advanced text matching with relevance scoring
17+
- **Section-Specific Search**: Filter results by documentation sections
18+
- **Context-Aware Results**: Provides relevant content snippets with line numbers
19+
- **Title and Content Matching**: Searches both document titles and content
20+
- **Configurable Results**: Control the number of results returned
21+
22+
## Installation
23+
24+
1. **Install Dependencies**:
25+
```bash
26+
npm install
27+
```
28+
29+
2. **Make the Server Executable**:
30+
```bash
31+
chmod +x mcp-server.js
32+
```
33+
34+
## Usage
35+
36+
### Direct Usage
37+
38+
Run the server directly:
39+
```bash
40+
node mcp-server.js
41+
```
42+
43+
### With MCP Client
44+
45+
Add to your MCP client configuration:
46+
```json
47+
{
48+
"mcpServers": {
49+
"neutron-docs": {
50+
"command": "node",
51+
"args": ["mcp-server.js"],
52+
"env": {
53+
"NODE_ENV": "production"
54+
}
55+
}
56+
}
57+
}
58+
```
59+
60+
### Example Usage with Claude Desktop
61+
62+
Add to your Claude Desktop configuration file:
63+
64+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
65+
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
66+
67+
```json
68+
{
69+
"mcpServers": {
70+
"neutron-docs": {
71+
"command": "node",
72+
"args": ["/path/to/neutron-docs/mcp-server.js"],
73+
"cwd": "/path/to/neutron-docs"
74+
}
75+
}
76+
}
77+
```
78+
79+
## Available Tools
80+
81+
### search
82+
83+
Search across the Neutron Documentation to fetch relevant context.
84+
85+
**Parameters:**
86+
- `query` (required): The search query string
87+
- `section` (optional): Limit search to specific sections
88+
- Options: `developers`, `operators`, `resources`, `concepts`, `defi`, `all`
89+
- Default: `all`
90+
- `max_results` (optional): Maximum number of results to return
91+
- Default: 10
92+
93+
**Example:**
94+
```json
95+
{
96+
"name": "search",
97+
"arguments": {
98+
"query": "interchain transactions",
99+
"section": "developers",
100+
"max_results": 5
101+
}
102+
}
103+
```
104+
105+
## Search Capabilities
106+
107+
### Section Coverage
108+
109+
- **Developers**: Guides, tutorials, modules, APIs
110+
- **Operators**: Node operations, validation, relayers
111+
- **Resources**: Network info, contracts, upgrades
112+
- **Concepts**: Core blockchain concepts
113+
- **DeFi**: DeFi protocols and applications
114+
- **Quickstart**: Getting started guides
115+
- **Snippets**: Code examples and templates
116+
117+
### Relevance Scoring
118+
119+
The server uses an intelligent scoring system that considers:
120+
- Title matches (highest priority)
121+
- Number of matching search terms
122+
- Frequency of matches in content
123+
- Exact phrase matches
124+
- Section preferences (developers section gets slight boost)
125+
126+
### Content Extraction
127+
128+
Results include:
129+
- Document title and file path
130+
- Section classification
131+
- Relevance score
132+
- Matching line numbers
133+
- Content preview with context
134+
135+
## Example Queries
136+
137+
- `"How to register interchain account"`
138+
- `"IBC callbacks sudo handlers"`
139+
- `"Neutron fee structure"`
140+
- `"Running a validator node"`
141+
- `"CosmWasm smart contracts"`
142+
143+
## Development
144+
145+
### Project Structure
146+
147+
```
148+
neutron-docs/
149+
├── mcp-server.js # Main MCP server implementation
150+
├── mcp-server-config.json # Server configuration
151+
├── package.json # Dependencies and scripts
152+
├── developers/ # Developer documentation
153+
├── operators/ # Operator guides
154+
├── resources/ # Network resources
155+
├── concepts/ # Core concepts
156+
└── defi/ # DeFi documentation
157+
```
158+
159+
### Running in Development
160+
161+
```bash
162+
npm run mcp-server
163+
```
164+
165+
### Debugging
166+
167+
The server outputs debug information to stderr, which won't interfere with the MCP protocol communication on stdout.
168+
169+
## Troubleshooting
170+
171+
### Common Issues
172+
173+
1. **Module not found errors**: Ensure all dependencies are installed with `npm install`
174+
2. **Permission denied**: Make sure the server script is executable: `chmod +x mcp-server.js`
175+
3. **No results**: Try broader search terms or different sections
176+
4. **Configuration issues**: Verify the path to the server script in your MCP client config
177+
178+
### Logs
179+
180+
The server logs errors to stderr for debugging without interfering with MCP communication.
181+
182+
## License
183+
184+
MIT License - see the main project LICENSE file for details.

mcp-server-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"neutron-docs": {
4+
"command": "node",
5+
"args": ["mcp-server.js"],
6+
"env": {
7+
"NODE_ENV": "production"
8+
}
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)