narsil-mcp 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +128 -0
  2. package/install.js +91 -0
  3. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # narsil-mcp
2
+
3
+ Blazingly fast MCP server for code intelligence.
4
+
5
+ This package provides pre-built binaries for [narsil-mcp](https://github.com/postrv/narsil-mcp), a comprehensive code intelligence server that implements the Model Context Protocol (MCP).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g narsil-mcp
11
+ # or
12
+ yarn global add narsil-mcp
13
+ # or
14
+ pnpm add -g narsil-mcp
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ narsil-mcp --repos /path/to/your/project
21
+ ```
22
+
23
+ For full usage instructions:
24
+ ```bash
25
+ narsil-mcp --help
26
+ ```
27
+
28
+ ## Configuration with AI Assistants
29
+
30
+ ### Claude Desktop
31
+
32
+ Add to your `claude_desktop_config.json`:
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "narsil-mcp": {
38
+ "command": "narsil-mcp",
39
+ "args": ["--repos", "/path/to/your/projects"]
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Config file location:
46
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
47
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
48
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
49
+
50
+ ### VS Code with Copilot
51
+
52
+ Create `.vscode/mcp.json` in your workspace:
53
+
54
+ ```json
55
+ {
56
+ "servers": {
57
+ "narsil-mcp": {
58
+ "command": "narsil-mcp",
59
+ "args": ["--repos", "${workspaceFolder}"]
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Cursor
66
+
67
+ Create `.cursor/mcp.json` in your project:
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "narsil-mcp": {
73
+ "command": "narsil-mcp",
74
+ "args": ["--repos", "."]
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ## Features
81
+
82
+ narsil-mcp provides **76 MCP tools** for comprehensive code intelligence:
83
+
84
+ - 🔍 **Symbol search and code navigation** - Find structs, functions, classes across your codebase
85
+ - 🔎 **Multi-mode code search** - BM25, TF-IDF, hybrid, and neural embeddings
86
+ - 📊 **Call graph analysis** - Visualize function dependencies and complexity
87
+ - 🔐 **Security scanning** - OWASP Top 10, CWE Top 25, secrets detection
88
+ - 📦 **Supply chain analysis** - SBOM generation, vulnerability checks, license compliance
89
+ - 🧠 **Static analysis** - Control flow graphs, data flow, type inference
90
+ - 🔧 **LSP integration** - Enhanced hover, go-to-definition with language servers
91
+ - 🌐 **Remote repos** - Index and search GitHub repositories
92
+ - 📝 **Git integration** - Blame, history, hotspots, contributors
93
+
94
+ See the [main repository](https://github.com/postrv/narsil-mcp) for full documentation.
95
+
96
+ ## Supported Platforms
97
+
98
+ - macOS (Intel and Apple Silicon)
99
+ - Linux (x86_64)
100
+ - Windows (x86_64)
101
+
102
+ ## Platform-Specific Packages
103
+
104
+ This is a wrapper package that automatically downloads the correct binary for your platform:
105
+
106
+ - `@narsil-mcp/darwin-x64` - macOS Intel
107
+ - `@narsil-mcp/darwin-arm64` - macOS Apple Silicon
108
+ - `@narsil-mcp/linux-x64` - Linux x86_64
109
+ - `@narsil-mcp/win32-x64` - Windows x86_64
110
+
111
+ ## Troubleshooting
112
+
113
+ If installation fails with platform errors:
114
+
115
+ 1. Ensure you're on a supported platform
116
+ 2. Try forcing a reinstall: `npm install -g narsil-mcp --force`
117
+ 3. Check that your Node.js version is 14 or higher: `node --version`
118
+ 4. Report issues at https://github.com/postrv/narsil-mcp/issues
119
+
120
+ ## License
121
+
122
+ MIT OR Apache-2.0
123
+
124
+ ## Documentation
125
+
126
+ - [GitHub Repository](https://github.com/postrv/narsil-mcp)
127
+ - [Installation Guide](https://github.com/postrv/narsil-mcp/blob/main/docs/INSTALL.md)
128
+ - [Changelog](https://github.com/postrv/narsil-mcp/blob/main/CHANGELOG.md)
package/install.js ADDED
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ const PACKAGE_NAME = 'narsil-mcp';
8
+
9
+ function getPlatform() {
10
+ const platform = os.platform();
11
+ const arch = os.arch();
12
+
13
+ // Map Node.js platform/arch to our package names
14
+ const platformMap = {
15
+ 'darwin-x64': '@narsil-mcp/darwin-x64',
16
+ 'darwin-arm64': '@narsil-mcp/darwin-arm64',
17
+ 'linux-x64': '@narsil-mcp/linux-x64',
18
+ 'win32-x64': '@narsil-mcp/win32-x64',
19
+ };
20
+
21
+ const key = `${platform}-${arch}`;
22
+ return platformMap[key];
23
+ }
24
+
25
+ function install() {
26
+ const platformPackage = getPlatform();
27
+
28
+ if (!platformPackage) {
29
+ console.error(`Unsupported platform: ${os.platform()}-${os.arch()}`);
30
+ console.error('Supported platforms:');
31
+ console.error(' - macOS x64 (Intel)');
32
+ console.error(' - macOS arm64 (Apple Silicon)');
33
+ console.error(' - Linux x64');
34
+ console.error(' - Windows x64');
35
+ process.exit(1);
36
+ }
37
+
38
+ try {
39
+ // Try to require the platform-specific package
40
+ const platformPackagePath = require.resolve(`${platformPackage}/package.json`);
41
+ const platformDir = path.dirname(platformPackagePath);
42
+ const binaryName = os.platform() === 'win32' ? 'narsil-mcp.exe' : 'narsil-mcp';
43
+ const binaryPath = path.join(platformDir, binaryName);
44
+
45
+ if (!fs.existsSync(binaryPath)) {
46
+ console.error(`Binary not found at ${binaryPath}`);
47
+ process.exit(1);
48
+ }
49
+
50
+ // Create bin directory if it doesn't exist
51
+ const binDir = path.join(__dirname, 'bin');
52
+ if (!fs.existsSync(binDir)) {
53
+ fs.mkdirSync(binDir, { recursive: true });
54
+ }
55
+
56
+ // Create symlink or copy
57
+ const targetPath = path.join(binDir, binaryName);
58
+
59
+ // Remove existing symlink/file if present
60
+ if (fs.existsSync(targetPath)) {
61
+ fs.unlinkSync(targetPath);
62
+ }
63
+
64
+ if (os.platform() === 'win32') {
65
+ // On Windows, copy the file
66
+ fs.copyFileSync(binaryPath, targetPath);
67
+ } else {
68
+ // On Unix, create symlink
69
+ fs.symlinkSync(binaryPath, targetPath);
70
+ fs.chmodSync(targetPath, 0o755);
71
+ }
72
+
73
+ console.log(`✅ Installed ${PACKAGE_NAME} for ${os.platform()}-${os.arch()}`);
74
+ } catch (error) {
75
+ if (error.code === 'MODULE_NOT_FOUND') {
76
+ console.error(`Platform-specific package ${platformPackage} not installed.`);
77
+ console.error('This usually means the package failed to install properly.');
78
+ console.error('Try running: npm install --force');
79
+ } else {
80
+ console.error('Installation failed:', error.message);
81
+ }
82
+ process.exit(1);
83
+ }
84
+ }
85
+
86
+ // Only run if called directly (not required)
87
+ if (require.main === module) {
88
+ install();
89
+ }
90
+
91
+ module.exports = { install };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "narsil-mcp",
3
+ "version": "1.1.2",
4
+ "description": "Blazingly fast MCP server for code intelligence",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/postrv/narsil-mcp.git"
8
+ },
9
+ "homepage": "https://github.com/postrv/narsil-mcp",
10
+ "bugs": {
11
+ "url": "https://github.com/postrv/narsil-mcp/issues"
12
+ },
13
+ "license": "MIT OR Apache-2.0",
14
+ "author": "postrv",
15
+ "keywords": [
16
+ "mcp",
17
+ "model-context-protocol",
18
+ "code-intelligence",
19
+ "ai-assistant",
20
+ "claude",
21
+ "code-search",
22
+ "ast",
23
+ "tree-sitter"
24
+ ],
25
+ "bin": {
26
+ "narsil-mcp": "./bin/narsil-mcp"
27
+ },
28
+ "optionalDependencies": {
29
+ "@narsil-mcp/darwin-x64": "1.1.1",
30
+ "@narsil-mcp/darwin-arm64": "1.1.1",
31
+ "@narsil-mcp/linux-x64": "1.1.1",
32
+ "@narsil-mcp/win32-x64": "1.1.1"
33
+ },
34
+ "engines": {
35
+ "node": ">=14"
36
+ },
37
+ "scripts": {
38
+ "postinstall": "node install.js"
39
+ },
40
+ "files": [
41
+ "bin",
42
+ "install.js",
43
+ "README.md"
44
+ ]
45
+ }