|
| 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. |
0 commit comments