Skip to content

Instantly share code, notes, and snippets.

@SoMaCoSF
Created July 23, 2025 18:24
Show Gist options
  • Save SoMaCoSF/dce3fc7007801f52ab0bfc0d5a29bdc9 to your computer and use it in GitHub Desktop.
Save SoMaCoSF/dce3fc7007801f52ab0bfc0d5a29bdc9 to your computer and use it in GitHub Desktop.
Everything MCP Server - Complete Implementation with SpecStory Integration
# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Build output
dist/
build/
# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
# IDE files
.vscode/
.idea/
*.swp
*.swo
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids/
*.pid
*.seed
*.pid.lock
# Coverage directory used by tools like istanbul
coverage/
*.lcov
# nyc test coverage
.nyc_output
# Temporary folders
tmp/
temp/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

Everything MCP Server

A Model Context Protocol (MCP) server that integrates voidtools Everything search engine with AI assistants like Cursor, Kiro IDE, SpecStory, Claude, and other MCP-compatible tools. Provides lightning-fast file and folder search capabilities using Everything's powerful indexing.

Everything MCP Architecture

🚀 Features

  • Lightning Fast Search: Leverages Everything's instant search capabilities
  • Advanced Filtering: Filter by file types, size, date, and more
  • Multiple Sort Options: Sort by name, size, date, or path
  • Regex Support: Use regular expressions for complex searches
  • Service Health Checks: Verify Everything service status
  • Comprehensive Logging: Full trace logging for debugging
  • Easy Integration: Simple setup with Cursor, Kiro, SpecStory, and other MCP clients

📋 Prerequisites

  • Windows OS: Everything only runs on Windows
  • Everything Installed: Download from voidtools.com
  • Node.js 18+: Required for MCP server
  • es.exe Available: Command-line interface must be accessible

Everything Setup

  1. Install Everything from voidtools.com
  2. Ensure the Everything service is running
  3. Verify es.exe exists at: C:\Program Files\Everything\es.exe
  4. Test with: "C:\Program Files\Everything\es.exe" test

🛠️ Installation

Option 1: From Source

# Clone the repository
git clone https://github.com/yourusername/everything-mcp.git
cd everything-mcp

# Install dependencies
npm install

# Build the server
npm run build

Option 2: Global Install (Coming Soon)

npm install -g everything-mcp-server

🔧 Usage with AI Assistants

Cursor IDE

Add to your Cursor settings.json:

{
  "mcp": {
    "servers": {
      "everything-search": {
        "command": "node",
        "args": ["path/to/everything-mcp/dist/index.js"],
        "env": {
          "EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
          "TRACE_DIRECTORY": "D:\\outputs\\traces"
        }
      }
    }
  }
}

Kiro IDE

Kiro is an agentic IDE that supports MCP servers for external tool integration. To add Everything search to Kiro:

  1. Open Kiro IDE and navigate to your project
  2. Create or edit your MCP configuration following Kiro's MCP documentation
  3. Add the Everything MCP server to your Kiro configuration:
{
  "mcpServers": {
    "everything-search": {
      "command": "node",
      "args": ["path/to/everything-mcp/dist/index.js"],
      "env": {
        "EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
        "TRACE_DIRECTORY": "D:\\outputs\\traces"
      },
      "description": "Everything search integration for fast file/folder search"
    }
  }
}
  1. Restart Kiro to load the new MCP server
  2. Use Everything search through Kiro's agentic chat interface

Kiro-specific features:

  • Specs Integration: Use Everything search to find files when planning features with Kiro's spec-driven development
  • Hooks Automation: Set up automated file searches triggered by development events
  • Natural Language: Ask Kiro to "find all TypeScript files modified today" and it will use Everything search
  • Project Context: Kiro understands your project structure and can combine Everything search with its codebase knowledge

SpecStory

SpecStory is a documentation and specification platform designed for LLM integration. To add Everything search to SpecStory workflows:

  1. Set up MCP integration in your SpecStory environment
  2. Add the Everything MCP server to your SpecStory MCP configuration:
{
  "mcpServers": {
    "everything-search": {
      "command": "node",
      "args": ["path/to/everything-mcp/dist/index.js"],
      "env": {
        "EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
        "TRACE_DIRECTORY": "D:\\outputs\\traces"
      },
      "description": "Everything search for finding specification files and documentation"
    }
  }
}
  1. Restart SpecStory to load the new MCP server
  2. Use Everything search to find relevant specification files, documentation, and project artifacts

SpecStory-specific features:

  • Specification Search: Quickly find spec files, requirements documents, and related artifacts
  • Documentation Discovery: Search across all project documentation and markdown files
  • Cross-Reference Lookup: Find files referenced in specifications using Everything's fast indexing
  • Version Control Integration: Search for spec files across different versions and branches
  • Context-Aware Documentation: Combine Everything search with SpecStory's LLM context for comprehensive documentation workflows

Example SpecStory workflows:

{
  "query": "ext:md spec OR requirement OR design",
  "fileTypes": ["md", "mdx", "txt"],
  "sortBy": "date"
}

🔍 Available Tools

1. everything_search

Basic file and folder search with Everything syntax support.

Parameters:

  • query (required): Search query using Everything syntax
  • maxResults (optional): Maximum results to return (default: 50)
  • fileOnly (optional): Search files only (default: false)
  • folderOnly (optional): Search folders only (default: false)

2. everything_search_advanced

Advanced search with comprehensive filtering and sorting options.

Parameters:

  • query (required): Search query
  • maxResults (optional): Maximum results (default: 50)
  • sortBy (optional): Sort by 'name', 'size', 'date', or 'path'
  • fileTypes (optional): Array of file extensions to filter
  • includeHidden (optional): Include hidden files/folders
  • regex (optional): Use regex search
  • caseSensitive (optional): Case sensitive search

3. everything_check_service

Verify Everything service is running and accessible.

4. everything_search_docs

Specialized documentation and specification search optimized for SpecStory workflows.

Parameters:

  • query (required): Search query for documentation files
  • maxResults (optional): Maximum results (default: 50)
  • docTypes (optional): Documentation file types to search ['md', 'mdx', 'txt', 'rst', 'adoc']
  • includeArchived (optional): Include archived/old documentation (default: false)
  • sortBy (optional): Sort by 'relevance', 'date', 'name', or 'size'

Features:

  • Smart categorization: Automatically categorizes docs as specs, requirements, designs, APIs, etc.
  • Priority ranking: Relevance-based sorting puts most important docs first
  • Archive filtering: Excludes deprecated/old documentation by default
  • SpecStory optimization: Designed for specification and documentation workflows

🔤 Everything Search Syntax

The server supports full Everything search syntax:

  • Wildcards: *.txt, project*
  • Extensions: ext:js, ext:pdf
  • Size filters: size:>1mb, size:<100kb
  • Date filters: dm:today, dm:thisweek
  • Path filters: path:documents, path:"c:\projects"
  • Boolean operators: AND, OR, NOT
  • Exact phrases: "exact phrase"

📝 Examples

Basic Search

{
  "query": "*.py",
  "maxResults": 100
}

Advanced Search

{
  "query": "dm:lastweek",
  "fileTypes": ["mp4", "mkv", "avi"],
  "sortBy": "size"
}

Development Files

{
  "query": "component",
  "fileTypes": ["jsx", "tsx"],
  "caseSensitive": false
}

🔧 Troubleshooting

Common Issues

  1. "es.exe not found"

    • Verify Everything is installed
    • Check path: C:\Program Files\Everything\es.exe
    • Try running Everything as administrator
  2. "No results returned"

    • Ensure Everything database is indexed
    • Check if Everything service is running
    • Use everything_check_service tool
  3. "Permission denied"

    • Run Everything as administrator
    • Check Windows permissions
    • Verify Everything service is started

Debug Mode

The server logs all operations to the trace directory:

  • Default Location: D:\outputs\traces\everything-mcp-{timestamp}
  • Files: Operation logs, development diary, error traces
  • Use for debugging search queries and server issues

🏗️ Architecture

The Everything MCP Server provides a bridge between AI assistants and the Everything search engine:

  1. MCP Client (Cursor/Kiro/SpecStory/Claude) sends search requests
  2. MCP Server validates and processes requests
  3. es.exe executes the actual search
  4. Results are parsed and returned as structured JSON
  5. Trace System logs all operations for debugging

🚀 Development

# Run in development mode
npm run dev

# Build for production
npm run build

# Start built server
npm start

File Structure

everything-mcp/
├── src/
│   └── index.ts              # Main server implementation
├── dist/                     # Built files (generated)
├── package.json              # Dependencies and scripts
├── tsconfig.json             # TypeScript configuration
├── architecture.svg          # Architecture diagram
└── README.md                 # This file

📄 License

MIT License - See LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

🙏 Acknowledgments

  • voidtools for the amazing Everything search engine
  • Model Context Protocol for the MCP specification
  • The Cursor team for MCP integration
  • Kiro IDE for agentic development with MCP support
  • SpecStory for specification and documentation workflows

Made with ❤️ for the Everything and AI community

Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"//": "MCP Configuration for Everything Search",
"//": "Configuration examples for Cursor IDE, Kiro IDE, and SpecStory",
"mcp": {
"servers": {
"everything-search": {
"command": "node",
"args": [
"path/to/everything-mcp/dist/index.js"
],
"env": {
"EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
},
"description": "Everything search integration for fast file/folder search"
}
}
},
"//": "Cursor IDE alternative configurations:",
"mcp_global_install": {
"servers": {
"everything-search": {
"command": "everything-mcp-server",
"args": [],
"env": {
"EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
}
}
}
},
"mcp_custom_path": {
"servers": {
"everything-search": {
"command": "node",
"args": [
"C:\\path\\to\\everything-mcp\\dist\\index.js"
],
"env": {
"EVERYTHING_PATH": "C:\\CustomPath\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
}
}
}
},
"//": "Kiro IDE configurations:",
"//": "Add to your Kiro MCP configuration file",
"kiro_mcp_config": {
"mcpServers": {
"everything-search": {
"command": "node",
"args": [
"path/to/everything-mcp/dist/index.js"
],
"env": {
"EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
},
"description": "Everything search integration for agentic development"
}
}
},
"kiro_global_install": {
"mcpServers": {
"everything-search": {
"command": "everything-mcp-server",
"args": [],
"env": {
"EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
},
"description": "Everything search with global npm install"
}
}
},
"//": "SpecStory configurations:",
"//": "Add to your SpecStory MCP configuration file",
"specstory_mcp_config": {
"mcpServers": {
"everything-search": {
"command": "node",
"args": [
"path/to/everything-mcp/dist/index.js"
],
"env": {
"EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
},
"description": "Everything search for specification and documentation workflows"
}
}
},
"specstory_documentation_focused": {
"mcpServers": {
"everything-search": {
"command": "node",
"args": [
"path/to/everything-mcp/dist/index.js"
],
"env": {
"EVERYTHING_PATH": "C:\\Program Files\\Everything\\es.exe",
"TRACE_DIRECTORY": "D:\\outputs\\traces"
},
"description": "Everything search optimized for finding specs, docs, and requirements"
}
}
}
}
#!/usr/bin/env node
/**
* MCP Server for Everything Search (es.exe)
*
* Provides file search capabilities using voidtools Everything search engine
* via the es.exe command line interface.
*
* @author Everything MCP Server
* @version 1.0.0
* @license MIT
*/
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import {
CallToolRequestSchema,
ErrorCode,
ListToolsRequestSchema,
McpError,
} from '@modelcontextprotocol/sdk/types.js';
import { spawn } from 'child_process';
import fs from 'fs/promises';
import path from 'path';
const EVERYTHING_PATH = process.env.EVERYTHING_PATH || 'C:\\Program Files\\Everything\\es.exe';
const TRACE_DIRECTORY = process.env.TRACE_DIRECTORY || 'D:\\outputs\\traces';
interface SearchResult {
path: string;
name: string;
size?: number;
modified?: string;
type: 'file' | 'folder';
}
class EverythingMCPServer {
private server: Server;
private traceDir: string;
constructor() {
this.server = new Server(
{
name: 'everything-search',
version: '1.0.0',
},
{
capabilities: {
tools: {},
},
}
);
this.traceDir = path.join(TRACE_DIRECTORY, `everything-mcp-${Date.now()}`);
this.setupHandlers();
this.initializeTrace();
}
private async initializeTrace(): Promise<void> {
try {
await fs.mkdir(this.traceDir, { recursive: true });
const diaryPath = path.join(this.traceDir, 'development_diary.md');
const timestamp = new Date().toISOString();
const diaryContent = `# Everything MCP Server Session
## ${timestamp}
- Initialized MCP server for Everything search
- Created trace directory: ${this.traceDir}
- Server capabilities: file search, filtering, sorting
- Target: es.exe integration for AI assistants
## Architecture
- MCP Server with stdio transport
- Direct es.exe command execution
- Result parsing and formatting
- Error handling and validation
## Tools Available
- everything_search: General file/folder search
- everything_search_advanced: Advanced search with filters
- everything_check_service: Verify Everything service status
`;
await fs.writeFile(diaryPath, diaryContent);
console.error(`Trace initialized: ${this.traceDir}`);
} catch (error) {
console.error('Failed to initialize trace:', error);
}
}
private async logTrace(operation: string, data: any): Promise<void> {
try {
const timestamp = new Date().toISOString();
const logPath = path.join(this.traceDir, `${operation}_${Date.now()}.json`);
const logData = {
timestamp,
operation,
data,
traceDirectory: this.traceDir
};
await fs.writeFile(logPath, JSON.stringify(logData, null, 2));
} catch (error) {
console.error('Failed to log trace:', error);
}
}
private setupHandlers(): void {
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
await this.logTrace('list_tools', { timestamp: new Date().toISOString() });
return {
tools: [
{
name: 'everything_search',
description: 'Search for files and folders using Everything search engine',
inputSchema: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'Search query (supports Everything syntax)',
},
maxResults: {
type: 'number',
description: 'Maximum number of results to return (default: 50)',
default: 50,
},
fileOnly: {
type: 'boolean',
description: 'Search files only (exclude folders)',
default: false,
},
folderOnly: {
type: 'boolean',
description: 'Search folders only (exclude files)',
default: false,
},
},
required: ['query'],
},
},
{
name: 'everything_search_advanced',
description: 'Advanced search with filtering and sorting options',
inputSchema: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'Search query',
},
maxResults: {
type: 'number',
description: 'Maximum results (default: 50)',
default: 50,
},
sortBy: {
type: 'string',
enum: ['name', 'size', 'date', 'path'],
description: 'Sort results by field',
default: 'name',
},
fileTypes: {
type: 'array',
items: { type: 'string' },
description: 'Filter by file extensions (e.g., ["js", "ts", "md"])',
},
includeHidden: {
type: 'boolean',
description: 'Include hidden files/folders',
default: false,
},
regex: {
type: 'boolean',
description: 'Use regex search',
default: false,
},
caseSensitive: {
type: 'boolean',
description: 'Case sensitive search',
default: false,
},
},
required: ['query'],
},
},
{
name: 'everything_check_service',
description: 'Check if Everything service is running and accessible',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'everything_search_docs',
description: 'Search for documentation, specifications, and requirement files optimized for SpecStory workflows',
inputSchema: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'Search query for documentation files',
},
maxResults: {
type: 'number',
description: 'Maximum results (default: 50)',
default: 50,
},
docTypes: {
type: 'array',
items: { type: 'string' },
description: 'Documentation types to search for: ["spec", "requirements", "design", "api", "readme", "docs"]',
default: ['md', 'mdx', 'txt', 'rst', 'adoc']
},
includeArchived: {
type: 'boolean',
description: 'Include archived/old documentation',
default: false,
},
sortBy: {
type: 'string',
enum: ['relevance', 'date', 'name', 'size'],
description: 'Sort results by field',
default: 'relevance',
},
},
required: ['query'],
},
},
],
};
});
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
await this.logTrace('call_tool', {
tool: request.params.name,
arguments: request.params.arguments,
});
switch (request.params.name) {
case 'everything_search':
return await this.handleSearch(request.params.arguments);
case 'everything_search_advanced':
return await this.handleAdvancedSearch(request.params.arguments);
case 'everything_check_service':
return await this.handleServiceCheck();
case 'everything_search_docs':
return await this.handleDocumentationSearch(request.params.arguments);
default:
throw new McpError(
ErrorCode.MethodNotFound,
`Unknown tool: ${request.params.name}`
);
}
});
}
private async executeEverything(args: string[]): Promise<string> {
return new Promise((resolve, reject) => {
const process = spawn(EVERYTHING_PATH, args, {
stdio: ['pipe', 'pipe', 'pipe'],
shell: true,
});
let stdout = '';
let stderr = '';
process.stdout.on('data', (data) => {
stdout += data.toString();
});
process.stderr.on('data', (data) => {
stderr += data.toString();
});
process.on('close', (code) => {
if (code === 0) {
resolve(stdout);
} else {
reject(new Error(`es.exe exited with code ${code}: ${stderr}`));
}
});
process.on('error', (error) => {
reject(new Error(`Failed to execute es.exe: ${error.message}`));
});
});
}
private async handleSearch(args: any) {
try {
const { query, maxResults = 50, fileOnly = false, folderOnly = false } = args;
const esArgs = ['-n', maxResults.toString()];
if (fileOnly) esArgs.push('-file');
if (folderOnly) esArgs.push('-folder');
esArgs.push(query);
const output = await this.executeEverything(esArgs);
const results = this.parseSearchResults(output);
await this.logTrace('search_results', {
query,
resultCount: results.length,
args: esArgs,
});
return {
content: [
{
type: 'text',
text: JSON.stringify({
query,
resultCount: results.length,
results: results.slice(0, maxResults),
}, null, 2),
},
],
};
} catch (error) {
await this.logTrace('search_error', { error: error.message });
throw new McpError(ErrorCode.InternalError, `Search failed: ${error.message}`);
}
}
private async handleAdvancedSearch(args: any) {
try {
const {
query,
maxResults = 50,
sortBy = 'name',
fileTypes = [],
includeHidden = false,
regex = false,
caseSensitive = false,
} = args;
const esArgs = ['-n', maxResults.toString()];
// Sort options
switch (sortBy) {
case 'size': esArgs.push('-sort', 'size'); break;
case 'date': esArgs.push('-sort', 'dm'); break;
case 'path': esArgs.push('-sort', 'path'); break;
default: esArgs.push('-sort', 'name'); break;
}
// Search options
if (regex) esArgs.push('-regex');
if (caseSensitive) esArgs.push('-case');
if (!includeHidden) esArgs.push('-no-hidden');
// Build query with file type filters
let finalQuery = query;
if (fileTypes.length > 0) {
const extensions = fileTypes.map(ext => `ext:${ext}`).join(' | ');
finalQuery = `(${extensions}) ${query}`;
}
esArgs.push(finalQuery);
const output = await this.executeEverything(esArgs);
const results = this.parseSearchResults(output);
await this.logTrace('advanced_search_results', {
query: finalQuery,
options: { sortBy, fileTypes, includeHidden, regex, caseSensitive },
resultCount: results.length,
});
return {
content: [
{
type: 'text',
text: JSON.stringify({
query: finalQuery,
options: { sortBy, fileTypes, includeHidden, regex, caseSensitive },
resultCount: results.length,
results: results.slice(0, maxResults),
}, null, 2),
},
],
};
} catch (error) {
await this.logTrace('advanced_search_error', { error: error.message });
throw new McpError(ErrorCode.InternalError, `Advanced search failed: ${error.message}`);
}
}
private async handleServiceCheck() {
try {
// Test with a simple query
const output = await this.executeEverything(['-n', '1', 'test']);
await this.logTrace('service_check', {
status: 'running',
everythingPath: EVERYTHING_PATH,
});
return {
content: [
{
type: 'text',
text: JSON.stringify({
status: 'running',
everythingPath: EVERYTHING_PATH,
message: 'Everything service is accessible and responding',
}, null, 2),
},
],
};
} catch (error) {
await this.logTrace('service_check_error', { error: error.message });
return {
content: [
{
type: 'text',
text: JSON.stringify({
status: 'error',
everythingPath: EVERYTHING_PATH,
message: `Everything service check failed: ${error.message}`,
troubleshooting: [
'Ensure Everything is installed and running',
'Check if es.exe exists at the specified path',
'Verify Everything service is started',
'Run Everything as administrator if needed',
],
}, null, 2),
},
],
};
}
}
private async handleDocumentationSearch(args: any) {
try {
const {
query,
maxResults = 50,
docTypes = ['md', 'mdx', 'txt', 'rst', 'adoc'],
includeArchived = false,
sortBy = 'relevance',
} = args;
const esArgs = ['-n', maxResults.toString()];
// Sort options for documentation
switch (sortBy) {
case 'date': esArgs.push('-sort', 'dm'); break;
case 'name': esArgs.push('-sort', 'name'); break;
case 'size': esArgs.push('-sort', 'size'); break;
default: esArgs.push('-sort', 'name'); break; // Default to name for docs
}
// Build documentation-focused query
let docQuery = query;
// Add documentation file extensions
const extensions = docTypes.map(ext => `ext:${ext}`).join(' | ');
// Enhance query with documentation keywords
const docKeywords = [
'spec', 'specification', 'requirement', 'design', 'architecture',
'api', 'readme', 'doc', 'documentation', 'guide', 'manual',
'proposal', 'rfc', 'adr', 'decision'
];
// Combine extensions and query
let finalQuery = `(${extensions})`;
if (query.trim()) {
finalQuery += ` (${docQuery})`;
}
// Exclude archived files unless requested
if (!includeArchived) {
esArgs.push('-no-archived');
finalQuery += ' !archive !old !deprecated !legacy';
}
esArgs.push(finalQuery);
const output = await this.executeEverything(esArgs);
const results = this.parseSearchResults(output);
// Enhance results with documentation context
const enhancedResults = results.map(result => ({
...result,
category: this.categorizeDocumentationFile(result.name, result.path),
priority: this.calculateDocumentationPriority(result.name, result.path, docKeywords)
}));
// Sort by priority if relevance is selected
if (sortBy === 'relevance') {
enhancedResults.sort((a, b) => (b as any).priority - (a as any).priority);
}
await this.logTrace('documentation_search_results', {
query: finalQuery,
options: { docTypes, includeArchived, sortBy },
resultCount: enhancedResults.length,
categories: this.summarizeDocumentationCategories(enhancedResults)
});
return {
content: [
{
type: 'text',
text: JSON.stringify({
query: finalQuery,
originalQuery: query,
options: { docTypes, includeArchived, sortBy },
resultCount: enhancedResults.length,
results: enhancedResults.slice(0, maxResults),
summary: this.summarizeDocumentationCategories(enhancedResults)
}, null, 2),
},
],
};
} catch (error) {
await this.logTrace('documentation_search_error', { error: error.message });
throw new McpError(ErrorCode.InternalError, `Documentation search failed: ${error.message}`);
}
}
private categorizeDocumentationFile(filename: string, filepath: string): string {
const lower = filename.toLowerCase();
const path = filepath.toLowerCase();
if (lower.includes('readme')) return 'readme';
if (lower.includes('spec') || lower.includes('specification')) return 'specification';
if (lower.includes('requirement') || lower.includes('req')) return 'requirements';
if (lower.includes('design') || lower.includes('architecture')) return 'design';
if (lower.includes('api')) return 'api';
if (lower.includes('guide') || lower.includes('tutorial')) return 'guide';
if (lower.includes('rfc') || lower.includes('proposal')) return 'proposal';
if (lower.includes('adr') || lower.includes('decision')) return 'decision';
if (path.includes('/docs/') || path.includes('\\docs\\')) return 'documentation';
return 'general';
}
private calculateDocumentationPriority(filename: string, filepath: string, keywords: string[]): number {
let priority = 0;
const lower = filename.toLowerCase() + ' ' + filepath.toLowerCase();
// Higher priority for important doc types
if (lower.includes('readme')) priority += 10;
if (lower.includes('spec') || lower.includes('specification')) priority += 9;
if (lower.includes('requirement')) priority += 8;
if (lower.includes('design') || lower.includes('architecture')) priority += 7;
if (lower.includes('api')) priority += 6;
// Boost for keywords in filename
keywords.forEach(keyword => {
if (filename.toLowerCase().includes(keyword)) priority += 2;
if (filepath.toLowerCase().includes(keyword)) priority += 1;
});
// Prefer newer-style documentation
if (filename.endsWith('.md') || filename.endsWith('.mdx')) priority += 3;
if (filepath.includes('/docs/') || filepath.includes('\\docs\\')) priority += 2;
return priority;
}
private summarizeDocumentationCategories(results: any[]): any {
const categories = {};
results.forEach(result => {
const category = result.category || 'general';
categories[category] = (categories[category] || 0) + 1;
});
return categories;
}
private parseSearchResults(output: string): SearchResult[] {
const lines = output.trim().split('\n').filter(line => line.trim());
return lines.map(line => {
const fullPath = line.trim();
const name = path.basename(fullPath);
const isDirectory = !path.extname(fullPath);
return {
path: fullPath,
name,
type: isDirectory ? 'folder' : 'file',
};
});
}
async run(): Promise<void> {
const transport = new StdioServerTransport();
await this.server.connect(transport);
console.error('Everything MCP Server running on stdio');
console.error(`Trace directory: ${this.traceDir}`);
}
}
// Start the server
const server = new EverythingMCPServer();
server.run().catch(console.error);
MIT License
Copyright (c) 2025 Everything MCP Server Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"name": "everything-mcp-server",
"version": "1.0.0",
"description": "MCP Server for voidtools Everything search integration with AI assistants",
"type": "module",
"main": "dist/index.js",
"bin": {
"everything-mcp-server": "dist/index.js"
},
"scripts": {
"build": "tsc",
"dev": "tsx src/index.ts",
"start": "node dist/index.js",
"prepare": "npm run build"
},
"keywords": [
"mcp",
"everything",
"search",
"files",
"cursor",
"ai",
"model-context-protocol",
"voidtools"
],
"author": "Everything MCP Server Contributors",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/yourusername/everything-mcp.git"
},
"bugs": {
"url": "https://github.com/yourusername/everything-mcp/issues"
},
"homepage": "https://github.com/yourusername/everything-mcp#readme",
"dependencies": {
"@modelcontextprotocol/sdk": "^0.4.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"tsx": "^4.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=18.0.0"
},
"os": [
"win32"
]
}
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"allowJs": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment